Author Topic: Help with .timer  (Read 3472 times)

Offline PhiNotPi

  • Bot Builder
  • **
  • Posts: 64
    • View Profile
Help with .timer
« on: April 22, 2011, 11:31:47 AM »
I have been working on a simple, 7 neuron ANN bot.  Instead of changing the behavior of each neuron, the bot changes the connections between neurons.  Instead of learning off of it's past history, the bot copies the connections of conspecs with more nrg.  Each cycle, it chooses a connection using its timer.  It then puts the number into out1.  When another bot (with lower nrg) sees the bot with higher nrg, it takes its in1, and using the timer (modified to compensate for its increase over one cycle), it stores the number in the correct memory location, changing the connection.  The problem is that different bots seem to develop different timers, and this destroys the whole process.  How can I fix .timer to be the same for all of the bots?

I am willing to explain more about my bot if needed.

Here is the code:
Code: [Select]
cond
*.robage 5 =
start
1 50 store 'establish a constant 1
50 rnd 100 store 'shoot threshhold
9 rnd 51 add 61 store 'neuron inputs (adding, constant 1 not allowed)
9 rnd 51 add 62 store
9 rnd 51 add 63 store
9 rnd 51 add 64 store
9 rnd 51 add 65 store
9 rnd 51 add 66 store
9 rnd 51 add 67 store
9 rnd 51 add 71 store
9 rnd 51 add 72 store
9 rnd 51 add 73 store
9 rnd 51 add 74 store
9 rnd 51 add 75 store
9 rnd 51 add 76 store
9 rnd 51 add 77 store
10 rnd 50 add 81 store 'neuron inputs (subtracting, constant 1 allowed)
10 rnd 50 add 82 store
10 rnd 50 add 83 store
10 rnd 50 add 84 store
10 rnd 50 add 85 store
10 rnd 50 add 86 store
10 rnd 50 add 87 store
10 rnd 50 add 91 store
10 rnd 50 add 92 store
10 rnd 50 add 93 store
10 rnd 50 add 94 store
10 rnd 50 add 95 store
10 rnd 50 add 96 store
10 rnd 50 add 97 store
stop

cond
start
 *.timer 36 mod .timer store 'mod timer by 36
 *.refvelup 58 store 'update inputs
 *.refveldx 59 store
 *.eye5 60 store
 *61 * *71 * add *81 * sub *91 * sub 50 ceil -50 floor 51 store 'neuron 1
 *62 * *72 * add *82 * sub *92 * sub 50 ceil -50 floor 52 store '2
 *63 * *73 * add *83 * sub *93 * sub 50 ceil -50 floor 53 store '3
 *64 * *74 * add *84 * sub *94 * sub 50 ceil -50 floor 54 store '4
 *65 * *75 * add *85 * sub *95 * sub 50 ceil -50 floor 55 store '5
 *66 * *76 * add *86 * sub *96 * sub 50 ceil -50 floor 56 store '6
 *67 * *77 * add *87 * sub *97 * sub 50 ceil -50 floor 57 store '7
 *51 1256 mod .aimdx store 'update outputs
 *52 50 mod .up store
 *54 50 mod .dx store
 *.timer 61 add * .out1 store 'select memloc using timer and put in out1
stop

cond
 *.refnrg *.nrg >
 *.refeye *.myeye =
start
 *.in1 *.timer 1 sub 36 mod 61 add store 'update memloc from in1 using timer
stop

cond
 *53 *100 > 'only shoot if above threshhold
start
 -1 .shoot store
stop
end
« Last Edit: April 22, 2011, 04:00:41 PM by PhiNotPi »
I am biased neither towards nor against any single mathematical constant.

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Re: Help with .timer
« Reply #1 on: April 22, 2011, 06:39:57 PM »
When bots are spawned by the sim, their timers are randomized.  If bots are birthed, their timers should be synced with their parents.  Are you starting the sim with more than one individual of your species?  That would explain what you're seeing.