org.simbrain.world.odorworld
Class Stimulus

java.lang.Object
  extended by org.simbrain.world.odorworld.Stimulus

public class Stimulus
extends Object

Stimulus.


Field Summary
static String[] DECAYFUNCTIONS
          String array of decay functions.
static String GAUSSIAN
          String value.
static String LINEAR
          String value.
static String QUADRATIC
          String value.
static String STEP
          String value.
 
Constructor Summary
Stimulus()
          Default constructor.
Stimulus(double[] distalstim, String decay, double disp, boolean addNoise, double noiseLevel)
          Instance of stimulus initializing values to be set.
 
Method Summary
 boolean getAddNoise()
          Return the add noise.
 String getDecayFunction()
          Return the decay function.
 int getDecayFunctionIndex(String df)
          Helper function for combo boxes.
static String[] getDecayFunctions()
          Return the decay functions.
 double getDispersion()
          Return the dispersion.
 double getNoiseLevel()
          Return the noise level.
 double getPeak()
           
 double[] getStimulus()
          Return the stimulus.
 double[] getStimulus(double distance)
          Calculate what impact the object will have on the creature's receptors (input nodes) based on its distance from this object and its features (whether it is a "noisy object", and how the stimulus decays.
 int getStimulusDimension()
          Return the dimension of the stimulus.
 String getStimulusS()
          Return the stimulus string.
 double[] getStimulusVector()
          Return the stimulus vector.
 boolean isAddNoise()
          Return add noise.
 void randomize()
          Randomize values.
 void setAddNoise(boolean b)
          Sets the add noise.
 void setDecayFunction(String decay)
          Sets the decay funcion.
 void setDispersion(double d)
          Sets the dispersion.
 void setNoiseLevel(double d)
          Sets the noise level.
 void setPeak(double peak)
           
 void setStimulusS(String vectorString)
          Sets the stimulus string.
 void setStimulusVector(double[] newStim)
          Sets the stimulus vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STEP

public static final String STEP
String value.

See Also:
Constant Field Values

LINEAR

public static final String LINEAR
String value.

See Also:
Constant Field Values

GAUSSIAN

public static final String GAUSSIAN
String value.

See Also:
Constant Field Values

QUADRATIC

public static final String QUADRATIC
String value.

See Also:
Constant Field Values

DECAYFUNCTIONS

public static final String[] DECAYFUNCTIONS
String array of decay functions.

Constructor Detail

Stimulus

public Stimulus(double[] distalstim,
                String decay,
                double disp,
                boolean addNoise,
                double noiseLevel)
Instance of stimulus initializing values to be set.

Parameters:
distalstim - Distal stimulus
decay - Decay rate
disp - Dispersion
addNoise - Add noise
noiseLevel - Level of noise

Stimulus

public Stimulus()
Default constructor.

Method Detail

randomize

public void randomize()
Randomize values.


getStimulusDimension

public int getStimulusDimension()
Return the dimension of the stimulus.

Returns:
the deminsion of the stimulus

setStimulusVector

public void setStimulusVector(double[] newStim)
Sets the stimulus vector.

Parameters:
newStim - New stimulus

getStimulusVector

public double[] getStimulusVector()
Return the stimulus vector.

Returns:
the stimulsu vector

isAddNoise

public boolean isAddNoise()
Return add noise.

Returns:
add noise

getStimulus

public double[] getStimulus()
Return the stimulus.

Returns:
the stimulus

getStimulusS

public String getStimulusS()
Return the stimulus string.

Returns:
the stimulus string

setStimulusS

public void setStimulusS(String vectorString)
Sets the stimulus string.

Parameters:
vectorString - Stimulus string

getNoiseLevel

public double getNoiseLevel()
Return the noise level.

Returns:
the noise level

setAddNoise

public void setAddNoise(boolean b)
Sets the add noise.

Parameters:
b - the add noise

getAddNoise

public boolean getAddNoise()
Return the add noise.

Returns:
the add noise

setDecayFunction

public void setDecayFunction(String decay)
Sets the decay funcion.

Parameters:
decay - decay function

setNoiseLevel

public void setNoiseLevel(double d)
Sets the noise level.

Parameters:
d - Noise level

setDispersion

public void setDispersion(double d)
Sets the dispersion.

Parameters:
d - Dispersion

getDispersion

public double getDispersion()
Return the dispersion.

Returns:
the dispersion

getDecayFunction

public String getDecayFunction()
Return the decay function.

Returns:
the decay function

getStimulus

public double[] getStimulus(double distance)
Calculate what impact the object will have on the creature's receptors (input nodes) based on its distance from this object and its features (whether it is a "noisy object", and how the stimulus decays. That is, calculate the proximal stimulus this distal stimulus gives rise to.

Parameters:
distance - distance of creature from object
Returns:
proximal stimulus to creature caused by this object

getDecayFunctionIndex

public int getDecayFunctionIndex(String df)
Helper function for combo boxes.

Parameters:
df - the decayfunction index to return
Returns:
the int associated with df

getDecayFunctions

public static String[] getDecayFunctions()
Return the decay functions.

Returns:
the decay functions

getPeak

public double getPeak()
Returns:
Returns the peak.

setPeak

public void setPeak(double peak)
Parameters:
peak - The peak to set.