Skip to content

Rough Book

random musings

Menu
  • About Me
  • Contact
  • Projects
    • bAdkOde
    • CherryBlossom
    • FXCalendar
    • Sulekha
Menu

Artificial Life – some preliminary findings

Posted on October 19, 2004September 9, 2009 by vivin

I fnished my artificial life simulator over the weekend, and I have been running simulations on it. There were a few bugs initially that I quickly fixed. My initial simulations gave me some inexplicable "population explosion". For example, in one cycle I would have 31 creatures and in the next cycle I would suddenly have around 9,000. It didn't make very much sense until I analyzed the log files.

If any of you remember, I mentioned earlier that my "creatures" are nothing more than assembly programs. Each of these instructions (and parameters) translate into a bit pattern. Changes in the bit patterns lead to changes in the behaviour of the creature.

One of the instructions is a "reproduce instruction". This prompts the creature to create a copy of itself, with possible mutations. The instruction has a parameter that tells the creature how many copies to create. During the course of the simulation, certain creatures evolved with the reproduce instruction as their first instruction.

My supervisor program (God program) runs one instruction of every creature during one cycle (sort of like an pre-emptive multitasking operating system). If a creature happens to reproduce during the current cycle, then the supervisor program will execute the child's instructions as well in that current cycle. This led to an interesting situation. When the mutant that had the reproduce instruction as the first instruction reproduced, its child (if it didn't have a mutation that changed the instruction) also had the reproduce instruction as the first instruction. So the supervisor program would run the child, and the child would reproduce with a similar offspring. This went on until a mutant that did not have a "reproduce instruction" as the first instruction, evolved. As you can see, this is what led to the population explosion. I corrected this problem by adding "sexual maturity" and "reproductive energy threshold" parameters to the creatures. Basically, a creature can reproduce only if it has been in existence for a certain number of cycles, and if its current energy is above its reproductive energy threshold. This got rid of the population explosion problem.

My simulations gave me some other interesting results. One of the instructions that I have is a MOV instruction. This instruction moves a creature from one cell in the two-dimensional array to another cell. There is a variant of this instruction, known as the MOVA instruction. In the MOV instruction, if the creature tries to move to an occupied cell, it will retreat to its original position. However, in the MOVA instruction the creature will try to kill (and subsequently eat) the occupant if the destination cell is occupied. I had created a creature that simply ate, reproduced, and moved to different cells. I noted that after many generations, this creature had evolved into an aggressive one, that would eat, reproduce, and move aggressively (MOVA) into other cells. That was rather interesting!

I also saw natural selection at work. When I corrected my population explosion problem, I made it so that the reproductive threshold of a creature was higher than its initial (starting) energy. Over the course of many cycles, I saw that the creatures evolved such that the initial energy would be very high, and that their reproductive threshold would be very low. In additon, their reproductive age was lowered. I thought that my creatures were having it too easy, so I modified my code to make reproduction a costly instruction. After running my simulation, I noticed the opposite! Now the creatures evolved such that the reproductive energy threshold would be much higher than their initial energy. It would seem that the creatures wanted to build up enough energy to where they would be able to reproduce successfuly.

There is also one very interesting behaviour that I noticed. I provide branch instructions in my instruction set. A creature can branch to any part of its code. In addition, I also have a Decrement and Branch instruction that is useful for iterative loops. One of my creatures evolved a clever strategy. It would decrement and branch into the middle of the branch instruction. When I analyzed the code, I noticed in doing so, the creature was performing a MOVA instruction in fewer bytes than writing an explicit MOVA instruction. It also had the added benefit of performing the MOVA instruction in an iterative fashion so that it could travel around the two-dimensional array. There was a reason for this kind of behaviour though. A creature consumes energy when it performs an instruction, and the energy consumption is proportional to its code size, so it is amazing, but not surprising that such behaviour could arise.

There is still more work that I need to do. I am thinking of giving my creatures some "memory" in the form of stack and RAM. They will have some Store, Load, Push and Pop instructions whereby they can write to and read from memory. Also, I am thinking of adding some more "registers". Right now, the creatures have two count registers for performing iterative loops. My reason for adding more is this - I want the creatures to be able to act on the data in memory. For example, I can provide instructions that allow the creature to check the status of a particular cell, like if it is occupied, how much food it has, and so on. The creature can load data into the registers, and then use these registers as arguments for the cell checking instructions. This way I am hoping that my creatures will be able to evolve some rudimentary form of "intelligence", or "intelligent" behavior. This will also increase my instruction set. Right now, if a mutation results in an invalid instruction, the creature dies when it tries to execute it. Actually, that reminds me - I had creatures that evolved with invalid instructions, but they had also evolved branch instructions that would jump over the invalid section of code!

Most of these complex behaviours aren't that surprising when you consider natural selection... it is only err... natural that such behaviour should arise!

Well I guess that's all I have for now. I might make a separate page for this project where I can describe this project in more detail. I'll post more updates here after I run more simulations.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Archives

  • February 2023
  • April 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • June 2017
  • March 2017
  • November 2016
  • August 2016
  • July 2016
  • June 2016
  • February 2016
  • August 2015
  • July 2014
  • June 2014
  • March 2014
  • December 2013
  • November 2013
  • September 2013
  • July 2013
  • June 2013
  • March 2013
  • February 2013
  • January 2013
  • October 2012
  • July 2012
  • June 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • July 2011
  • June 2011
  • May 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • August 2008
  • March 2008
  • February 2008
  • November 2007
  • July 2007
  • June 2007
  • May 2007
  • March 2007
  • December 2006
  • October 2006
  • September 2006
  • August 2006
  • June 2006
  • April 2006
  • March 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • February 2005
  • October 2004
  • September 2004
  • August 2004
  • July 2004
  • June 2004
  • May 2004
  • April 2004
  • March 2004
  • February 2004
  • January 2004
  • December 2003
  • November 2003
  • October 2003
  • September 2003
  • July 2003
  • June 2003
  • May 2003
  • March 2003
  • February 2003
  • January 2003
  • December 2002
  • November 2002
  • October 2002
  • September 2002
  • August 2002
  • July 2002
  • June 2002
  • May 2002
  • April 2002
  • February 2002
  • September 2001
  • August 2001
  • April 2001
  • March 2001
  • February 2001
  • January 2001
  • December 2000
  • November 2000
  • October 2000
  • August 2000
  • July 2000
  • June 2000
  • May 2000
  • March 2000
  • January 2000
  • December 1999
  • November 1999
  • October 1999
  • September 1999
©2023 Rough Book | Built using WordPress and Responsive Blogily theme by Superb
All original content on these pages is fingerprinted and certified by Digiprove