The Physiologist's Friend Simulation API

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

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.Photoreceptor
All Implemented Interfaces:
AcceptsInput, GradedCell, ServesOutput, Updateable, Retinotopic, Serializable
Direct Known Subclasses:
ColorPhotoreceptor

public class Photoreceptor
extends AbstractCell
implements GradedCell, Retinotopic

This class implements the notion of a photoreceptor.

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

Field Summary
static float ADAPTATION_TIME_CONSTANT
          adaptation time constant of photoreceptor in seconds: 0.5f
protected  float gain
          The gain of the high-pass output.
protected  Filter highPass
          A high-pass filter that is used to compute the transient gain.
protected  ConvexPolygon shape
          The shape of this photoreceptor.
protected  Stimulus stimulus
          The stimulus for this photoreceptor (and likely the whole simulation).
static float TRANSIENT_GAIN
          the transient gain of the photoreceptor, as a multiple of the DC gain: 5.0f
 
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
Photoreceptor(ConvexPolygon shape, Stimulus stimulus)
          Creates a new photoreceptor with a given shape and attached to a given stimulus and a certain gain in higher frequencies.
 
Method Summary
 void compute(float dt)
          Computes the new state of this photoreceptor.
 float excitation()
          Calculate the exitation of the given object (photoreceptor) from the stimulus.
 float getGradedOutput()
          returns the graded output from the cell
static ArrayList getHexagonalArrayListInstance(int a, float r, float spacing, Stimulus stimulus, Collection shapes)
          Returns a hexagonal arranged list of hexagonal photoreceptors.
 RetinotopicLocation getRetinotopicLocation()
          return the RetinotopicLocaton of the cell
 void setRetinotopicLocation(RetinotopicLocation p)
          set the location
 
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

ADAPTATION_TIME_CONSTANT

public static final float ADAPTATION_TIME_CONSTANT
adaptation time constant of photoreceptor in seconds: 0.5f

See Also:
Constant Field Values

TRANSIENT_GAIN

public static final float TRANSIENT_GAIN
the transient gain of the photoreceptor, as a multiple of the DC gain: 5.0f

See Also:
Constant Field Values

shape

protected ConvexPolygon shape
The shape of this photoreceptor.


stimulus

protected Stimulus stimulus
The stimulus for this photoreceptor (and likely the whole simulation).


gain

protected float gain
The gain of the high-pass output.


highPass

protected Filter highPass
A high-pass filter that is used to compute the transient gain.

Constructor Detail

Photoreceptor

public Photoreceptor(ConvexPolygon shape,
                     Stimulus stimulus)
Creates a new photoreceptor with a given shape and attached to a given stimulus and a certain gain in higher frequencies.

Parameters:
shape - The shape of the photoreceptor.
stimulus - The stimulus used to stimulate this photoreceptor.
Method Detail

getHexagonalArrayListInstance

public static ArrayList getHexagonalArrayListInstance(int a,
                                                      float r,
                                                      float spacing,
                                                      Stimulus stimulus,
                                                      Collection shapes)
Returns a hexagonal arranged list of hexagonal photoreceptors. The array is arranged so that the x spacing between the centers is the given spacing plus twice the radius r, and the y spacing is smaller by cos(Pi/6). This results in an array with one of the principal axes horizontal, the other two ases are at +/-60 degrees.

Parameters:
a - The number of photoreceptors making one side of the list. E.g. a=2 returns a 7-photoreptor array.
r - The radius of the enclosing circle arround one photoreceptor.
spacing - The additional distance between the photoreceptors.
stimulus - The stimulus to attach to the photoreceptors.
shapes - A collection the shapes of the photoreceptors are added to.
Returns:
The created list.

compute

public void compute(float dt)
Computes the new state of this photoreceptor. The new state is the input (computed from the intersection of the receptor with the stimulus and background and their respective brightnesses) plus the gain times the high-pass filtered input.

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

excitation

public float excitation()
Calculate the exitation of the given object (photoreceptor) from the stimulus. The excitation is the foreground brightness if the receptor is fully illuminated. This excitation is 1 if the photoreceptor is fully illuminated by a brightness of 1. If the receptor is completely unilluminated, the excitation is the background brightness. (The area of the receptor is normalized away).

Returns:
The excitation.

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:
p - to set the cell to. This is generally returned from another cell and is set during construction.

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