Line | |
---|
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 | {
|
---|
22 | if (Neuro.weightedInputSum >= NeuroProperties.t)
|
---|
23 | Neuro.state = NeuroProperties.hi;
|
---|
24 | else if (Neuro.weightedInputSum <= -NeuroProperties.t)
|
---|
25 | Neuro.state = NeuroProperties.lo;
|
---|
26 | else
|
---|
27 | Neuro.state = Neuro.weightedInputSum;
|
---|
28 | }
|
---|
29 | ~
|
---|
30 |
|
---|
31 | property:
|
---|
32 | id:t
|
---|
33 | name:threshold
|
---|
34 | type:f
|
---|
35 |
|
---|
36 | property:
|
---|
37 | id:lo
|
---|
38 | name:low output value
|
---|
39 | type:f
|
---|
40 |
|
---|
41 | property:
|
---|
42 | id:hi
|
---|
43 | name:high output value
|
---|
44 | type:f
|
---|
45 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.