source:
experiments/frams/capture-the-flag/data/scripts/threshold2.neuro
@
1326
Last change on this file since 1326 was 480, checked in by , 9 years ago | |
---|---|
File size: 1014 bytes |
Rev | Line | |
---|---|---|
[232] | 1 | class: |
2 | name:Thr2 | |
3 | longname:Threshold 2 | |
4 | description:~ | |
5 | If (input>=t) then output=hi, else if (output<=-t) output=lo, else pass through. | |
6 | ||
7 | This is a modified Threshold neuron to use with a sample Capture The Flag battle. | |
8 | This neuron passess signal without altering it in the range [-t, t]. | |
9 | Outside of this range, the neuron outputs the truncated input. | |
10 | This neuron is used to "steer" the food finder according to sensory inputs from left and right side.~ | |
11 | prefinputs:-1 | |
12 | prefoutput:1 | |
13 | icon:~ | |
14 | 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~ | |
15 | code:~ | |
16 | function init() | |
17 | { | |
18 | } | |
19 | ||
20 | function go() | |
21 | { | |
[480] | 22 | if (Neuro.weightedInputSum >= NeuroProperties.t) |
23 | Neuro.state = NeuroProperties.hi; | |
24 | else if (Neuro.weightedInputSum <= -NeuroProperties.t) | |
25 | Neuro.state = NeuroProperties.lo; | |
[232] | 26 | else |
27 | Neuro.state = Neuro.weightedInputSum; | |
28 | } | |
29 | ~ | |
30 | ||
[480] | 31 | property: |
[232] | 32 | id:t |
33 | name:threshold | |
34 | type:f | |
35 | ||
[480] | 36 | property: |
[232] | 37 | id:lo |
38 | name:low output value | |
39 | type:f | |
40 | ||
[480] | 41 | property: |
[232] | 42 | id:hi |
43 | name:high output value | |
44 | type:f | |
45 |
Note: See TracBrowser
for help on using the repository browser.