Author Topic: Super crazy/awesome idea  (Read 6367 times)

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
Super crazy/awesome idea
« on: December 14, 2009, 05:18:39 PM »
Is it possible to get an OS running on a DB? Would there be any benefits?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Super crazy/awesome idea
« Reply #1 on: December 14, 2009, 08:39:49 PM »
Depends what you want your operating system to do.

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
Super crazy/awesome idea
« Reply #2 on: December 14, 2009, 11:11:56 PM »
Maybe it can execute more than 1 gene per cycle? You mentioned that without an OS, a processor can run only 1 program at a time or something, just like a DB.
So an OS should be able to open up new possibilities?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Super crazy/awesome idea
« Reply #3 on: December 15, 2009, 12:01:24 AM »
Well, you could probably write something to manage different threads.  But bots have infinite processing resources per cycle, so there's probably not much reason to do that.

Offline jknilinux

  • Bot Destroyer
  • ***
  • Posts: 468
    • View Profile
Super crazy/awesome idea
« Reply #4 on: December 15, 2009, 10:29:03 AM »
Whooops, bots can already run more than 1 gene/cycle, right? I meant executing loops and such, because loops are illegal, right? Any other illegal data structures?

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Super crazy/awesome idea
« Reply #5 on: December 15, 2009, 12:37:00 PM »
Infinite loops are illegal.  Though a finite loop could be unrolled...

Or more precisely, there's only one loop, and it happens once per cycle when the DNA is re-executed.

You might be able to create something that let you simulate loops.  Though I imagine it would be a huge pain.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Super crazy/awesome idea
« Reply #6 on: January 02, 2010, 08:46:45 PM »
This sounds familiar...  
Anyway, the two best options to prevent infinite loops it to have a metastructure that simulates looping by accessing the substructures or 'genes', or to have a limiting factor, such as time or a command cap. The second option could be a bit wobbly, as you don't want the execution to suddenly break off in the middle of some important gene. Having some built-in infinite-loop detector would have to re-check at every mutation, but could be thee best option for low-mutation simulations.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
Super crazy/awesome idea
« Reply #7 on: January 02, 2010, 10:19:38 PM »
Quote from: bacillus
Having some built-in infinite-loop detector would have to re-check at every mutation, but could be thee best option for low-mutation simulations.

Infinite loops alone aren't the entire problem, though.  Imagine 3 nested loops of 1..1000 each.  The result is O(n^3) = 1 Billion operations.  Meaning, per bot, that loop would take something on the order of a second to execute.  So the only realistic way to allow looping is to have only a single loop at a time that can run.  But that's such an arbitrary rule.

Or charging per bp executed, or giving only finite processing time, but both are against the spirit of Darwinbots IMO.

Offline bacillus

  • Bot Overlord
  • ****
  • Posts: 907
    • View Profile
Super crazy/awesome idea
« Reply #8 on: January 03, 2010, 08:00:43 PM »
So metastructuring seems to be the best option. While not exactly looping, it would be much easier than copy/pasting the same code over and over.
"They laughed at Columbus, they laughed at Fulton, they laughed at the Wright brothers. But they also laughed at Bozo the Clown."
- Carl Sagan

Offline ashton15

  • Bot Builder
  • **
  • Posts: 99
    • View Profile
Super crazy/awesome idea
« Reply #9 on: March 13, 2010, 06:18:36 PM »
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?
« Last Edit: March 13, 2010, 06:19:14 PM by ashton15 »

Offline Ammeh

  • Queen of the Internets
  • Bot Destroyer
  • ***
  • Posts: 169
    • View Profile
Super crazy/awesome idea
« Reply #10 on: March 13, 2010, 06:44:44 PM »
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?

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.

Offline Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Super crazy/awesome idea
« Reply #11 on: March 13, 2010, 08:24:34 PM »
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: [Select]
'gene 1
Cond
*a *p !=
start
a inc
stop

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

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.

Offline Moonfisher

  • Bot Overlord
  • ****
  • Posts: 592
    • View Profile
Super crazy/awesome idea
« Reply #12 on: March 14, 2010, 05:18:20 AM »
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...

Offline ikke

  • Bot Destroyer
  • ***
  • Posts: 300
    • View Profile
Super crazy/awesome idea
« Reply #13 on: March 14, 2010, 05:29:34 AM »
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...
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.

Offline Houshalter

  • Bot Destroyer
  • ***
  • Posts: 312
    • View Profile
Super crazy/awesome idea
« Reply #14 on: March 14, 2010, 10:46:04 AM »
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: [Select]
[1=]
*.refeye *.myeye !=
*.eye5 40 >
stop

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

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.