Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
A
B
C
D
F
G
H
I
K
L
M
N
P
R
S
T
U
X
Y
A
Angle()
- Method in class
tjh2dVector
returns the angle of the vector anticlockwise from the +ve x-axis
angular_momentum
- Variable in class
tjhCell
the current angular momentum of the cell (in degrees)
ANGULAR_MOMENTUM
- Static variable in class
tjhCell
the maximum angular momentum of each cell in degrees
B
BCoord(float)
- Method in class
tjhBuckets
returns the floor of the coord divided by the width of each bucket - the index on one axis of the bucket containing it
bucket_scale
- Variable in class
tjhBuckets
the width of each bucket
buckets
- Variable in class
CellLife
space-partitioning structure to speed collision detection
buckets
- Variable in class
tjhBuckets
the 2D array of tjhBucket's
C
CanMoveBy(tjh2dVector, tjh2dVector, tjhBuckets, tjhCell, Vector)
- Method in class
tjhCell
detect any collisions with other cells that the requested move would cause
CanMoveTo(tjh2dVector, tjh2dVector, tjhBuckets, tjhCell, Vector)
- Method in class
tjhCell
collision detection/resolution check for a *single* cell, doesn't recurse
CanRotate(tjh2dVector, float, tjh2dVector, tjhBuckets, tjhCell, Vector)
- Method in class
tjhCell
will the requested rotation cause a collision?
Cartesian(float)
- Static method in class
tjh2dVector
return the unit vector with the correct angle anti-clockwise from the +ve x-axis
cell
- Variable in class
tjhBucket
if so, this stores a reference to it
CellLife
- class
CellLife
.
Our main applet class.
CellLife()
- Constructor for class
CellLife
CellLife Class Constructor
CloserThan(tjh2dVector, tjhCell, float)
- Method in class
tjhCell
is the point loc closer to the cell them than the distance d?
CollidesWithAny(tjh2dVector, float)
- Method in class
tjhBuckets
would a tjhCell at the specified location be overlapping any existing one?
Copy(tjhGene)
- Method in class
tjhGene
gene replication routine
Copy(tjhNeuron)
- Method in class
tjhNeuron
copies the specified neuron into this one
creatures
- Variable in class
CellLife
A list of the creatures currently alive.
D
destroy()
- Method in class
CellLife
DoTimeStep(Graphics, tjhBuckets, tjh2dVector)
- Method in class
tjhCreature
main function that is called for the creature each time step in the simulation.
DotProduct(tjh2dVector, tjh2dVector)
- Static method in class
tjh2dVector
returns the dot product of the two vectors
Draw(Graphics)
- Method in class
tjhCell
draws the cell (recurses to draw its daughter cells too)
Draw(Graphics)
- Method in class
tjhCreature
draw the creature
F
FindBucket(tjh2dVector)
- Method in class
tjhBuckets
locate the bucket that contains the specified coordinate (x or y)
G
generations
- Variable in class
CellLife
The number of creatures that have been born since the simulation started
genome
- Variable in class
tjhCreature
the tree of tjhGene's that form the creature's genome
GetAllWithin(tjh2dVector, float)
- Method in class
tjhBuckets
get a list of the collisions that would be caused (empty if none)
getAppletInfo()
- Method in class
CellLife
The getAppletInfo() method returns a string describing the applet's author, copyright date, or miscellaneous information.
GetOutput(int[])
- Method in class
tjhNeuron
Returns an output given an input matrix
GREEN
- Static variable in class
tjhGene
fixed enum type value for a green cell (root cell is drawn in pink but always behaves like a green)
H
has_cell
- Variable in class
tjhBucket
does this bucket currently contain a cell?
has_died
- Variable in class
tjhCreature
the applet class CellLife uses this to check if this creature died since it last looked
has_parent
- Variable in class
tjhCell
stores whether this cell has a parent, or is the root cell for this creature
has_parent
- Variable in class
tjhGene
does this gene have a parent?
host_creature
- Variable in class
tjhCell
a reference to the owning host creature
I
InArea(tjh2dVector, tjh2dVector)
- Method in class
tjhCell
is the point loc within the area of the simulation?
InheritFrom(tjhCreature, tjhBuckets, tjh2dVector)
- Method in class
tjhCreature
this is a new creature, instantiate it from the genes of another (parent) creature
init()
- Method in class
CellLife
first-time initialization
InitSimple()
- Method in class
tjhGene
simple initialization from scratch, creates a creature with a red arm and a green arm
InitSimple(tjh2dVector, tjhBuckets)
- Method in class
tjhCreature
initialize a simple creature from scratch
Instantiate(tjhGene, tjhCreature, tjhBuckets, tjh2dVector)
- Method in class
tjhCell
top-level call to instantiate a tree of cells from the given genome.
InstantiateChildren(tjhGene, tjhCreature, tjhBuckets, tjh2dVector)
- Method in class
tjhCell
recurses down to instantiate all mid-level and leaf-level nodes in the tree of cells that is being created
IsOurChild(tjhCell)
- Method in class
tjhCell
is the specified cell below us in the tree?
K
Killed(tjhBuckets)
- Method in class
tjhCell
this cell has been killed, ask it to tidy itself away
L
Length()
- Method in class
tjh2dVector
returns the length of the vector
limit
- Variable in class
CellLife
The world is a rectangle from (0,0) to (limit.x,limit,y)
location
- Variable in class
tjhCell
the current location of the cell
M
matrix
- Variable in class
tjhNeuron
The matrix controls how the inputs are transformed into the output.
MAX_CREATURES
- Static variable in class
CellLife
the maximum number of creatures in the world.
MAX_SUBNODES
- Static variable in class
tjhGene
the maximum number of allowed daughter cells per cell
MentalMutationCalledFor()
- Method in class
tjhGene
decides whether a mental mutation should happen this time
minus(tjh2dVector, tjh2dVector)
- Static method in class
tjh2dVector
subtracts b from a, returns the result
momentum
- Variable in class
tjhCreature
the current momentum (direction and speed) of the creature
mouseDown(Event, int, int)
- Method in class
CellLife
mouseDrag(Event, int, int)
- Method in class
CellLife
mouseUp(Event, int, int)
- Method in class
CellLife
MoveArms(Graphics, tjhBuckets, tjh2dVector)
- Method in class
tjhCell
each cell moves about its parent axis (as long as no collision is caused)
MoveBy(tjh2dVector, tjhBuckets)
- Method in class
tjhCell
all checks have been made, just move the cells
MoveIfCan(tjh2dVector, tjh2dVector, tjhBuckets)
- Method in class
tjhCell
a move request, the cell will move as requested only if able to
mult(tjh2dVector, float)
- Static method in class
tjh2dVector
multiplies the vector a by the scalar f, returns the result
N
N_INPUTS
- Static variable in class
tjhNeuron
The neuron has a fixed number of inputs
n_xBuckets
- Variable in class
tjhBuckets
the number of buckets in each direction
n_yBuckets
- Variable in class
tjhBuckets
the number of buckets in each direction
NearestVisible(Vector)
- Method in class
tjhCell
returns the index (in the list within_sight) of the nearest enemy cell
neuron
- Variable in class
tjhCell
the cell's brains (they're a bit thick at the moment)
neuron
- Variable in class
tjhGene
the neuron associated with the cell
Normalize()
- Method in class
tjh2dVector
changes the length of the vector to one
NumBelow(int)
- Method in class
tjhGene
counts the total number of cells below this point of the type specified (recurses)
P
P_MENTAL_MUTATION
- Static variable in class
tjhGene
the probability of a mental mutation
P_PHYSICAL_MUTATION
- Static variable in class
tjhGene
the probability of a physical mutation
paint(Graphics)
- Method in class
CellLife
CellLife Paint Handler
parent
- Variable in class
tjhCell
a reference to the parent of the cell (if any)
parent
- Variable in class
tjhGene
a reference to the gene's parent if it has one
Perp()
- Method in class
tjh2dVector
replaces this vector with its left-hand perpendicular
PhysicalMutationCalledFor()
- Method in class
tjhGene
decides whether a physical mutation should happen this time
pink_bounce
- Variable in class
tjhCreature
set to true if a pink bounce just occurred
PutCell(tjhCell)
- Method in class
tjhBuckets
add the bucket reference for this cell (newly created or just moved)
R
RADIUS
- Static variable in class
tjhCell
the radius of the cells, fixed for now at least
RandomAngle()
- Method in class
tjhCell
return a random angle between 0 and 360 degrees
RandomAngularMomentum()
- Method in class
tjhCell
pick an angular momentum at random
RandomEntry()
- Static method in class
tjhNeuron
returns -1, 0 or 1 with equal probability
RED
- Static variable in class
tjhGene
fixed enum type value for a red cell
RemoveAllFromGlobalList(tjhBuckets)
- Method in class
tjhCell
recurses down to ask all children to remove themselves from the global buckets structure
RemoveCell(tjhCell)
- Method in class
tjhBuckets
remove the bucket reference for this cell (died or about to move)
root_cell
- Variable in class
tjhCreature
the tree of tjhCell's that form the creature's body
Rotate(tjh2dVector, float, tjhBuckets)
- Method in class
tjhCell
all checks have been made, just rotate the cell
RotateAround(tjh2dVector, float)
- Method in class
tjh2dVector
rotates this point by deg degrees around the point c
RotateIfCan(tjh2dVector, float, tjh2dVector, tjhBuckets)
- Method in class
tjhCell
a rotation request, the cell will rotate only if no collision is caused
run()
- Method in class
CellLife
S
seen_green
- Variable in class
tjhCell
stores whether the cell has seen a green enemy cell nearby
seen_red
- Variable in class
tjhCell
stores whether the cell has seen a red enemy cell nearby
SIGHT_DIST
- Static variable in class
tjhCell
the distance within which cells can sense each other
SPEED
- Static variable in class
tjhCreature
maximum speed of the creature
start()
- Method in class
CellLife
StimulusResponse(Graphics, tjhBuckets)
- Method in class
tjhCell
if the neurons are active, reset the angular momentum in response to the nearby cells, otherwise does nothing
stop()
- Method in class
CellLife
subnodes
- Variable in class
tjhCell
a list of the cells that are children of this cell
subnodes
- Variable in class
tjhGene
list of the subnodes of this gene
sum(tjh2dVector, tjh2dVector)
- Static method in class
tjh2dVector
adds the two vectors together, returns the result
T
tjh2dVector
- class
tjh2dVector
.
A simple class that manages a 2D location/vector in space given floats x and y.
tjh2dVector()
- Constructor for class
tjh2dVector
default constructor
tjh2dVector(float, float)
- Constructor for class
tjh2dVector
initializing constructor
tjhBucket
- class
tjhBucket
.
simple structure for each bucket in our space-partioning data type
tjhBucket()
- Constructor for class
tjhBucket
tjhBuckets
- class
tjhBuckets
.
a simple regular space-partitioning class to speed up collision detection
tjhBuckets(float, int, int)
- Constructor for class
tjhBuckets
default constructor initializes bucket array
tjhCell
- class
tjhCell
.
Encapsulates a cell in our pseudo-biological simulation.
tjhCell()
- Constructor for class
tjhCell
default constructor
tjhCreature
- class
tjhCreature
.
A creature in our psuedo-biological simulation consists of a tree structure of tjhCell's.
tjhCreature()
- Constructor for class
tjhCreature
default constructor
tjhGene
- class
tjhGene
.
A tree structure of genes, each with a simple type (RED/GREEN) and a neuron.
tjhGene()
- Constructor for class
tjhGene
default constructor
tjhNeuron
- class
tjhNeuron
.
Implements an artificial neuron for a cell.
tjhNeuron()
- Constructor for class
tjhNeuron
default constructor
TotalNum(int)
- Method in class
tjhGene
counts the total number of the specified type of cell in the creature (calls NumBelow)
type
- Variable in class
tjhCell
stores the type of the cell, determines its interactions and how it is drawn
type
- Variable in class
tjhGene
the type of the cell (RED/GREEN)
U
USE_BRAINS
- Static variable in class
tjhCell
do we want the cells to use their brains?
X
x
- Variable in class
tjh2dVector
the coordinates of the location/vector
Y
y
- Variable in class
tjh2dVector
the coordinates of the location/vector
A
B
C
D
F
G
H
I
K
L
M
N
P
R
S
T
U
X
Y
Class
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES