#lang racket
(require "Clases-neuron-capa-red.rkt")

(define proc
  (lambda (s)
    (cond
      ((= s 0) 0)
      ((= s 1) 1/2)
      ((= s 3) 1)
      (else -1)
      )
    ))
;;;;;;;;;;;;;;INSTANCIAS
;;;NEURONAS
(define n_1 (make-object neuron_entrada% proc 'n_1))
(define n_2 (make-object neuron_entrada% proc 'n_2))
(define n_3 (make-object neuron_entrada% proc 'n_3))
(define n_4 (make-object neuron_entrada% proc 'n_4))
(define n_5 (make-object neuron_entrada% proc 'n_5))
(define n_6 (make-object neuron_entrada% proc 'n_6))
(define n_7 (make-object neuron_entrada% proc 'n_7))
(define n_8 (make-object neuron_entrada% proc 'n_8))

;(define n1 
;  (make-object neurona%  'n1
;    0 propagacion_lineal lineal escalon_1))
;(define n2 
;  (make-object neurona%  'n2
;    0 propagacion_lineal lineal escalon_1))
;(define n3 
;  (make-object neurona%  'n3
;    0 propagacion_lineal lineal escalon_1))
;(define n4 
;  (make-object neurona%  'n4
;    0 propagacion_lineal lineal escalon_1))
;(define n5 
;  (make-object neurona%  'n5
;    0 propagacion_lineal lineal escalon_1))
;(define n6 
;  (make-object neurona%  'n6
;    0 propagacion_lineal lineal escalon_1))
;(define n7 
;  (make-object neurona%  'n7
;    0 propagacion_lineal lineal escalon_1))
;(define n8 
;  (make-object neurona%  'n8
;    0 propagacion_lineal lineal escalon_1))
;;;CAPAS
(define capa_1 
  (make-object capa_entrada% 'c_1
    (list n_1 n_2 n_3 n_4 n_5))); n_6 n_7 n_8) ))
;(define capa_2 
;  (make-object capa% 'c_2
;    (list n1 n2 n3); n4 n5 n6 n7 n8) 
;    (list
;     (list 1 0 0)
;     (list 0 1 0)
;     (list 0 0 1)
;;     (list 1 0 0 0 0 0 0 0)
;;     (list 0 1 0 0 0 0 0 0)
;;     (list 0 0 1 0 0 0 0 0)
;;     (list 0 0 0 1 0 0 0 0)
;;     (list 0 0 0 0 1 0 0 0)
;;     (list 0 0 0 0 0 1 0 0)
;;     (list 0 0 0 0 0 0 1 0)
;;     (list 0 0 0 0 0 0 0 1)
;     )
;    ))

;;;RED
(define discriminacion_olfativa (make-object red% (list capa_1)))
;;;;;;;;
(provide discriminacion_olfativa)
;;;;;;;
;(require "Training_set.rkt")
;
;(define estimulos->red
;  (lambda (red estimulos);estimulos : training_set
;    (let go ((i 0)
;             (j (length estimulos))
;             )
;      (if (= i j)
;          #t
;          (let* ((input (list-ref estimulos i));(car (list-ref estimulos i))
;                 (capa1 (send capa_1 proceso! input))
;                 (deseada (second (list-ref estimulos i)))
;                 (resp (send red proceso! input)) )
;            (if (equal? deseada resp)
;                (printf "~a --> ~a~n" input resp)
;                (printf "~a ==> ~a ==> ~a~n" input capa1 resp)       
;                )
;            (go (add1 i) j)
;            )
;          )
;      )
;    )
;  )
;
;    (estimulos->red discriminacion_tactil training_set)