public class Sensor extends GamsJNI
| Constructor and Description |
|---|
Sensor()
Default constructor
|
Sensor(Sensor input)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
HashSet<Position> |
discretize(Region region)
Discretizes the region into individual positions
|
HashSet<Position> |
discretize(SearchArea area)
Discretizes the area into individual positions
|
protected void |
finalize()
Cleans up underlying C resources
|
void |
free()
Deletes the C instantiation.
|
static Sensor |
fromPointer(long cptr)
Creates a java object instance from a C/C++ pointer
|
static Sensor |
fromPointer(long cptr,
boolean shouldManage)
Creates a java object instance from a C/C++ pointer
|
double |
getDiscretization()
Gets the discretization value for the sensor
|
GpsPosition |
getGpsFromIndex(Position index)
Gets a GPS coordinate from an index
|
Position |
getIndexFromGps(GpsPosition coord)
Gets a GPS coordinate from an index
|
String |
getName()
Gets the name of the variable
|
GpsPosition |
getOrigin()
Gets the sensor range in meters.
|
double |
getRange()
Gets the sensor range in meters.
|
double |
getValue(GpsPosition position)
Gets the value stored at a particular location
|
double |
getValue(Position position)
Gets the value stored at a particular location
|
void |
init(ai.madara.knowledge.KnowledgeBase kb,
String name,
double range)
Sets the name and knowledge base being referred to
|
void |
setOrigin(GpsPosition origin)
Sets the origin for coverage information and discretization
|
void |
setRange(double range)
Sets the range of the sensor
|
void |
setValue(GpsPosition location,
double value)
Sets a value at a location
|
void |
setValue(Position location,
double value)
Sets a value at a location
|
String |
toString()
Converts the value to a string
|
public Sensor()
public Sensor(Sensor input)
input - the sensor value to copypublic GpsPosition getOrigin() throws GamsDeadObjectException
GamsDeadObjectExceptionpublic double getRange()
throws GamsDeadObjectException
GamsDeadObjectExceptionpublic GpsPosition getGpsFromIndex(Position index) throws GamsDeadObjectException
index - the cartesian positionGamsDeadObjectExceptionpublic Position getIndexFromGps(GpsPosition coord) throws GamsDeadObjectException
coord - coordinate to convert to an indexGamsDeadObjectExceptionpublic double getValue(GpsPosition position) throws GamsDeadObjectException
position - the location to checkGamsDeadObjectExceptionpublic double getValue(Position position) throws GamsDeadObjectException
position - the location to checkGamsDeadObjectExceptionpublic double getDiscretization()
throws GamsDeadObjectException
GamsDeadObjectExceptionpublic void setRange(double range)
throws GamsDeadObjectException
range - the range of the sensor in metersGamsDeadObjectExceptionpublic void setOrigin(GpsPosition origin) throws GamsDeadObjectException
origin - the origin for coverage informationGamsDeadObjectExceptionpublic void setValue(Position location, double value) throws GamsDeadObjectException
location - the position the value will be atvalue - the value to setGamsDeadObjectExceptionpublic void setValue(GpsPosition location, double value) throws GamsDeadObjectException
location - the position the value will be atvalue - the value to setGamsDeadObjectExceptionpublic HashSet<Position> discretize(Region region) throws GamsDeadObjectException
region - the region to discretizeGamsDeadObjectExceptionpublic HashSet<Position> discretize(SearchArea area) throws GamsDeadObjectException
area - the area to discretizeGamsDeadObjectExceptionpublic static Sensor fromPointer(long cptr) throws GamsDeadObjectException
cptr - C pointer to the objectGamsDeadObjectExceptionpublic static Sensor fromPointer(long cptr, boolean shouldManage) throws GamsDeadObjectException
cptr - C pointer to the objectshouldManage - if true, manage the pointerGamsDeadObjectExceptionpublic String getName() throws GamsDeadObjectException
GamsDeadObjectExceptionpublic void init(ai.madara.knowledge.KnowledgeBase kb,
String name,
double range)
throws GamsDeadObjectException
kb - the knowledge base that contains the namename - the variable namerange - the range of the sensor in meters or appropriate unitGamsDeadObjectExceptionpublic String toString()
public void free()
Copyright © 2018. All rights reserved.