public final class Sensor
extends java.lang.Object
Constructor and Description |
---|
Sensor(int row,
int col,
Filter filter,
ReceptiveField receptiveField)
Create a new sensor with the specified filter and receptive field.
|
Sensor(int row,
int col,
ReceptiveField receptiveField)
Create a new sensor with the specified receptive field and no filter.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add the specified property change listener.
|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Add the specified property change listener for the specified property.
|
java.lang.String |
getDescription() |
Filter |
getFilter()
Return the filter for this sensor.
|
java.lang.String |
getKey()
Return a unique identifier for this sensor.
|
double |
getLastSample()
Return the last sample value for this sensor.
|
ReceptiveField |
getReceptiveField()
Return the receptive field for this sensor.
|
java.lang.Double |
getValue() |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove the specified property change listener.
|
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Remove the specified property change listener for the specified property.
|
double |
sample(PixelMatrix pixelMatrix)
Sample the specified pixel matrix, reducing a view of the pixel matrix
through the receptive field of this sensor to a single numerical value
with the filter for this sensor.
|
void |
setFilter(Filter filter)
Set the filter for this sensor to
filter . |
public Sensor(int row, int col, ReceptiveField receptiveField)
row
- row numbercol
- column numberreceptiveField
- receptive field for this sensor, must not be nullpublic Sensor(int row, int col, Filter filter, ReceptiveField receptiveField)
row
- row numbercol
- column numberfilter
- filter for this sensor, must not be nullreceptiveField
- receptive field for this sensor, must not be nullpublic double sample(PixelMatrix pixelMatrix)
pixelMatrix
- pixel matrix, must not be nullgetFilter()
,
getReceptiveField()
public double getLastSample()
public Filter getFilter()
public void setFilter(Filter filter)
filter
.
This is a bound property.
filter
- filter for this sensor, must not be nullpublic ReceptiveField getReceptiveField()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- listener to addpublic void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
propertyName
- property namelistener
- listener to addpublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- listener to removepublic void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
propertyName
- property namelistener
- listener to removepublic java.lang.String getKey()
public java.lang.String getDescription()
public java.lang.Double getValue()