|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--physis.core.DigitalOrganismImpl
Plain implementation of the DigitalOrganism interface. This is used in most cases.
| Field Summary | |
protected int |
age
The age of the organism in updates. |
protected double |
fitness
|
protected boolean |
isAlive
Indicates that the organism is ready to run |
protected boolean |
isfertile
Indicates that the organism could bear at least one child |
static int |
IT_DOESNT_COUNT_ANY_MORE
When a task is performed too many times than it doesn't mean any bonus. |
protected Merit |
merit
The organism's merit |
protected Metabolism |
metabolism
It is actually the virtualmachine's I/O buffer. |
protected DigitalOrganism |
neighbour
One of the organism's neighbours is special because all the close interactions happen between two organism. |
protected PerformedTasksRegister |
performed_tasks
This hashtable keeps track the performed tasks. |
protected java.lang.Object |
position_info
This is information about the position of the organism in the lifespace. |
protected PhysisVirtualMachine |
vm
The "heart" of the organism |
| Constructor Summary | |
DigitalOrganismImpl()
It simply creates the organism - it doesn't mean it's alive. |
|
DigitalOrganismImpl(java.lang.String vm_classname)
|
|
| Method Summary | |
int |
getAge()
Gives the age of the organism. |
int |
getEffectiveLength()
Returns the effective length. |
double |
getFitness()
Returns the fitness value of the organism. |
Genome |
getGenome()
Gives the genetic information of the organism. |
int |
getGenomeSize()
Gives the size of the organism's genome. |
int |
getMerit()
Retruns the merit. |
Metabolism |
getMetabolism()
Gives the Metabolism of the organism. |
DigitalOrganism |
getNeighbour()
Returns the organism's neighbour. |
PerformedTasksRegister |
getPerformedTasks()
Gives the container of the performed tasks. |
java.lang.Object |
getPositinInfo()
Gives the position information. |
PhysisVirtualMachine |
getVM()
Returns the organism's internal virtual machine. |
void |
increaseAge()
Increments the age by 1. |
boolean |
isAlive()
Tells whether the organism is alive or not. |
boolean |
isFertile()
Tells whether the organism is fertile (capable to yield a child). |
void |
kill()
Kills the organism. |
void |
recalculateBonus(double bonus_multiplier)
Recalculates the organism's bonus by multiplying it with the bonus multiplier. |
void |
recalculateEffectiveLength()
Recalculates the effective length. |
void |
recalculateFitness()
Recalculates the fitness. |
void |
setFertile(boolean fertility)
Sets the fertility flag. |
void |
setNeighbour(DigitalOrganism digorg)
Sets the organism neighbour. |
void |
setPositionInfo(java.lang.Object o)
Sets the position information. |
java.lang.String |
toString()
|
void |
update()
Updates the organism's state by executing one cpu-cycle. |
void |
update(int cpu_cycles)
Updates the organism's state by executing given amount of cpu_cycles. |
void |
vivify(DigitalOrganism neighbour_,
GeneticCodeTape codetape,
int inherited_length)
Makes the organism to be alive. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected int age
protected boolean isfertile
protected boolean isAlive
protected Merit merit
protected PhysisVirtualMachine vm
protected Metabolism metabolism
protected DigitalOrganism neighbour
protected double fitness
protected java.lang.Object position_info
protected PerformedTasksRegister performed_tasks
public static int IT_DOESNT_COUNT_ANY_MORE
| Constructor Detail |
public DigitalOrganismImpl()
public DigitalOrganismImpl(java.lang.String vm_classname)
| Method Detail |
public void vivify(DigitalOrganism neighbour_,
GeneticCodeTape codetape,
int inherited_length)
vivify in interface DigitalOrganismneighbour_ - The organism to which this is facing.codetape - The new seed.inherited_length - The newly born organism inherits the parent's effective length.public void kill()
kill in interface DigitalOrganismpublic void increaseAge()
DigitalOrganismincreaseAge in interface DigitalOrganismpublic int getAge()
DigitalOrganismgetAge in interface DigitalOrganismpublic boolean isAlive()
DigitalOrganismisAlive in interface DigitalOrganismpublic boolean isFertile()
DigitalOrganismisFertile in interface DigitalOrganismpublic void setFertile(boolean fertility)
DigitalOrganismsetFertile in interface DigitalOrganismpublic PhysisVirtualMachine getVM()
DigitalOrganismgetVM in interface DigitalOrganismpublic Genome getGenome()
DigitalOrganismgetGenome in interface DigitalOrganismpublic int getGenomeSize()
DigitalOrganismgetGenomeSize in interface DigitalOrganismpublic Metabolism getMetabolism()
DigitalOrganismgetMetabolism in interface DigitalOrganismpublic PerformedTasksRegister getPerformedTasks()
DigitalOrganismgetPerformedTasks in interface DigitalOrganismpublic void update()
DigitalOrganismupdate in interface DigitalOrganismpublic void update(int cpu_cycles)
DigitalOrganismupdate in interface DigitalOrganismpublic double getFitness()
DigitalOrganismgetFitness in interface DigitalOrganismpublic void recalculateFitness()
DigitalOrganismrecalculateFitness in interface DigitalOrganismpublic void recalculateBonus(double bonus_multiplier)
DigitalOrganismrecalculateBonus in interface DigitalOrganismpublic int getEffectiveLength()
DigitalOrganismgetEffectiveLength in interface DigitalOrganismpublic void recalculateEffectiveLength()
DigitalOrganismrecalculateEffectiveLength in interface DigitalOrganismpublic int getMerit()
DigitalOrganismgetMerit in interface DigitalOrganismpublic void setNeighbour(DigitalOrganism digorg)
DigitalOrganismsetNeighbour in interface DigitalOrganismpublic DigitalOrganism getNeighbour()
DigitalOrganismgetNeighbour in interface DigitalOrganismpublic void setPositionInfo(java.lang.Object o)
DigitalOrganismsetPositionInfo in interface DigitalOrganismpublic java.lang.Object getPositinInfo()
DigitalOrganismgetPositinInfo in interface DigitalOrganismpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||