Class tjhGene

java.lang.Object
  |
  +--tjhGene

public class tjhGene
extends java.lang.Object

A tree structure of genes, each with a simple type (RED/GREEN) and a neuron. When a creature is born, a tree of tjhCell's is created that mirrors this tree representation of genes.


Field Summary
protected static int GREEN
          fixed enum type value for a green cell (root cell is drawn in pink but always behaves like a green)
protected  boolean has_parent
          does this gene have a parent?
protected static int MAX_SUBNODES
          the maximum number of allowed daughter cells per cell
 tjhNeuron neuron
          the neuron associated with the cell
protected static float P_MENTAL_MUTATION
          the probability of a mental mutation
protected static float P_PHYSICAL_MUTATION
          the probability of a physical mutation
protected  tjhGene parent
          a reference to the gene's parent if it has one
protected static int RED
          fixed enum type value for a red cell
 java.util.Vector subnodes
          list of the subnodes of this gene
 int type
          the type of the cell (RED/GREEN)
 
Constructor Summary
tjhGene()
          default constructor
 
Method Summary
 void Copy(tjhGene other)
          gene replication routine
 void InitSimple()
          simple initialization from scratch, creates a creature with a red arm and a green arm
protected  boolean MentalMutationCalledFor()
          decides whether a mental mutation should happen this time
protected  int NumBelow(int type_requested)
          counts the total number of cells below this point of the type specified (recurses)
protected  boolean PhysicalMutationCalledFor()
          decides whether a physical mutation should happen this time
protected  int TotalNum(int type_requested)
          counts the total number of the specified type of cell in the creature (calls NumBelow)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GREEN

protected static final int GREEN
fixed enum type value for a green cell (root cell is drawn in pink but always behaves like a green)

RED

protected static final int RED
fixed enum type value for a red cell

P_PHYSICAL_MUTATION

protected static final float P_PHYSICAL_MUTATION
the probability of a physical mutation

P_MENTAL_MUTATION

protected static final float P_MENTAL_MUTATION
the probability of a mental mutation

MAX_SUBNODES

protected static final int MAX_SUBNODES
the maximum number of allowed daughter cells per cell

type

public int type
the type of the cell (RED/GREEN)

neuron

public tjhNeuron neuron
the neuron associated with the cell

has_parent

protected boolean has_parent
does this gene have a parent?

parent

protected tjhGene parent
a reference to the gene's parent if it has one

subnodes

public java.util.Vector subnodes
list of the subnodes of this gene
Constructor Detail

tjhGene

public tjhGene()
default constructor
Method Detail

InitSimple

public void InitSimple()
simple initialization from scratch, creates a creature with a red arm and a green arm

Copy

public void Copy(tjhGene other)
gene replication routine

PhysicalMutationCalledFor

protected boolean PhysicalMutationCalledFor()
decides whether a physical mutation should happen this time

MentalMutationCalledFor

protected boolean MentalMutationCalledFor()
decides whether a mental mutation should happen this time

TotalNum

protected int TotalNum(int type_requested)
counts the total number of the specified type of cell in the creature (calls NumBelow)

NumBelow

protected int NumBelow(int type_requested)
counts the total number of cells below this point of the type specified (recurses)