Bots and Simulations > Bot Tavern

Super crazy/awesome idea

<< < (3/4) > >>

Ammeh:

--- Quote from: ashton15 ---Is

[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']cond
*.timer 10 >
start
0 .timer store
stop

not an infinite loop?
--- End quote ---

Not exactly. Yes, it would get activated every ten cycles, but it would only get activated once per cycle. In this context, an infinite loop would be one that repeated itself inside one cycle.

Houshalter:
Could we have the option to turn infinite loops on in our sim just for special instances. Otherwise the loop commands would just be ignored. I want to do a bot like this:


--- Code: ---'gene 1
Cond
*a *p !=
start
a inc
stop

'gene 2
Cond
*a *p !=
start
1 goto
stop
--- End code ---

Its easily broken into an infinite loop, for example what if p was less than a or what if the inc changed to a dec. This is why I suggest it be optional and only with mutations completely disabled. There should also be an option for stoping after a certain number of loops so if you make a mistake in the code, it doesn't freeze or crash.

Moonfisher:
I guess you could have a cap on bp execution per cycle, just stop at 32000.
Would just make the sim realy slow...
But if you want loops to work well I'd say there should be a fixed amount of bp executed per cycle and then you wouldn't have to worry about infinite loops. It probably wouldn't be much of a problem for evo bots, but it would make handcrafted bots harder to build (Unless you execute one bp per cycle, but then things would evolve rather slowly).
One thought occured to me, it might be possible to just execute one gene per cycle (Up to a cap of bp executed), this would make it possible to use infinite loops that jump back and forth, hit the cap, and keep going the next cycle, but also single genes who stop and wait for the cycle to finish.


Personaly I like the 1 pb per cycle idea, although you have to update a lot of heavy stuff every cycle without having done much code execution...

ikke:

--- Quote from: Moonfisher ---Personaly I like the 1 pb per cycle idea, although you have to update a lot of heavy stuff every cycle without having done much code execution...
--- End quote ---
No. The cap at one (or 10 or whatever) is an artificial one. It will have massive impact on evo direction in terms of maximum complexity. If I have 32000 energy and I want to spend massive amounts doing whatever why not. If it is useful I will recuperate the energy.
If you want loops (and I'm not sure this is a good idea) just have cost per BP executed. Any bot with an infinite loop will slow the sim down for one cycle, until it has spent its energy and dies. Just like a bot with broken reproduction explodes and dies.

Houshalter:
What about just letting bots reuse a piece of code as many times as they want on a cycle. For example, at the begging you could have a gene that looks like this:

--- Code: ---[1=]
*.refeye *.myeye !=
*.eye5 40 >
stop

cond
[1]
start
*.refvelup .up store
-1 .shoot store
stop
--- End code ---

This eliminates loops, makes bots easier to program, and is lets mutations affect an entire section of the bot, not just one gene. The only thing is that you can't let it refrence itself or any existing structure that refrences itself. You can have a hiearchy of commands, but you can't have it go in circles.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version