Bots and Simulations > DNA - General

Console question

(1/2) > >>

AZPaul:
Howdy, y'all,

Question on what I'm look at on the console.

If my understanding is correct the memory block I can see in the console is the one built [you]after[/you] program execution [you]before[/you] the DNA acts on it. Yes?

Much obliged,

-P

PurpleYouko:
Yup

Spot on!

The DNA is parsed at the start of the cycle. This places all of the values into the robot's memory cells.
The console displays them at this point so when the console tells you that eye5 sees 64, that is exactly what the robot sees right now.
The memory values haven't been processed and converted into actions yet.

AZPaul:

--- Quote ---The DNA is parsed at the start of the cycle. This places all of the values into the robot's memory cells.
The console displays them at this point so when the console tells you that eye5 sees 64, that is exactly what the robot sees right now.
The memory values haven't been processed and converted into actions yet.
--- End quote ---

Now, you see, I read this as just the opposite of what I asked. Headspace and timing on the newbie's part. Let me get verbose so I understand:

Robot DNA manipulates memory block  >>---------------------- cycle start

Robot memory block passed to program for execution            

Program executes then returns memory block to robot   <<---- cycle end
<<------------------------------------------------------------------console view
Robot DNA manipulates memory block

Robot memory block passed to program for execution

Program executes then returns memory block to robot
<<----------------------------------------------------------------- console view
Robot DNA manipulates memory block

Is this correct?

Don't you just love ASCII as a drawing tool?

-P

PurpleYouko:
Oh I absolutely love it!

I am not quite with you on terminology here. What precisely do you mean by

--- Quote ---Program executes then returns memory block to robot
--- End quote ---
?

There is no return to memory after execution. A lot of values (all commands at least) are wiped as soon as they are executed and no values are ever added to memory locations either during or after execution. (one or two exceptions but not as a rule)
This is how it all works.....
(try it this way instead of with ASCII)
* ALL memory manipulation takes place right at the start when the DNA code is parsed in a sequential order through the genome.
* eyecells and other senses are updated. (actually happens from the start of the main loop but it makes more sense to show it here)
* memory values are stored into the console output (stored as a seperate block representing all memory locations at the start of the main cycle) as they are assigned. Nothing has been acted on yet.
* Now that the memory block has been modified for all actions specifically defined in the DNA (stuff like loading -1 into .shoot), the entire memory block  for all robots is handed over to the main loop.
* Main loop consists of several steps which are each carried out for all robots before moving on to the next step.
* These steps consist of. (not necessarily in exactly this order

* updating tie comunications
* updating other tie stuff
* updating shot positions
* shot collisions
* updating robot positions
* collisions
* console displayed here!
* Drawing robots
* drawing shots
* several others[/b]
That is it in a nutshell.
Just remember that nothing happens to the memory block after initial DNA parsing except for updating eye positions, and this still happens before displaying the data in the console.

Basically, if you look at a robot in the console and check its eyes, you get a readback of everything it can see in its present screen position ie. it hasn't moved yet in response to the impulses from the DNA.
Let's say you have a gene that will turn your robot 150 points left (150 .aimsx store) if eye 7 is greater than 15.
You can actually see from the console that eye7 = 28
when you press the button to move it forward one cycle, the robot will be seen to rotate left by a value of 150.

Actually I may have been a little misleading here. It isn't so much that the memory block hasn't been processed yet as that nothing on the screen has actually been updated so it just looks like it hasn't been.

PurpleYouko:
Well that was weird!  :blink:

That list works perfectly in the post preview yet it comes out weird in the post itself. I have edited it about a dozen times but it still won't accept the sub-list (highlighted in bold)

Navigation

[0] Message Index

[#] Next page

Go to full version