/* * BasicTeam.java */ package JavaSoccer.teams; import EDU.gatech.cc.is.util.Vec2; import EDU.gatech.cc.is.abstractrobot.*; //Clay not used /** * Example of a simple strategy for a robot * soccer team without using Clay. * It illustrates how to use many of the sensor and * all of the motor methods of a SocSmall robot. *
* For detailed information on how to configure behaviors, see the * Clay page. *
* Copyright
* (c)1997 Georgia Tech Research Corporation
*
* @author Tucker Balch
* @version $Revision: 1.2 $
*/
public class BasicTeam extends ControlSystemSS
{
/**
Configure the control system. This method is
called once at initialization time. You can use it
to do whatever you like.
*/
public void Configure()
{
// not used in this example.
}
/**
Called every timestep to allow the control system to
run.
*/
public int TakeStep()
{
// the eventual movement command is placed here
Vec2 result = new Vec2(0,0);
// get the current time for timestamps
long curr_time = abstract_robot.getTime();
/*--- Get some sensor data ---*/
// get vector to the ball
Vec2 ball = abstract_robot.getBall(curr_time);
// get vector to our and their goal
Vec2 ourgoal = abstract_robot.getOurGoal(curr_time);
Vec2 theirgoal = abstract_robot.getOpponentsGoal(curr_time);
// get a list of the positions of our teammates
Vec2[] teammates = abstract_robot.getTeammates(curr_time);
/*--- check get opponents routine ---*/
//Vec2[] opponents = abstract_robot.getOpponents(curr_time);
//for (int i=0;i