|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectOrganism
public class Organism
The Organism
class represents the organisms in the simulation.
Each organism is characterised by a number of features, the genotype or cellular automaton
rule the organism implements being the most important.
Field Summary | |
---|---|
int |
age
The age of the organism counted in updates |
static int |
currentGID
The current highest genotype ID |
static int |
currentOID
The current highest organism ID |
double |
dE
The most recent entropy change achieved by the organism |
int |
G
The CA rule implemented by the organism, i.e. its pheno/genotype |
int |
GID
The organism genotype identity number. |
boolean |
isNew
Shows if the organism is a newborn |
boolean |
mutated
Shows if the organism was a mutant at birth |
int |
OID
The organism identity number (unique to each instance of the class) |
static double |
pc
The copy mutation probability |
BString |
S
The bit string attached to the organism |
BString |
S0
A backup copy of the bit string attached to the organism |
Constructor Summary | |
---|---|
Organism(int G,
int OID,
int GID)
Creates an Organism with given properties |
Method Summary | |
---|---|
void |
clearTag()
Clear the isNew tag |
Organism |
divide()
Creates a daughter organism under mutations. |
int |
getAge()
Get the age of the organism |
static int |
getCurrentGID()
Returns a GID |
static int |
getCurrentOID()
Returns an OID |
int |
getGenome()
Get the organism genotype |
int |
getGID()
Returns the organism genotype ID number |
double |
getLatestIO()
Get the most recent entropy difference |
static int |
getNextGID()
Returns a GID and increments the counter |
static int |
getNextOID()
Returns an OID and increments the counter |
int |
getOID()
Returns the OID |
BString |
getOrigString()
Get the backup string attached to the organism |
BString |
getString()
Get the string attached to the organism |
void |
IO(World W,
BString Sx)
Swaps the current string and creates a backup |
boolean |
isMutated()
Check if the organism is mutated |
void |
mutated(boolean b)
Mark the organism as mutated |
void |
setGenome(int G)
Sets the organism genotype |
void |
setGID(int ID)
Sets the organism genotype ID number |
static void |
setMutRate(double p)
Sets the mutation rate |
void |
setOID(int ID)
Sets the organism ID number |
void |
setString(BString Snew)
Attaches a new bit string to the organism and creates a backup |
BString |
test(BString St)
Manipulates a test string and returns it |
int |
update(int L)
Updates the organism |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int OID
public int GID
public int age
public int G
public double dE
public BString S
public BString S0
public boolean mutated
public boolean isNew
public static int currentOID
public static int currentGID
public static double pc
Constructor Detail |
---|
public Organism(int G, int OID, int GID)
G
- the CA-rule/genotype of the organismOID
- the organism IDGID
- the genotype IDMethod Detail |
---|
public static int getNextOID()
public static int getNextGID()
public static int getCurrentOID()
public static int getCurrentGID()
public static void setMutRate(double p)
p
- the copy mutation ratepublic void setString(BString Snew)
Snew
- the string to be attachedpublic int getOID()
public void setOID(int ID)
ID
- the organism ID numberpublic int getGID()
public void setGID(int ID)
ID
- the organism genotype ID numberpublic boolean isMutated()
public void mutated(boolean b)
b
- true if mutatedpublic void clearTag()
public int getGenome()
public void setGenome(int G)
G
- the organism genotypepublic BString getString()
public BString getOrigString()
public double getLatestIO()
public int getAge()
public int update(int L)
L
- the level of entropy calculation
public BString test(BString St)
St
- the test string
public void IO(World W, BString Sx)
W
- the World from which the new string is pickedSx
- the string which is returnedpublic Organism divide()
pc
the daughter
is identical with the parent (except for OID
) and with complementary
probability 1-pc
it is assigned a random genotype
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |