Methods Used by Capture the Flag Agents
Agent Sensor Methods
Agent sensor methods are methods that may be used by agents to sense their environment.get-id-numberreturns an int, a unique number between 0 and 9 for each agent on the team. You can use this to assign different tasks to different agents (for example: offense, flag guard and jail guard).
sense-my-teamreturns a list of the players on the agent's team in the agent's sensor range.
sense-other-teamreturns a list of the players on the other team in the agent's sensor range.
sense-my-flagreturns an object—the flag of the agent's team, if it is in the sensor range.
sense-other-flagreturns an object—the flag of the other team, if it is in the sensor range.
sense-my-jailreturns an object, the jail where your teammates are being held, if it is in the sensor range. This is the jail you want to get to in order to free your teammates.
sense-other-jailreturns an object, the jail where the other team's players are being held, if it is in the sensor range. This is the jail you want to defend.
get-my-home-locationreturns a vector, the closest point to the agent on the agent's home-side.
get-angle to vectorLocationreturns a number representing, in radians, the angle to the location vectorLocation. A positive number indicates that the point is to right of the agent, a negative number indicates that the point
Agent Action Methods
Agent action methods are method that an agent can execute to change its behavior. For Capture the Flag agents, this means turning or moving.turn-leftTurns the agent left by a small amount
turn-rightTurns the agent right by a small amount
set-speed to agentSpeedSets the speed of the agent to agentSpeed units. agentSpeed may be between 0.0 and 1.0.
Controller Methods
Controller methods are methods which all agents can access by referring to the variablecontroller, which is defined for all agents.
get-timereturns a float, the current time in simulated seconds. Since the game is only 500.0 seconds long, you may wish to modify agent behaviors based on the current time.
get-jailed-red-countreturns an int, the number of Red agents in jail.
get-jailed-blue-countreturns an int, the number of Blue agents in jail.
"Real" Object Information Method
This method can be called for any "Real" object, including both agents and flags:get-locationreturns a vector, the location of a given object.
