public class Radar extends ProtocolZero
formatted, paramscan, priority
Constructor and Description |
---|
Radar(double range) |
Radar(double range,
long period) |
Radar(double range,
long period,
long delay) |
Radar(double range,
priority_t priority) |
Radar(double range,
priority_t priority,
long period) |
Radar(double range,
priority_t priority,
long period,
long delay) |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Integer> |
getAllAtRange(double range)
Gets a list of all entities (identified by entity index) that exist on a circle of radius range.
|
java.lang.String |
getAllEntityDataStrings()
Gets all data strings for all entity indexes.
|
java.lang.String |
getClasstype(int index)
Given entity index, returns the classtype of entity.
|
java.lang.Double |
getDistance(int index)
Given entity index, returns the distance from Quagent to entity.
|
java.lang.String |
getEntityDataString(int index)
Gets the data string unique to the specified entity index.
|
java.lang.Double[] |
getFacing(int index)
Gets the direction vector change between the Quagent's current facing and the entity.
|
java.lang.Integer |
getID(int index)
Given index, return entity ID.
|
int |
getIndex(int entityid)
Finds the index corresponding to a specified entity ID.
|
java.util.List<java.lang.Integer> |
getIndex(java.lang.String classtype)
Finds the indexes corresponding to a specified classtype.
|
int |
getNumberEntitiesFound()
Keeps track of the total number of entities found by the radar.
|
double |
getRange()
Allows access to parameter data.
|
void |
setData(java.lang.String params)
Sets command response data.
|
protected void |
setOp() |
getPriority, hasTerminated, pause, resume, run, setExecutor, terminate, update
addTerminationListener, compareTo, getDelay, getExitCode, getFrequency, getID, getOp, getPeriod, getRuntime, toDataString, toString, verifyClient, waitForTerminate, whatAmI
public Radar(double range, priority_t priority)
public Radar(double range)
public Radar(double range, priority_t priority, long period)
public Radar(double range, long period)
public Radar(double range, priority_t priority, long period, long delay)
public Radar(double range, long period, long delay)
protected void setOp()
setOp
in class ProtocolZero
public double getRange()
public int getNumberEntitiesFound()
public java.lang.Integer getID(int index)
index
- Index of entity. Entities are indexed so that the first
entity found is at the front of the list, and subsequent entities are added to the back of the list.public java.lang.String getClasstype(int index)
index
- Index of entity. Entities are indexed so that the first
entity found is at the front of the list, and subsequent entities are added to the back of the list.public java.lang.Double getDistance(int index)
index
- Index of entity. Entities are indexed so that the first
entity found is at the front of the list, and subsequent entities are added to the back of the list.public int getIndex(int entityid)
entityid
- Entity ID to search for.public java.util.List<java.lang.Integer> getIndex(java.lang.String classtype)
classtype
- Classtype to search for.public java.util.List<java.lang.Integer> getAllAtRange(double range)
range
- Radius of ring.public java.lang.Double[] getFacing(int index)
index
- Index of entity. Entities are indexed so that the first
entity found is at the front of the list, and subsequent entities are added to the back of the list.public java.lang.String getEntityDataString(int index)
index
- Index of entity. Entities are indexed so that the first
entity found is at the front of the list, and subsequent entities are added to the back of the list.public java.lang.String getAllEntityDataStrings()
public void setData(java.lang.String params)
ProtocolZero
setData
in class ProtocolZero
params
- Data string. For all "data" messages it is identified by the form: