 
 
 
 
 
   
This project is a variant of a project given in Spring 1999. The project was significantly changed, and given in its current form in Fall 2003. That class felt that there was enough interest remaining in the problem to give it again. Thus, you will work on this problem with the code and reports from last year available to you. You can choose to build on last year's work, or you can do something of your own completely from scratch.
Consider an electronic world consisting of an  by
 by  grid.
Virtual ``organisms'' can exist on this grid, with an organism
able to occupy a cell on the grid.  Organisms have energy
that can be gained or lost in a variety of ways.  When an organism
runs out of energy it dies, and vacates the cell it formerly
occupied.  An organism can have at most
 grid.
Virtual ``organisms'' can exist on this grid, with an organism
able to occupy a cell on the grid.  Organisms have energy
that can be gained or lost in a variety of ways.  When an organism
runs out of energy it dies, and vacates the cell it formerly
occupied.  An organism can have at most  units of energy.
An organism may do one of several things during a virtual
time cycle:
 units of energy.
An organism may do one of several things during a virtual
time cycle:
There will be food scattered over the grid.  One unit of food
corresponds to  units of energy.  Food reproduces according to the
following rules:
 units of energy.  Food reproduces according to the
following rules:
 of having a single
unit of food ``blow in''.
 of having a single
unit of food ``blow in''.
 of doubling.  This doubling is independent of other food units
on the cell.  So, a cell with three units of food may have anywhere
between three and six units of food on the next cycle.  Nevertheless,
no cell may have more than
 of doubling.  This doubling is independent of other food units
on the cell.  So, a cell with three units of food may have anywhere
between three and six units of food on the next cycle.  Nevertheless,
no cell may have more than  units of food at any one time, due to
space constraints.
 units of food at any one time, due to
space constraints.
 ,
will consume a unit of food and add
,
will consume a unit of food and add  units of energy to its
store.  If an organism is hungry, it can eat one unit of food
per cycle until either the food runs out, or it achieves energy
greater than
 units of energy to its
store.  If an organism is hungry, it can eat one unit of food
per cycle until either the food runs out, or it achieves energy
greater than  .
.
An organism has an external state that is an integer between 0 and 255. This state may be changed by the organism during the course of the simulation. The external state is visible to other organisms, as described below.
An organism can ``see'' in the four orthogonal directions. An organism gets information about:
 ,
,  ,
,  ,
,  and
 and  (see below), but not
(see below), but not  ,
,  ,
,  or
 or  .
. 
An organism's ``brain'' is a program that you will write (in Java). Since there will be many organisms on the grid simultaneously, each will run a separate instance of the brain code. Each instance will have access only to the local environment of the organism. Organisms are placed randomly on the grid, and don't know their coordinates. The brain can keep a history of local events for the organism if you think that's useful.
Organisms cannot identify their neighbors. Neighbors may be of the same species (i.e., have the same programmed brain), or of a different species (i.e., have a different brain). This will be important for simulations in which multiple organisms from different groups are placed on the same grid. (How might you use the external state to help in identification? What about impostors?)
Organisms act one-at-a-time from top-left to bottom-right, row by row.
We number the top-left cell as (1,1) and the bottom-right cell as
 .
That means that the state of the virtual world seen by an organism at
.
That means that the state of the virtual world seen by an organism at
 reflects the situation in which all organisms in positions
 reflects the situation in which all organisms in positions
 lexicographically less than
 lexicographically less than  have already made their
moves, while organisms in positions lexicographically after
 have already made their
moves, while organisms in positions lexicographically after  have not yet moved.  This convention allows all operations to happen
without any need for resolving conflicts between organisms (for example
trying to
move to the same cell).  However, it leads to some slightly unintuitive
effects:
have not yet moved.  This convention allows all operations to happen
without any need for resolving conflicts between organisms (for example
trying to
move to the same cell).  However, it leads to some slightly unintuitive
effects:
We'll provide an organism ``simulator'' that reads in one or more organism brains, places one organism for each such brain randomly on the grid, and lets the organisms behave according to their brains' instructions.
There are several goals for this project:
 is sufficiently small, extinction
may ensue.  The goal is to achieve the highest long-term stable
population.
 is sufficiently small, extinction
may ensue.  The goal is to achieve the highest long-term stable
population.
The simulator will be provided later.
There are several parameters mentioned in the project description. Values for the parameters will be selected in class in order to make the project most interesting. We'll run simulations for various combinations of parameters. Below is a summary of the parameters, their meaning, and likely values. The first four parameters are not known to the organism, while the remaining parameters are known.
| Parameter | Meaning | Likely Values | 
|  | horizontal size | 5 to simulator screen width | 
|  | vertical size | 5 to simulator screen height | 
|  | probability of spontaneous appearance of food | 0.001-0.1 | 
|  | probability of food doubling | 0.002-0.2 | 
|  | energy consumed in staying put | 1 (other parameters scale) | 
|  | energy consumed in moving or reproducing | 2-20 | 
|  | energy per unit of food | 10-500 | 
|  | maximum energy per organism | 100-1000 | 
|  | maximum food units per cell | 10-50 | 
 
 
 
 
