Rough Book

random musings of just another computer nerd

Month: October, 2004

Artificial Life – some preliminary findings

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.


You know what’s so sweet? I am using Winamp to make an http connection to my FreeBSD machine to access music that’s on my XP machine through an SMB share. So my music goes from my XP machine through the SMB share to my FreeBSD machine and from there over the internet through a symlinked directory in my pub folder to arrive at my laptop. So Schweeet! I can access my entire music collection!

Keys to house and Military Ball

I am getting the keys to my house today! Woohoo! Isn’t that great? But moving is going to suck. Luckily I don’t have too much stuff… although it is amazing the amount of stuff I have accumulated over the past five years. It’s pretty crazy. Other than that, nothing much. But this house thing is really exciting. Let’s see… job… car… house… all I need is a wife! Yeah right!

Oh yes, another thing. There is a Military Ball coming up on the 10th of December. If there are any ladies interested in being my date, please email me. Seriously… I need a date to go to this thing.

First set of albums uploaded

After Sadhu’s incessant nagging, which proved to be a great disturbance to the course of my normal life, I have uploaded most of the pictures I took over summer. Ok, it’s not as bad as it sounds! Just kidding Sadhu ;). I did procrastinate a little bit in putting these pictures up, but I was also really busy.

Sadhu, am I anything more to you than just your personal photographer/ASU historian person? Seriously – I need to get something in return from you for this. Don’t ever say I never did anything for you! 😉

The Albums that I have uploaded are “Gouri’s Wedding”, “Trivandrum ’04”, “My 23rd Birthday”, and “Garba 2004”. I still have a lot more pictures to upload. I will try and do it tomorrow or next week. Enjoy!

Oh yeah, the pictures from Gouri’s Wedding are exclusive. Gouri requested me to not make it publically viewable. If you really want to see it, email me and I’ll forward your request to Gouri – she has the last word on it.

Sad Day

I just found out that my friend Arun’s father passed away today. I only found out about it after reading Ed’s log. It was too late to go to the funeral since it was earlier in the day. I pray that God provides him and his family the strength to bear the loss.

I rox0r

I have some music files on my server that are accessible through http (only by me). So instead of keeping them on my laptop, I decided to add the URL’s to Winamp. But that was too painful. So I took the html files and stripped out the tags (using sed) so that I have the URL’s to the actual files (I use relative paths, but Windows adds the full path to the href attribute in the anchor tag). I wrote that out to a file and then used Vim to create an M3U out of just one regex sub :). Check it out:


I just think that is so schweet!

Mailserver woes

As expected, something went wrong. I had a vague sense of intuition that it would be my mailserver… and it was. I reinstalled postfix and everything is working. I was reinstalling courier-imap when it complained about I hate that file SO MUCH. It always shows up. Stupid shared lib. It comes from gettext, and so I tried reinstalling gettext and got the dumbest error message in the world ever:

-r: not found

Now what the hell does that mean? Absolutely NOTHING. Anyway, so I abandoned that because as I discovered, the old version of courier-imap was working perfectly.

Photo Album – 2 years and still going strong!

My photo album has been up for two years now 🙂 Wow… I still remember writing it!

Upgraded to FreeBSD 5.2.1-RELEASE

I upgraded my server OS to FreeBSD 5.2.1-RELEASE. It was painles… ok I won’t lie… it was mostly painless. With me, nothing ever goes according to plan.

Anywaym things look good for now. Hopefully this will get rid of those annoying kernel panics when I transfer large files. I hear that issue was fixed in 5.1. Since I was running 5.0-RELEASE, obviously I had the issue. I hope everything works now.

FreeBSD is really amazing.


I’ve been burning all the DS9 episodes that I got, onto DVD’s. Being the perfectionist that I am, I am bothered by some mistakes I made when making some of the DVD’s. Inconsistencies bother me. For example, for one of the Season 1 DVD’s, I put a Season 2 background. Furthermore, I forgot to put background music for another one. Then there’s the fact that I discovered animated menu buttons too late, so they only start from Season 2. Oh well… everyone makes mistakes I guess… but I hate making them. Anyway, I’m glad they I’m moving them onto DVD’s. Each season was about 9 gigs. The DVD’s have come out really good though.

All original content on these pages is fingerprinted and certified by Digiprove
%d bloggers like this: