class: name:Thr2 longname:Threshold 2 description:~ If (input>=t) then output=hi, else if (output<=-t) output=lo, else pass through. This is a modified Threshold neuron to use with a sample Capture The Flag battle. This neuron passess signal without altering it in the range [-t, t]. Outside of this range, the neuron outputs the truncated input. This neuron is used to "steer" the food finder according to sensory inputs from left and right side.~ prefinputs:-1 prefoutput:1 icon:~ 24,3,3,25,0,25,100,75,50,25,0,1,75,50,100,50,3,30,75,40,75,40,40,60,40~ code:~ function init() { } function go() { if (Neuro.weightedInputSum >= Fields.t) Neuro.state = Fields.hi; else if (Neuro.weightedInputSum <= -Fields.t) Neuro.state = Fields.lo; else Neuro.state = Neuro.weightedInputSum; } ~ prop: id:t name:threshold type:f prop: id:lo name:low output value type:f prop: id:hi name:high output value type:f