public class SmellSource
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SmellSource.DecayFunction
Decay Functions.
|
Constructor and Description |
---|
SmellSource()
Default constructor.
|
SmellSource(double[] distalstim)
Construct a smell source from a specified stimulus vector, using defaults
otherwise.
|
SmellSource(double[] distalstim,
SmellSource.DecayFunction decay,
double[] location)
Construct smell source from specified parameters.
|
SmellSource(double[] distalstim,
SmellSource.DecayFunction decay,
double disp,
boolean addNoise,
double noiseLevel)
Construct smell source from specified parameters.
|
SmellSource(double[] distalstim,
SmellSource.DecayFunction decay,
double dispersion,
double[] location)
Construct smell source from specified parameters.
|
SmellSource(int numDimensions)
Construct a smell source with a specified number of dimensions, randomly
initialized.
|
Modifier and Type | Method and Description |
---|---|
SmellSource.DecayFunction |
getDecayFunction() |
double |
getDispersion()
Return the dispersion.
|
double[] |
getLocation() |
void |
getLocation(double[] location)
Return location of this smell source.
|
double |
getNoiseLevel()
Return the noise level.
|
double |
getPeak() |
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).
|
double |
getStimulus(int dimension,
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 number of dimensions in the stimulus vector.
|
java.lang.String |
getStimulusString()
Return the stimulus string.
|
double[] |
getStimulusVector()
Return the stimulus vector.
|
ComboBoxWrapper |
getTheDecayFunction() |
boolean |
isAddNoise()
Return add noise.
|
void |
randomize()
Randomize values.
|
void |
setAddNoise(boolean b)
Sets the add noise.
|
void |
setDecayFunction(SmellSource.DecayFunction decayFunction) |
void |
setDispersion(double d)
Sets the dispersion.
|
void |
setLocation(double[] location)
Set the location of this smell source.
|
void |
setNoiseLevel(double d)
Sets the noise level.
|
void |
setPeak(double peak) |
void |
setStimulusS(java.lang.String vectorString)
Sets the stimulus string.
|
void |
setStimulusVector(double[] newStim)
Sets the stimulus vector.
|
void |
setTheDecayFunction(ComboBoxWrapper decayFunctionBox) |
void |
update()
Update the source.
|
public SmellSource(double[] distalstim, SmellSource.DecayFunction decay, double disp, boolean addNoise, double noiseLevel)
distalstim
- Distal stimulusdecay
- Decay ratedisp
- DispersionaddNoise
- Add noisenoiseLevel
- Level of noisepublic SmellSource(double[] distalstim, SmellSource.DecayFunction decay, double dispersion, double[] location)
distalstim
- stimulus vectordecay
- decay functiondispersion
- level of dispersionlocation
- location of smell sourcepublic SmellSource(double[] distalstim, SmellSource.DecayFunction decay, double[] location)
distalstim
- stimulus vectordecay
- decay functionlocation
- location of smell sourcepublic SmellSource(double[] distalstim)
distalstim
- the stimulus vectorpublic SmellSource(int numDimensions)
numDimensions
- number of dimensions of the stimulus vector.public SmellSource()
public void randomize()
public int getStimulusDimension()
public void setStimulusVector(double[] newStim)
newStim
- New stimuluspublic double[] getStimulusVector()
public boolean isAddNoise()
public java.lang.String getStimulusString()
public void setStimulusS(java.lang.String vectorString)
vectorString
- Stimulus stringpublic double getNoiseLevel()
public void setAddNoise(boolean b)
b
- the add noisepublic void setNoiseLevel(double d)
d
- Noise levelpublic void setDispersion(double d)
d
- Dispersionpublic double getDispersion()
public double[] getStimulus(double distance)
distance
- distance of creature from objectpublic void update()
public double getStimulus(int dimension, double distance)
dimension
- distance
- distance of creature from objectpublic double getPeak()
public void setPeak(double peak)
peak
- The peak to set.public SmellSource.DecayFunction getDecayFunction()
public void setDecayFunction(SmellSource.DecayFunction decayFunction)
decayFunction
- the decayFunction to setpublic double[] getLocation()
public void getLocation(double[] location)
location
- the location to setpublic void setLocation(double[] location)
location
- public ComboBoxWrapper getTheDecayFunction()
public void setTheDecayFunction(ComboBoxWrapper decayFunctionBox)
decayFunctionBox
-