|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
The abstraction of the genetic code. It remains a circular tape with assembly like instructions and operands on it but it has some biological features needed for cell-division like processes, activity registration and other access functions. !!It should be a common interface for both soup and cell-like codetapes!!
| Field Summary | |
static byte |
COPIED
Instruction-attribute: the instruction is a copied one. |
static byte |
EXECUTED
Instruction-attribute: the instruction is executed at least once. |
static byte |
EXECUTED_OR_COPIED
Instruction-attribute: the instruction is executed or copied. |
static byte |
MUTATED
Instruction-attribute: the instruction was mutated. |
| Method Summary | |
void |
allocate(int numberof_newcells)
It's a biological operator. |
boolean |
blockCopy(int source,
int destination,
int length)
Copies an instruction from source position to destination position. |
int |
calculateEffectiveLength()
The effective length can be calculated by the number of executed instructions. |
void |
clearExecutedFlag(int position)
|
boolean |
contains(short instcode)
Returns true if the codetape contains the specified instruction. |
boolean |
copy(int source,
int destination)
Copies an instruction from source position to destination position. |
void |
delete()
Removes an instruction from a random position. |
GeneticCodeTape |
divide()
It divides the codetape. |
short |
fetchInst(int position)
Simply returns the instruction or operand on the specified position. |
Genome |
getChildGenome()
Returns the genetic information from the child-codetape. |
Genome |
getGenome()
Returns the genetic information from the codetape. |
int |
getSize()
Returns the absolute size of the codetape.(number of contained instructions) |
void |
insert()
Inserts an instruction on a random position. |
boolean |
isAllocated()
Returns true if the cell already allocated space for the spawn. |
boolean |
isAllocationPossible(int numberof_newcells)
The size must be in a predefined range, otherwise the allocation fails. |
boolean |
isCopied(int position)
Answers the question: is the positionth instruction copied? |
boolean |
isExecuted(int position)
Answers the question: is the positionth instruction executed? |
boolean |
isMutated(int position)
Answers the question: is the positionth instruction mutated? |
boolean |
isProliferationPossible()
Checks whether the organism is able to spawn (are there enough copied instructions?). |
void |
mutate(int position)
Mutate the specified instruction. |
| Methods inherited from interface physis.core.virtualmachine.CodeTape |
read, write |
| Field Detail |
public static final byte EXECUTED
public static final byte COPIED
public static final byte MUTATED
public static final byte EXECUTED_OR_COPIED
| Method Detail |
public short fetchInst(int position)
read and write. The virtualmachine has to take care of the proper position.
It provides only quick access for the executable part of the code.public boolean isAllocationPossible(int numberof_newcells)
public void allocate(int numberof_newcells)
public boolean isAllocated()
public boolean isProliferationPossible()
public GeneticCodeTape divide()
Environment is responsible for palcing the child,
the codetape only returns an other one.public boolean contains(short instcode)
instcode - The searched instruction.public boolean isMutated(int position)
public boolean isCopied(int position)
public boolean isExecuted(int position)
public void clearExecutedFlag(int position)
public void mutate(int position)
public void insert()
public void delete()
public boolean copy(int source,
int destination)
public boolean blockCopy(int source,
int destination,
int length)
public int calculateEffectiveLength()
public int getSize()
getSize in interface CodeTapepublic Genome getGenome()
public Genome getChildGenome()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||