|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--physis.core.RemoteDigitalOrganism
This class represents a remote digital organism. It accesses a remote DigitalOrganism object through a socket via the Digital Organism Transfer Protocol (DOTP). If the socket breaks down it uses a local reference. Each methods defiened in the DigitalOrganism interface simply delegates the operations to a remote proxy. Actually it communicates with a DigitalOrganismProxy.
| Field Summary | |
protected java.io.BufferedReader |
in
|
protected int |
index
The index of the remote digital organism. |
protected DigitalOrganism |
localRef
If the connection breaks down this local reference shoud be used. |
protected java.io.PrintWriter |
out
|
protected java.net.Socket |
socket
The socket used for the DOTP commmunication with a remote Digital Org proxy. |
| Constructor Summary | |
RemoteDigitalOrganism(int index_,
java.net.Socket socket_,
java.io.BufferedReader in_,
java.io.PrintWriter out_,
DigitalOrganism local_ref)
|
|
| 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. |
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 java.net.Socket socket
protected java.io.BufferedReader in
protected java.io.PrintWriter out
protected int index
protected DigitalOrganism localRef
| Constructor Detail |
public RemoteDigitalOrganism(int index_,
java.net.Socket socket_,
java.io.BufferedReader in_,
java.io.PrintWriter out_,
DigitalOrganism local_ref)
| Method Detail |
public void vivify(DigitalOrganism neighbour_,
GeneticCodeTape codetape,
int inherited_length)
DigitalOrganismvivify in interface DigitalOrganismphysis.core.DigitalOrganismneighbour_ - The organism to which this is facing.codetape - The new seed.inherited_length - The newly born organism inherits the parent's effective length. (This is a trick:
the newly born organism should have some reasonable value in order to survive. In the next update after it's born
the effective length is recalculated.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 void recalculateFitness()
DigitalOrganismrecalculateFitness in interface DigitalOrganismpublic double getFitness()
DigitalOrganismgetFitness 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 DigitalOrganism
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||