EDU.gatech.cc.is.abstractrobot
Class KinSensorSim
java.lang.Object
|
+--EDU.gatech.cc.is.abstractrobot.KinSensorSim
- public class KinSensorSim
- extends java.lang.Object
A class that implements the KinSensor interface. You can use
objects of this class in your simulated robot code to easily
implement the KinSensor interface for your simulated robot.
Copyright
(c)1997, 1998 Tucker Balch
Field Summary |
static boolean |
DEBUG
|
Method Summary |
Vec2[] |
getOpponents(SimulatedObject[] all_objects)
Get an array of Vec2s that point egocentrically from the
center of the robot to the opponents currently sensed by the
robot. |
int |
getPlayerNumber(SimulatedObject[] all_objects)
Return this robot's player number. |
Vec2[] |
getTeammates(SimulatedObject[] all_objects)
Get an array of Vec2s that point egocentrically from the
center of the robot to the teammates currently sensed by the
robot. |
void |
setKinMaxRange(double range)
Set the maximum range at which a sensor reading should be considered
kin. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DEBUG
public static final boolean DEBUG
KinSensorSim
public KinSensorSim(SimulatedObject r)
- Instantiate a KinSensorSim object.
- Parameters:
r
- SimulatedObject, the robot on which the KinSensor resides.
getPlayerNumber
public int getPlayerNumber(SimulatedObject[] all_objects)
- Return this robot's player number. This is distinct
from the simulation-oriented unique_id.
- Parameters:
ignored
- long, ignored.- Returns:
- the player number.
getTeammates
public Vec2[] getTeammates(SimulatedObject[] all_objects)
- Get an array of Vec2s that point egocentrically from the
center of the robot to the teammates currently sensed by the
robot.
- Parameters:
all_objects
- SimulatedObject[] other objects in the
simulation.- Returns:
- the sensed teammates.
getOpponents
public Vec2[] getOpponents(SimulatedObject[] all_objects)
- Get an array of Vec2s that point egocentrically from the
center of the robot to the opponents currently sensed by the
robot.
- Parameters:
all_objects
- SimulatedObject[] other objects in the
simulation.- Returns:
- the sensed opponents.
setKinMaxRange
public void setKinMaxRange(double range)
- Set the maximum range at which a sensor reading should be considered
kin. Beyond this range, the readings are ignored.
- Parameters:
range
- the range in meters.