Class tjhCreature

java.lang.Object
  |
  +--tjhCreature

public class tjhCreature
extends java.lang.Object

A creature in our psuedo-biological simulation consists of a tree structure of tjhCell's. Also, the creature has a separate genome representation that is copied when it reproduces. Otherwise, evolution would follow the Lamarkian model which ain't no good.


Field Summary
protected  tjhGene genome
          the tree of tjhGene's that form the creature's genome
 boolean has_died
          the applet class CellLife uses this to check if this creature died since it last looked
protected  tjh2dVector momentum
          the current momentum (direction and speed) of the creature
protected  boolean pink_bounce
          set to true if a pink bounce just occurred
protected  tjhCell root_cell
          the tree of tjhCell's that form the creature's body
protected static float SPEED
          maximum speed of the creature
 
Constructor Summary
tjhCreature()
          default constructor
 
Method Summary
 boolean DoTimeStep(java.awt.Graphics g, tjhBuckets buckets, tjh2dVector limit)
          main function that is called for the creature each time step in the simulation.
 void Draw(java.awt.Graphics g)
          draw the creature
 void InheritFrom(tjhCreature other, tjhBuckets buckets, tjh2dVector limit)
          this is a new creature, instantiate it from the genes of another (parent) creature
 boolean InitSimple(tjh2dVector limit, tjhBuckets buckets)
          initialize a simple creature from scratch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPEED

protected static final float SPEED
maximum speed of the creature

has_died

public boolean has_died
the applet class CellLife uses this to check if this creature died since it last looked

momentum

protected tjh2dVector momentum
the current momentum (direction and speed) of the creature

root_cell

protected tjhCell root_cell
the tree of tjhCell's that form the creature's body

genome

protected tjhGene genome
the tree of tjhGene's that form the creature's genome

pink_bounce

protected boolean pink_bounce
set to true if a pink bounce just occurred
Constructor Detail

tjhCreature

public tjhCreature()
default constructor
Method Detail

DoTimeStep

public boolean DoTimeStep(java.awt.Graphics g,
                          tjhBuckets buckets,
                          tjh2dVector limit)
main function that is called for the creature each time step in the simulation. The creature moves itself and also waves its arms about either randomly or under their own control, depending on whether the neurons are activated. Returns true if it bounced off another creature's pink bit (casual sex!)

InheritFrom

public void InheritFrom(tjhCreature other,
                        tjhBuckets buckets,
                        tjh2dVector limit)
this is a new creature, instantiate it from the genes of another (parent) creature

InitSimple

public boolean InitSimple(tjh2dVector limit,
                          tjhBuckets buckets)
initialize a simple creature from scratch

Draw

public void Draw(java.awt.Graphics g)
draw the creature