Code center > Suggestions
Codules
shvarz:
Pretty confusing system, I can't quite envision it. It is definetely not obvious to me that infinite loops are impossible. Hmm, I need to draw this out...
Also, seems to me that codule 1 with code
cond
start
1 goto
1 goto
stop
would result in 25 repeats of itself. Is that right? Does each self-refferring goto command multiply the number of repeats by the allowed number of codule references on the stack?
If that's true then it seems like CPU taxation might be pretty heavy. Say you allow 100 repeats and then codule 1 becomes
cond
start
1 goto
1 goto
1 goto
stop
That would mean 100^3 (million) repeats of this codule. Are you sure it won't slow down the program?
Numsgil:
It makes a bit more sense if you're familiar with how computers execute programs, it mimics that quite closely.
In you example:
start
1 goto
1 goto
The actual number of executions this would cause is complicated to calculate, but it's like this:
x = number of 1 goto statements (in this case 2)
y = maximum tree depth
(x ^ (y - 1) + 1) * ceil(y / 2)
or something similar. Which would be a good example of why keeping the maximum tree depth fairly low is a good idea, now that I think of it.
A million calls would slow the program down no doubt. 1000 might be a reasonable upper bound on the number of calls that's realistic.
EricL:
I worry about getting sidetracked in this thread. I love this kind of dicsussion, but I should be clear that I am not militant in my position. I fully supoport the proposal as made including the proposal on preventing infinite loops. Codules are a great thing, I love the idea.
I remain of the general philosphy that the engine should attempt to do exactly what the DNA says without underlying, hidden safeguards that bots and selection in general are unaware of but I yield (for now) to the voice of precedence and experience. :)
Elite:
IMO codules are a great idea. They're like subroutines. They help break up the code and form more complex DNA structures.
A few questions:
1) If I fire this virus:
--- Code: ---start
goto 5
stop
--- End code ---
Then when the virus enters a bot it will call their codule 5, correct?
2) What about bots deleting and writing to codules? (might start a new thread about this)
3) Can I fire my root DNA as a virus :P
Numsgil:
--- Quote ---IMO codules are a great idea. They're like subroutines. They help break up the code and form more complex DNA structures.
A few questions:
1) If I fire this virus:
--- Code: ---start
goto 5
stop
--- End code ---
Then when the virus enters a bot it will call their codule 5, correct?
--- End quote ---
Right. So it would probably primarily be for sharing DNA with conspecs, a kind of horizontal gene transfer.
--- Quote ---3) Can I fire my root DNA as a virus :P
--- End quote ---
I'm not sure. I'm leaning towards no, since it's insanely powerful.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version