public class AgentInfo extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
AgentInfo.playerState |
Modifier and Type | Field and Description |
---|---|
static double |
BALL_IN_CONTROL
Distance used in ball control calculation.
|
static double |
CONTROL_DISTANCE |
static int |
ENEMY_GOAL_RANGE
Distance from our net, from where opponent player is able
to shoot to enemy's net.
|
private double |
enemyGoalRange |
static double |
HALF_FIELD_WIDTH
Half field width.
|
static boolean |
hasAssignedSide
Whether the player's side was already assigned by the server
|
private static AgentInfo |
instance |
private boolean |
isBallMine |
private boolean |
isInRange |
private boolean |
isUnderCover |
static double |
NEAR_BALL
Distance used in is ball near agent calculation.
|
private boolean |
nearBall |
private HashMap<Integer,AgentInfo.playerState> |
opponentsStates |
static int |
OUR_GOAL_RANGE
Distance from net, from where agent is able
to shoot to enemy's net.
|
private double |
ourGoalRange |
static double |
PASS_ANGLE |
static double |
PASS_SPACE |
static int |
PLAYER_UNDER_COVER
Distance used in under cover calculation.
|
static int |
playerId
Agent's ID - should be unique in team
|
static Side |
side
Side where agent has his own net
|
static double |
STANDING_LIMIT
Minimum value for agents state calculation which is
calculated for every seen player.
|
private String |
state |
static String |
team
Team of the agent
|
private HashMap<Integer,AgentInfo.playerState> |
teammatesStates |
private String |
whereIsBall |
private String |
whereIsGoal |
Constructor and Description |
---|
AgentInfo() |
Modifier and Type | Method and Description |
---|---|
Vector3D |
ballControlPosition() |
double |
ballUnseen() |
double |
calculateDistance(Vector3D startPosition,
Vector3D stopPosition)
Calculates distance between start position and stop position.
|
double |
getEnemyGoalRange() |
protected Vector3D |
getGoalAbsolutePosition(Side side)
return position of goal
|
static AgentInfo |
getInstance()
Returns instance of agentInfo we can set attributes of.
|
boolean |
getIsBallMine() |
boolean |
getIsInRange() |
boolean |
getIsUnderCover() |
protected double[] |
getLineFromPoints(Vector3D first_point,
Vector3D second_point)
Deprecated.
use robocup.library.geometry.Line2D
|
boolean |
getNearBall() |
void |
getOpponentsState()
Checks state of opponents that this agent can see.
|
HashMap<Integer,AgentInfo.playerState> |
getOpponentsStates()
Returns the HashMap containing opponent players states
each by the number of player(key value).
|
double |
getOurGoalRange() |
AgentInfo.playerState |
getPlayerState(Player player,
boolean isOpponent)
Method calculating specified player´s state for specified team.
|
String |
getState()
returns the state of agent
|
void |
getTeammatesState()
Checks state of team mates that agent can see.
|
HashMap<Integer,AgentInfo.playerState> |
getTeammatesStates()
Returns the HashMap containing team mates states
each by the number of player(key value).
|
String |
getWhereIsBall()
returns where is ball value
|
String |
getWhereIsGoal() |
boolean |
isBallMine()
check if agent is near to ball
|
boolean |
isForward(Vector3D startPosition,
Vector3D stopPosition,
Vector3D opponentPlayerPosition)
Checks if specified opponent is in the way of the agent.
|
boolean |
isInHalfPlane(double a,
double c,
Vector3D position)
Checks if specified point falls into half plane(bod do polroviny).
|
void |
isInRange()
check if agent can kick to goal
|
void |
isUnderCover()
check if enemy players are near to agent
|
boolean |
isWayFree()
check if is free way for pass
|
Vector3D |
kickTarget() |
static void |
logState(String state)
log function
|
void |
loguj(String state)
Logs using specified String
|
void |
logujStav(String state)
Logs using specified String if this doesn't equal agentInfo state
|
void |
myState()
Outputs actual received data from server of current agent.
|
boolean |
nearBall()
check if agent is near to ball
|
void |
setEnemyGoalRange(double enemyGoalRange) |
void |
setIsBallMine(boolean isBallMine) |
void |
setIsInRange(boolean isInRange) |
void |
setIsUnderCover(boolean isUnderCover) |
void |
setNearBall(boolean nearBall) |
void |
setOurGoalRange(double ourGoalRange) |
void |
setState(String state) |
void |
setWhereIsBall(String whereIsBall) |
void |
setWhereIsGoal(String whereIsGoal) |
void |
whereIsBall()
check relative orientation of ball to agent
|
void |
whereIsGoal()
check relative orientation of goal to agent
|
String |
whereIsTarget(Vector3D target)
check relative orientation of goal to agent
|
private String state
private String whereIsBall
private String whereIsGoal
private boolean isBallMine
private boolean nearBall
private boolean isInRange
private boolean isUnderCover
private double ourGoalRange
private double enemyGoalRange
private static AgentInfo instance
private HashMap<Integer,AgentInfo.playerState> opponentsStates
private HashMap<Integer,AgentInfo.playerState> teammatesStates
public static String team
public static int playerId
public static Side side
public static boolean hasAssignedSide
public static final double BALL_IN_CONTROL
public static final double NEAR_BALL
public static final int PLAYER_UNDER_COVER
public static final int OUR_GOAL_RANGE
public static final int ENEMY_GOAL_RANGE
public static final double HALF_FIELD_WIDTH
public static final double PASS_SPACE
public static final double PASS_ANGLE
public static final double STANDING_LIMIT
public static final double CONTROL_DISTANCE
public static AgentInfo getInstance()
public Vector3D kickTarget()
public double ballUnseen()
public Vector3D ballControlPosition()
@Deprecated protected double[] getLineFromPoints(Vector3D first_point, Vector3D second_point)
first_point
- second_point
- protected Vector3D getGoalAbsolutePosition(Side side)
side
- public boolean isBallMine()
public boolean nearBall()
public void whereIsGoal()
public String whereIsTarget(Vector3D target)
public void whereIsBall()
public void isInRange()
public void isUnderCover()
public boolean isWayFree()
public boolean isInHalfPlane(double a, double c, Vector3D position)
public double calculateDistance(Vector3D startPosition, Vector3D stopPosition)
public boolean isForward(Vector3D startPosition, Vector3D stopPosition, Vector3D opponentPlayerPosition)
public void setState(String state)
state
- to setpublic String getState()
public void setWhereIsBall(String whereIsBall)
whereIsBall
- to setpublic String getWhereIsBall()
public void setWhereIsGoal(String whereIsGoal)
whereIsGoal
- to setpublic String getWhereIsGoal()
public void setIsBallMine(boolean isBallMine)
isBallMine
- to setpublic boolean getIsBallMine()
public void setNearBall(boolean nearBall)
isBallMine
- to setpublic boolean getNearBall()
public void setIsInRange(boolean isInRange)
isInRange
- to setpublic boolean getIsInRange()
public void setIsUnderCover(boolean isUnderCover)
isUnderCover
- to setpublic boolean getIsUnderCover()
public void setOurGoalRange(double ourGoalRange)
ourGoalRange
- to setpublic double getOurGoalRange()
public void setEnemyGoalRange(double enemyGoalRange)
enemyGoalRange
- to setpublic double getEnemyGoalRange()
public void loguj(String state)
state
- public void logujStav(String state)
state
- public static void logState(String state)
string
- to log to LogForState.logpublic HashMap<Integer,AgentInfo.playerState> getOpponentsStates()
public HashMap<Integer,AgentInfo.playerState> getTeammatesStates()
public void getOpponentsState()
public void getTeammatesState()
public AgentInfo.playerState getPlayerState(Player player, boolean isOpponent)
player
- isOpponent
- public void myState()