physis.core
Class Metabolism

java.lang.Object
  |
  +--physis.core.Metabolism

public class Metabolism
extends java.lang.Object

It tracks the organism's interaction with the environment.
CRC
1. tracking the inputs and outputs
Hint: it's actually an I/O buffer. The implementation should handle two queues. Their sizes are defined by the biggest tasks and can be acquired from the Configuration class.


Field Summary
private  int[] inputbuffer
           
private  int iptr
          The bufferpointers point to the last element.
private  int optr
           
private  int[] outputbuffer
           
 
Constructor Summary
Metabolism(int buffer_size)
           
 
Method Summary
 void clear()
          Clears the buffers.
 int getBufferSize()
          Returns the size of the buffers.
 int[] getInputs()
          Gets the inputvalues in chronological order.
 int getInputSize()
          Returns the number of inputs.
 int[] getOutputs()
          Gets the outputvalues in chronological order.
 int getOutputSize()
          Returns the number of outputs.
 boolean isInputFull()
           
 boolean isOutputFull()
           
 void putInputValue(int val)
          Put a value into the input queue.
 void putOutputValue(int val)
          Put a value into the output queue.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

inputbuffer

private int[] inputbuffer

outputbuffer

private int[] outputbuffer

iptr

private int iptr
The bufferpointers point to the last element.

optr

private int optr
Constructor Detail

Metabolism

public Metabolism(int buffer_size)
Method Detail

getInputs

public int[] getInputs()
Gets the inputvalues in chronological order.

getOutputs

public int[] getOutputs()
Gets the outputvalues in chronological order.

putInputValue

public void putInputValue(int val)
Put a value into the input queue.

putOutputValue

public void putOutputValue(int val)
Put a value into the output queue.

getInputSize

public int getInputSize()
Returns the number of inputs.

getOutputSize

public int getOutputSize()
Returns the number of outputs.

getBufferSize

public int getBufferSize()
Returns the size of the buffers.

clear

public void clear()
Clears the buffers.

isInputFull

public boolean isInputFull()

isOutputFull

public boolean isOutputFull()