EDU.gatech.cc.is.abstractrobot
Interface KinSensor

All Known Subinterfaces:
Capture, CommN150, MultiForageN150, RescueVan, SocSmall

public interface KinSensor

The KinSensor class provides an abstract interface to the simulated hardware of a robot that can sense it's kin. In simulation this is implemented by searching for objects the same color as the robot. Do not expect these methods to provide useful information before the simulation begins running (i.e. at initiation time).

Copyright (c)1997, 1998 Tucker Balch


Method Summary
 Vec2[] getOpponents(long timestamp)
          Get an array of Vec2s that represent the locations of opponents.
 int getPlayerNumber(long timestamp)
          Get the robot's player number, between 0 and the number of robots on the team.
 Vec2[] getTeammates(long timestamp)
          Get an array of Vec2s that represent the locations of teammates (Kin).
 void setKinMaxRange(double r)
          Set the maximum range at which kin may be sensed.
 

Method Detail

getTeammates

public Vec2[] getTeammates(long timestamp)
Get an array of Vec2s that represent the locations of teammates (Kin).
Parameters:
timestamp - only get new information if timestamp > than last call or timestamp == -1.
Returns:
the sensed teammates.
See Also:
Vec2

getOpponents

public Vec2[] getOpponents(long timestamp)
Get an array of Vec2s that represent the locations of opponents.
Parameters:
timestamp - only get new information if timestamp > than last call or timestamp == -1.
Returns:
the sensed opponents.
See Also:
Vec2

getPlayerNumber

public int getPlayerNumber(long timestamp)
Get the robot's player number, between 0 and the number of robots on the team. Don't confuse this with getID which returns a unique number for the object in the simulation as a whole, not on its individual team.
Parameters:
timestamp - only get new information if timestamp > than last call or timestamp == -1.
Returns:
the player number.

setKinMaxRange

public void setKinMaxRange(double r)
Set the maximum range at which kin may be sensed. Primarily for use in simulation.
Parameters:
r - double, the maximum range.