public class SmellSensor extends Sensor
SmellSource
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_LABEL
Default label.
|
static double |
DEFAULT_RADIUS
Initial length of mouse whisker.
|
static double |
DEFAULT_THETA
Angle of whisker in radians.
|
Constructor and Description |
---|
SmellSensor(OdorWorldEntity parent,
java.lang.String label,
double theta,
double radius)
Construct a smell sensor.
|
Modifier and Type | Method and Description |
---|---|
double[] |
getCurrentValue() |
double |
getCurrentValue(int index)
The current value at an index.
|
double[] |
getLocation() |
double |
getRadius() |
double |
getTheta() |
java.lang.String |
getTypeDescription()
Short description of the sensor type.
|
void |
setRadius(double radius) |
void |
setTheta(double theta) |
void |
update()
Update the sensor.
|
public static final java.lang.String DEFAULT_LABEL
public static double DEFAULT_THETA
public static final double DEFAULT_RADIUS
public SmellSensor(OdorWorldEntity parent, java.lang.String label, double theta, double radius)
parent
- parentlabel
- label for this sensor (entity name will be added)theta
- offset from straight in degrees radiansradius
- length of "whisker"public double[] getLocation()
public double[] getCurrentValue()
public double getCurrentValue(int index)
index
- public double getTheta()
public void setTheta(double theta)
theta
- the theta to setpublic double getRadius()
public void setRadius(double radius)
radius
- the radius to setpublic java.lang.String getTypeDescription()
Sensor
getTypeDescription
in class Sensor