The Physiologist's Friend Simulation API

ch.unizh.ini.friend.simulation.cells
Class BipolarCell

java.lang.Object
  extended by ch.unizh.ini.friend.simulation.AbstractAcceptsInput
      extended by ch.unizh.ini.friend.simulation.cells.AbstractCell
          extended by ch.unizh.ini.friend.simulation.cells.BipolarCell
All Implemented Interfaces:
AcceptsInput, GradedCell, ServesOutput, Updateable, Retinotopic, Serializable

public class BipolarCell
extends AbstractCell
implements GradedCell, Retinotopic

Implements a bipolar cell. Each bipolar is either of 'rising' or 'falling' type - the type is determined by the synapses.

Version:
$Revision: 1.22 $
Author:
Christof Marti
See Also:
Serialized Form

Field Summary
protected static float INPUT_WEIGHT
          The default input weight.
 
Fields inherited from class ch.unizh.ini.friend.simulation.cells.AbstractCell
newValue, value
 
Fields inherited from class ch.unizh.ini.friend.simulation.AbstractAcceptsInput
inputs
 
Constructor Summary
BipolarCell()
          Creates a new instance with currently no inputs.
BipolarCell(Collection inputs)
          Creates a new instance with the given collections of inputs and weights.
 
Method Summary
 void compute(float dt)
          Computes the new state of this bipolar cell.
static ArrayList getArrayListInstance(ArrayList inputs, float inputsWeight, ServesOutput input, float inputWeight)
          Returns a list of BipolarCell with the given input weights.
static ArrayList getFallingArrayListInstance(ArrayList inputs, ServesOutput input)
          Returns a list of BipolarCell with input weights for a falling output.
 float getGradedOutput()
          returns the graded output from the cell
 RetinotopicLocation getRetinotopicLocation()
          return the RetinotopicLocaton of the cell
static ArrayList getRisingArrayListInstance(ArrayList inputs, ServesOutput input)
          Returns a list of BipolarCell with input weights for a rising output.
 void setRetinotopicLocation(RetinotopicLocation p)
          set the location
static float tanh(float x)
          Computes the tanh(x).
 
Methods inherited from class ch.unizh.ini.friend.simulation.cells.AbstractCell
output, update
 
Methods inherited from class ch.unizh.ini.friend.simulation.AbstractAcceptsInput
averageInputs, cloneObject, connectOneToAll, connectOneToOne, getCollectionInstance, getInput, getInputs, integrateInputs, setInput, setInputs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INPUT_WEIGHT

protected static final float INPUT_WEIGHT
The default input weight.

See Also:
Constant Field Values
Constructor Detail

BipolarCell

public BipolarCell()
Creates a new instance with currently no inputs.


BipolarCell

public BipolarCell(Collection inputs)
Creates a new instance with the given collections of inputs and weights.

Parameters:
inputs - The collection of inputs.
Method Detail

getArrayListInstance

public static ArrayList getArrayListInstance(ArrayList inputs,
                                             float inputsWeight,
                                             ServesOutput input,
                                             float inputWeight)
Returns a list of BipolarCell with the given input weights. The location is set to be the same as the underlying photoreceptor. The inputs of the bipolar cells will be set according to the given list and single instance of ServesOutput.

Parameters:
inputs - A list of cells, each providing the first input to one bipolar cell.
inputsWeight - These inputs' weight.
input - A cells providing the second input to all bipolar cells.
inputWeight - This input's weight.
Returns:
The list of created cells.

getFallingArrayListInstance

public static ArrayList getFallingArrayListInstance(ArrayList inputs,
                                                    ServesOutput input)
Returns a list of BipolarCell with input weights for a falling output. The inputs of the bipolar cells will be set according to the given list and single instance of ServesOutput.

Parameters:
inputs - A list of cells, each providing the first input to one bipolar cell.
input - A cell providing the second input to all bipolar cells.
Returns:
The list of created cells.

getRisingArrayListInstance

public static ArrayList getRisingArrayListInstance(ArrayList inputs,
                                                   ServesOutput input)
Returns a list of BipolarCell with input weights for a rising output. The inputs of the bipolar cells will be set according to the given list and single instance of ServesOutput.

Parameters:
inputs - A list of cells, each providing the first input to one bipolar cell.
input - A cell providing the second input to all bipolar cells.
Returns:
The list of created cells.

tanh

public static float tanh(float x)
Computes the tanh(x).

Parameters:
x - The argument x.
Returns:
tanh(x)

compute

public void compute(float dt)
Computes the new state of this bipolar cell.

The transfer function of the bipolar is a function that takes the result of AbstractAcceptsInput.integrateInputs() and produces the output. It looks like a signmoid, but is about 0.1 at the origin. It saturates at 1 for large positive input and goes to 0 for large negative input. It looks like this:

Specified by:
compute in interface Updateable
Parameters:
dt - The time that has passed since the last invocation.

getGradedOutput

public float getGradedOutput()
returns the graded output from the cell

Specified by:
getGradedOutput in interface GradedCell

getRetinotopicLocation

public RetinotopicLocation getRetinotopicLocation()
return the RetinotopicLocaton of the cell

Specified by:
getRetinotopicLocation in interface Retinotopic
Returns:
RetinotopicLocation of cell

setRetinotopicLocation

public void setRetinotopicLocation(RetinotopicLocation p)
set the location

Specified by:
setRetinotopicLocation in interface Retinotopic
Parameters:
RetinotopicLocation - to set the cell to. This is generally returned from another cell and is set during construction.

http://www.ini.unizh.ch/~tobi/friend