|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--ctf.environment.EnvironmentSnapshot
Snapshot of the environment state.
| Fields inherited from interface ctf.common.AgentEnvironment |
ENEMY_TEAM,
OUR_TEAM |
| Constructor Summary | |
(package private) |
EnvironmentSnapshot(ObstacleGrid inObstacleGrid,
AgentGrid inOurTeamGrid,
AgentGrid inEnemyTeamGrid,
BaseGrid inOurBaseGrid,
BaseGrid inEnemyBaseGrid,
FlagGrid inOurFlagGrid,
FlagGrid inEnemyFlagGrid,
AgentInfo inCentralAgentInfo,
int inBoardSize)
Constructs an EnvironmentSnapshot. |
| Method Summary | |
boolean |
hasFlag()
Returns true iff this agent has the enemy flag. |
boolean |
hasFlag(int inTeam)
Returns true iff an agent on the specified team has the other team's flag. |
boolean |
isAgentEast(int inTeam,
boolean inImmediate)
Returns true iff an agent from the specified team is somewhere to the east of this agent (to right of agent's current horizontal position). |
boolean |
isAgentNorth(int inTeam,
boolean inImmediate)
Returns true iff an agent from the specified team is somewhere to the north of this agent (above agent's current vertical position). |
boolean |
isAgentSouth(int inTeam,
boolean inImmediate)
Returns true iff an agent from the specified team is somewhere to the south of this agent (below agent's current vertical position). |
boolean |
isAgentWest(int inTeam,
boolean inImmediate)
Returns true iff an agent from the specified team is somewhere to the west of this agent (to left of agent's current horizontal position). |
boolean |
isBaseEast(int inTeam,
boolean inImmediate)
Returns true iff the specified team's base is somewhere to the east of this agent (above agent's current vertical position). |
boolean |
isBaseNorth(int inTeam,
boolean inImmediate)
Returns true iff the specified team's base is somewhere to the north of this agent (above agent's current vertical position). |
boolean |
isBaseSouth(int inTeam,
boolean inImmediate)
Returns true iff the specified team's base is somewhere to the south of this agent (above agent's current vertical position). |
boolean |
isBaseWest(int inTeam,
boolean inImmediate)
Returns true iff the specified team's base is somewhere to the west of this agent (above agent's current vertical position). |
boolean |
isFlagEast(int inTeam,
boolean inImmediate)
Returns true iff the specified team's flag is somewhere to the east of this agent (to right of agent's current horizontal position). |
boolean |
isFlagNorth(int inTeam,
boolean inImmediate)
Returns true iff the specified team's flag is somewhere to the north of this agent (above agent's current vertical position). |
boolean |
isFlagSouth(int inTeam,
boolean inImmediate)
Returns true iff the specified team's flag is somewhere to the south of this agent (below agent's current vertical position). |
boolean |
isFlagWest(int inTeam,
boolean inImmediate)
Returns true iff the specified team's flag is somewhere to the west of this agent (to left of agent's current horizontal position). |
boolean |
isObstacleEastImmediate()
Returns true an obstacle is in the space immediately east of this agent. |
boolean |
isObstacleNorthImmediate()
Returns true an obstacle is in the space immediately north of this agent. |
boolean |
isObstacleSouthImmediate()
Returns true an obstacle is in the space immediately south of this agent. |
boolean |
isObstacleWestImmediate()
Returns true an obstacle is in the space immediately north of this agent. |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
EnvironmentSnapshot(ObstacleGrid inObstacleGrid,
AgentGrid inOurTeamGrid,
AgentGrid inEnemyTeamGrid,
BaseGrid inOurBaseGrid,
BaseGrid inEnemyBaseGrid,
FlagGrid inOurFlagGrid,
FlagGrid inEnemyFlagGrid,
AgentInfo inCentralAgentInfo,
int inBoardSize)
EnvironmentSnapshot.inObstacleGrid - grid of obstacles.inOurTeamGrid - grid of agent positions for our team.inEnemyTeamGrid - grid of enemy agent positions.inOurFlagGrid - grid of our flag position.inEnemyFlagGrid - grid of enemy flag position.inCentralAgentInfo - info about agent that this snapshot's
AgentEnvironment methods should deal with.| Method Detail |
public boolean isFlagNorth(int inTeam,
boolean inImmediate)
inTeam - check for flag of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate - set to true if trying to check only
space immediately to the north of this agent (and thus
spaces further away are ignored).
public boolean isFlagSouth(int inTeam,
boolean inImmediate)
inTeam - check for flag of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate - set to true if trying to check only
space immediately to the south of this agent (and thus
spaces further away are ignored).
public boolean isFlagEast(int inTeam,
boolean inImmediate)
inTeam - check for flag of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate - set to true if trying to check only
space immediately to the east of this agent (and thus
spaces further away are ignored).
public boolean isFlagWest(int inTeam,
boolean inImmediate)
inTeam - check for flag of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate - set to true if trying to check only
space immediately to the west of this agent (and thus
spaces further away are ignored).
public boolean isBaseNorth(int inTeam,
boolean inImmediate)
inTeam - check for base of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate - set to true if trying to check only
space immediately to the north of this agent (and thus
spaces further away are ignored).
public boolean isBaseSouth(int inTeam,
boolean inImmediate)
inTeam - check for base of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate - set to true if trying to check only
space immediately to the south of this agent (and thus
spaces further away are ignored).
public boolean isBaseEast(int inTeam,
boolean inImmediate)
inTeam - check for base of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate - set to true if trying to check only
space immediately to the east of this agent (and thus
spaces further away are ignored).
public boolean isBaseWest(int inTeam,
boolean inImmediate)
inTeam - check for base of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate - set to true if trying to check only
space immediately to the west of this agent (and thus
spaces further away are ignored).
public boolean isAgentNorth(int inTeam,
boolean inImmediate)
inTeam - check for agent of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate - set to true if trying to check only
space immediately to the north of this agent (and thus
spaces further away are ignored).
public boolean isAgentSouth(int inTeam,
boolean inImmediate)
inTeam - check for agent of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate - set to true if trying to check only
space immediately to the south of this agent (and thus
spaces further away are ignored).
public boolean isAgentEast(int inTeam,
boolean inImmediate)
inTeam - check for agent of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate - set to true if trying to check only
space immediately to the east of this agent (and thus
spaces further away are ignored).
public boolean isAgentWest(int inTeam,
boolean inImmediate)
inTeam - check for agent of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate - set to true if trying to check only
space immediately to the west of this agent (and thus
spaces further away are ignored).public boolean hasFlag()
public boolean hasFlag(int inTeam)
inTeam - check if this team has the other team's flag, valid values
in [OUR_TEAM, ENEMY_TEAM].public boolean isObstacleNorthImmediate()
public boolean isObstacleSouthImmediate()
public boolean isObstacleEastImmediate()
public boolean isObstacleWestImmediate()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||