|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrobocup.lab.intelligent.IntelligentController
public class IntelligentController
The Class IntelligentController.
Field Summary | |
---|---|
private static Brain |
brain
The controller brain. |
private static int |
count
The count. |
private java.util.Set<Literal> |
cycleSensors
The cycle sensors. |
private double |
directionBall
The direction ball. |
private double |
directionOtherFlagPenalty
The direction other flag penalty. |
private double |
directionOtherGoal
The direction other goal. |
private double |
directionOtherPlayer
The direction other player. |
private double |
directionOwnGoal
The direction own goal. |
private double |
distanceBall
The distance ball. |
private double |
distanceOtherFlagPenalty
The distance other flag penalty. |
private double |
distanceOtherGoal
The distance other goal. |
private double |
distanceOtherPlayer
The distance other player. |
private double |
distanceOwnGoal
The distance own goal. |
private java.lang.String |
lastAction
The last action. |
private boolean |
lock
The lock. |
private static org.apache.log4j.Logger |
log
The log. |
private atan.model.ActionsPlayer |
player
The player. |
private java.util.Random |
random
The random. |
private boolean |
seeBall
The see ball. |
private boolean |
seeOtherFlagPenalty
The see other flag penalty. |
private boolean |
seeOtherGoal
The see other goal. |
private boolean |
seeOtherPlayer
The see other player. |
private boolean |
seeOwnGoal
The see own goal. |
Constructor Summary | |
---|---|
IntelligentController()
Instantiates a new intelligent controller. |
Method Summary | |
---|---|
atan.model.ActionsPlayer |
getPlayer()
Returns the current instance of the ActionsPlayer. |
java.lang.String |
getType()
Get the players type, if set. |
void |
infoHearError(atan.model.enums.Errors error)
The player is informed when it hears an error message. |
void |
infoHearOk(atan.model.enums.Ok ok)
The player is informed when it hears an ok message. |
void |
infoHearPlayer(double direction,
java.lang.String message)
The controller is informed when it hears a message from another player. |
void |
infoHearPlayMode(atan.model.enums.PlayMode playMode)
The controller is informed when a play mode message is broadcast. |
void |
infoHearReferee(atan.model.enums.RefereeMessage refereeMessage)
The controller is informed when a referee message is broadcast. |
void |
infoHearWarning(atan.model.enums.Warning warning)
The player is informed when it hears a warning. |
void |
infoSeeBall(double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed that the Ball is in sight. |
void |
infoSeeFlagCenter(atan.model.enums.Flag flag,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed when one of the flags on the center line are in sight. |
void |
infoSeeFlagCornerOther(atan.model.enums.Flag flag,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed that one of the other teams corner flags is in sight. |
void |
infoSeeFlagCornerOwn(atan.model.enums.Flag flag,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed that one of our teams corner flags is in sight. |
void |
infoSeeFlagGoalOther(atan.model.enums.Flag flag,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed that one of the other teams goal flags is in sight. |
void |
infoSeeFlagGoalOwn(atan.model.enums.Flag flag,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed that one of our teams goal flags is in sight. |
void |
infoSeeFlagLeft(atan.model.enums.Flag flag,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed when one of the flags along the left touchline is in sight. |
void |
infoSeeFlagOther(atan.model.enums.Flag flag,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed when one of the flags behind the other teams goal is in sight. |
void |
infoSeeFlagOwn(atan.model.enums.Flag flag,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed when one of the flags behind our teams goal is in sight. |
void |
infoSeeFlagPenaltyOther(atan.model.enums.Flag flag,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed that one of the other teams penalty box flags is in sight. |
void |
infoSeeFlagPenaltyOwn(atan.model.enums.Flag flag,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed that one of our teams penalty box flags is in sight. |
void |
infoSeeFlagRight(atan.model.enums.Flag flag,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed when one of the flags along the right touchline is in sight. |
void |
infoSeeLine(atan.model.enums.Line line,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed that one of the pitch lines are in sight. |
void |
infoSeePlayerOther(int number,
boolean goalie,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed that one of the other teams players is in sight. |
void |
infoSeePlayerOwn(int number,
boolean goalie,
double distance,
double direction,
double distChange,
double dirChange,
double bodyFacingDirection,
double headFacingDirection)
The controller is informed that one of it's own team is in sight. |
void |
infoSenseBody(atan.model.enums.ViewQuality viewQuality,
atan.model.enums.ViewAngle viewAngle,
double stamina,
double unknown,
double effort,
double speedAmount,
double speedDirection,
double headAngle,
int kickCount,
int dashCount,
int turnCount,
int sayCount,
int turnNeckCount,
int catchCount,
int moveCount,
int changeViewCount)
|
private void |
initState()
Inits the player sensing state. |
private void |
pause(int ms)
Pause. |
void |
postInfo()
This is the method called one all the visual information has been processed. |
void |
preInfo()
This is the method called before the controller receives all the new visual information. |
private int |
randomDashValueFast()
Random dash value fast. |
private int |
randomDashValueSlow()
Random dash value slow. |
private int |
randomDirection(int direction)
Random direction. |
private int |
randomKickDirectionValue()
Random kick direction value. |
private double |
randomTurnValue()
Random turn value. |
private int |
randomXPosition()
Random x position. |
private int |
randomYPosition()
Random y position. |
void |
setPlayer(atan.model.ActionsPlayer p)
Sets the player that the controller is controlling. |
void |
setType(java.lang.String newType)
Set the players type. |
private void |
turnTowardBall()
Turn toward ball. |
private void |
turnTowardOtherGoal()
Turn toward other goal. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static org.apache.log4j.Logger log
private static Brain brain
private java.util.Set<Literal> cycleSensors
private boolean lock
private java.util.Random random
private static int count
private atan.model.ActionsPlayer player
private boolean seeBall
private boolean seeOwnGoal
private boolean seeOtherGoal
private boolean seeOtherPlayer
private boolean seeOtherFlagPenalty
private double distanceBall
private double directionBall
private double directionOwnGoal
private double distanceOwnGoal
private double directionOtherGoal
private double distanceOtherGoal
private double distanceOtherPlayer
private double directionOtherPlayer
private double distanceOtherFlagPenalty
private double directionOtherFlagPenalty
private java.lang.String lastAction
Constructor Detail |
---|
public IntelligentController()
Method Detail |
---|
private void initState()
public atan.model.ActionsPlayer getPlayer()
atan.model.ControllerPlayer
getPlayer
in interface atan.model.ControllerPlayer
public java.lang.String getType()
atan.model.ControllerPlayer
getType
in interface atan.model.ControllerPlayer
public void infoHearError(atan.model.enums.Errors error)
atan.model.ControllerPlayer
infoHearError
in interface atan.model.ControllerPlayer
error
- The error to handlepublic void infoHearOk(atan.model.enums.Ok ok)
atan.model.ControllerPlayer
infoHearOk
in interface atan.model.ControllerPlayer
ok
- The message to handle.public void infoHearPlayMode(atan.model.enums.PlayMode playMode)
atan.model.ControllerPlayer
infoHearPlayMode
in interface atan.model.ControllerPlayer
playMode
- possible values: BEFORE_KICK_OFF, TIME_OVER, PLAY_ON,
KICK_OFF_OWN, KICK_OFF_OTHER, FREE_KICK_OWN,
FREE_KICK_OTHER, GOAL_KICK_OWN, CORNER_KICK_OTHER,
GOAL_KICK_OWN, GOAL_KICK_OTHER, GOAL_OWN, GOAL_OTHERpublic void infoHearPlayer(double direction, java.lang.String message)
atan.model.ControllerPlayer
infoHearPlayer
in interface atan.model.ControllerPlayer
direction
- The direction from which the message originated.message
- The actual message said.public void infoHearReferee(atan.model.enums.RefereeMessage refereeMessage)
atan.model.ControllerPlayer
infoHearReferee
in interface atan.model.ControllerPlayer
refereeMessage
- possible values: FOUL_OWN, FOUL_OTHER,
HALF_TIME, TIME_UP, TIME_UP_WITHOUT_A_TEAM,
TIME_EXTENDED, DROP_BALL, OFFSIDE_OWN, OFFSIDE_OTHERpublic void infoHearWarning(atan.model.enums.Warning warning)
atan.model.ControllerPlayer
infoHearWarning
in interface atan.model.ControllerPlayer
warning
- The warning to handle.public void infoSeeBall(double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeeBall
in interface atan.model.ControllerPlayer
distance
- The distance to the ball.direction
- The direction of the ball.public void infoSeeFlagCenter(atan.model.enums.Flag flag, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeeFlagCenter
in interface atan.model.ControllerPlayer
flag
- possible values: LEFT, CENTER, RIGHTdistance
- The distance to the flag.direction
- The direction of the flag.public void infoSeeFlagCornerOther(atan.model.enums.Flag flag, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeeFlagCornerOther
in interface atan.model.ControllerPlayer
flag
- possible values: LEFT, RIGHTdistance
- The distance to the flag.direction
- The direction of the flag.public void infoSeeFlagCornerOwn(atan.model.enums.Flag flag, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeeFlagCornerOwn
in interface atan.model.ControllerPlayer
flag
- possible values: LEFT, RIGHTdistance
- The distance to the flag.direction
- The direction of the flag.public void infoSeeFlagGoalOther(atan.model.enums.Flag flag, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeeFlagGoalOther
in interface atan.model.ControllerPlayer
flag
- possible values: LEFT, CENTER, RIGHTdistance
- The distance to this flag.direction
- The direction of the flag.public void infoSeeFlagGoalOwn(atan.model.enums.Flag flag, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeeFlagGoalOwn
in interface atan.model.ControllerPlayer
flag
- possible values: LEFT, CENTER, RIGHTdistance
- The distance to this flag.direction
- The direction of the flag.public void infoSeeFlagLeft(atan.model.enums.Flag flag, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeeFlagLeft
in interface atan.model.ControllerPlayer
flag
- possible values: OWN_50, OWN_40, OWN_30, OWN_20, OWN_10, MID
OTHER_10, OTHER_20, OTHER_30, OTHER_40, OTHER_50distance
- The distance to the flag.direction
- The direction of the flag.public void infoSeeFlagOther(atan.model.enums.Flag flag, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeeFlagOther
in interface atan.model.ControllerPlayer
flag
- possible values: LEFT_10, LEFT_20, LEFT_30, MID,
RIGHT_10, RIGHT_20, RIGHT_30distance
- The distance to the flag.direction
- The direction of the flag.public void infoSeeFlagOwn(atan.model.enums.Flag flag, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeeFlagOwn
in interface atan.model.ControllerPlayer
flag
- possible values: LEFT_10, LEFT_20, LEFT_30, MID,
RIGHT_10, RIGHT_20, RIGHT_30distance
- The distance to the flag.direction
- The direction of the flag.public void infoSeeFlagPenaltyOther(atan.model.enums.Flag flag, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeeFlagPenaltyOther
in interface atan.model.ControllerPlayer
flag
- possible values: LEFT, CENTER, RIGHTdistance
- The distance to this flag.direction
- The direction of this flag.public void infoSeeFlagPenaltyOwn(atan.model.enums.Flag flag, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeeFlagPenaltyOwn
in interface atan.model.ControllerPlayer
flag
- possible values: LEFT, CENTER, RIGHTdistance
- The distance to this flag.direction
- The direction of this flag.public void infoSeeFlagRight(atan.model.enums.Flag flag, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeeFlagRight
in interface atan.model.ControllerPlayer
flag
- possible values: OWN_50, OWN_40, OWN_30, OWN_20, OWN_10, MID,
OTHER_10, OTHER_20, OTHER_30, OTHER_40, OTHER_50distance
- The distance to the flag.direction
- The direction of the flag.public void infoSeeLine(atan.model.enums.Line line, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeeLine
in interface atan.model.ControllerPlayer
distance
- The distance to the line.direction
- The direction of the line.public void infoSeePlayerOther(int number, boolean goalie, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeePlayerOther
in interface atan.model.ControllerPlayer
number
- The ID of the player (from 1 to 11)goalie
- If the seen player is a goalie. False if unknown.distance
- The distance to the player.direction
- The direction of the player.public void infoSeePlayerOwn(int number, boolean goalie, double distance, double direction, double distChange, double dirChange, double bodyFacingDirection, double headFacingDirection)
atan.model.ControllerPlayer
infoSeePlayerOwn
in interface atan.model.ControllerPlayer
number
- The ID of the player (from 1 to 11)goalie
- If the seen player is a goalie. False if unknown.distance
- The distance to the player.direction
- The direction of the player.public void infoSenseBody(atan.model.enums.ViewQuality viewQuality, atan.model.enums.ViewAngle viewAngle, double stamina, double unknown, double effort, double speedAmount, double speedDirection, double headAngle, int kickCount, int dashCount, int turnCount, int sayCount, int turnNeckCount, int catchCount, int moveCount, int changeViewCount)
infoSenseBody
in interface atan.model.ControllerPlayer
viewQuality
- possible values: HIGH, LOWviewAngle
- possible values: NARROW, NORMAL, WIDEpublic void postInfo()
atan.model.ControllerPlayer
postInfo
in interface atan.model.ControllerPlayer
public void preInfo()
atan.model.ControllerPlayer
preInfo
in interface atan.model.ControllerPlayer
public void setPlayer(atan.model.ActionsPlayer p)
atan.model.ControllerPlayer
setPlayer
in interface atan.model.ControllerPlayer
p
- ActionsPlayer.public void setType(java.lang.String newType)
atan.model.ControllerPlayer
setType
in interface atan.model.ControllerPlayer
newType
- what the type will now beprivate int randomDashValueSlow()
private double randomTurnValue()
private int randomDashValueFast()
private int randomKickDirectionValue()
private int randomXPosition()
private int randomYPosition()
private int randomDirection(int direction)
direction
- the direction
private void turnTowardBall()
private void turnTowardOtherGoal()
private void pause(int ms)
ms
- the ms
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |