physis.core.virtualmachine
Interface CodeTape
- All Known Subinterfaces:
- GeneticCodeTape
- public interface CodeTape
Simply represents a codetape which has a size (number of contained instructions, length)
and one instruction(code) can be retrieved via giving its position.
It can be viewed as an array of short-s.
|
Method Summary |
int |
getSize()
Returns the number of instructions on the tape. |
short |
read(int position)
Returns the instruction on a given position of the tape. |
void |
write(int position,
short value)
Sets the content of the tape on the specified position. |
read
public short read(int position)
- Returns the instruction on a given position of the tape. ALWAYS RETURNS SOME VALUE!
It should handle the exceptions (index out of bounds...)
write
public void write(int position,
short value)
- Sets the content of the tape on the specified position. ALWAYS DOES SOMETHING!
There shouldn't be any unhandled error situation!
getSize
public int getSize()
- Returns the number of instructions on the tape. This equals to the length.