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 >= NeuroProperties.t) Neuro.state = NeuroProperties.hi; else if (Neuro.weightedInputSum <= -NeuroProperties.t) Neuro.state = NeuroProperties.lo; else Neuro.state = Neuro.weightedInputSum; } ~ property: id:t name:threshold type:f property: id:lo name:low output value type:f property: id:hi name:high output value type:f