Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

WorldModel Class Reference

#include <WorldModel.h>

Collaboration diagram for WorldModel:

Collaboration graph
[legend]
List of all members.

Public Methods

void setTimeLastCatch (Time time)
int getTimeSinceLastCatch ()
bool setTimeLastRefereeMessage (Time time)
Time getTimeLastRefereeMessage ()
Time getCurrentTime ()
int getCurrentCycle ()
bool isTimeStopped ()
bool isLastMessageSee () const
Time getTimeLastSeeGlobalMessage () const
bool setTimeLastSeeGlobalMessage (Time time)
Time getTimeLastSeeMessage () const
Time getTimeLastRecvSeeMessage () const
bool setTimeLastSeeMessage (Time time)
Time getTimeLastSenseMessage () const
Time getTimeLastRecvSenseMessage () const
bool setTimeLastSenseMessage (Time time)
Time getTimeLastHearMessage () const
bool setTimeLastHearMessage (Time time)
int getPlayerNumber () const
bool setPlayerNumber (int i)
SideT getSide () const
bool setSide (SideT s)
const char * getTeamName () const
bool setTeamName (char *str)
PlayModeT getPlayMode () const
bool setPlayMode (PlayModeT pm)
int getGoalDiff () const
int addOneToGoalDiff ()
int subtractOneFromGoalDiff ()
int getNrOfCommands (CommandT c) const
bool setNrOfCommands (CommandT c, int i)
Time getTimeCheckBall () const
bool setTimeCheckBall (Time time)
BallStatusT getCheckBallStatus () const
bool setCheckBallStatus (BallStatusT bs)
bool getRecvThink ()
char * getCommunicationString ()
bool setCommunicationString (char *srt)
ObjectT getObjectFocus ()
bool setObjectFocus (ObjectT obj)
ObjectT iterateObjectStart (int &iIndex, ObjectSetT g, double dConf=-1.0, bool bForward=false)
ObjectT iterateObjectNext (int &iIndex, ObjectSetT g, double dConf=-1.0, bool bForward=false)
void iterateObjectDone (int &iIndex)
ObjectT getAgentObjectType () const
int getAgentIndex () const
bool setAgentObjectType (ObjectT o)
AngDeg getAgentBodyAngleRelToNeck () const
AngDeg getAgentGlobalNeckAngle () const
AngDeg getAgentGlobalBodyAngle ()
Stamina getAgentStamina () const
TiredNessT getAgentTiredNess () const
double getAgentEffort () const
VecPosition getAgentGlobalVelocity () const
double getAgentSpeed () const
VecPosition getAgentGlobalPosition () const
bool setAgentViewAngle (ViewAngleT va)
ViewAngleT getAgentViewAngle () const
bool setAgentViewQuality (ViewQualityT vq)
ViewQualityT getAgentViewQuality () const
double getAgentViewFrequency (ViewAngleT va=VA_ILLEGAL, ViewQualityT vq=VQ_ILLEGAL)
bool getAgentArmMovable ()
VecPosition getAgentArmPosition ()
int getAgentArmExpires ()
VecPosition getBallPos ()
double getBallSpeed ()
AngDeg getBallDirection ()
Time getTimeGlobalPosition (ObjectT o)
VecPosition getGlobalPosition (ObjectT o)
Time getTimeGlobalVelocity (ObjectT o)
VecPosition getGlobalVelocity (ObjectT o)
double getRelativeDistance (ObjectT o)
VecPosition getRelativePosition (ObjectT o)
AngDeg getRelativeAngle (ObjectT o, bool bWithBody=false)
Time getTimeGlobalAngles (ObjectT o)
AngDeg getGlobalBodyAngle (ObjectT o)
AngDeg getGlobalNeckAngle (ObjectT o)
AngDeg getGlobalAngle (ObjectT o)
double getConfidence (ObjectT o)
bool isKnownPlayer (ObjectT o)
ObjectT getOppGoalieType ()
ObjectT getOwnGoalieType ()
Time getTimeLastSeen (ObjectT o)
Time getTimeChangeInformation (ObjectT o)
VecPosition getGlobalPositionLastSee (ObjectT o)
Time getTimeGlobalPositionLastSee (ObjectT o)
VecPosition getGlobalVelocityLastSee (ObjectT o)
AngDeg getGlobalBodyAngleLastSee (ObjectT o)
int getTackleExpires (ObjectT o=OBJECT_ILLEGAL)
AngDeg getGlobalArmDirection (ObjectT o)
Time getTimeGlobalArmDirection (ObjectT o)
double getProbTackleSucceeds (ObjectT o=OBJECT_ILLEGAL, int iExtraCycles=0, VecPosition *pos=NULL)
double getProbTackleClosestOpp (int iExtraCycles=0)
list< ObjectTgetListCloseOpponents (VecPosition pos, double dDist=15)
bool setIsKnownPlayer (ObjectT o, bool isKnownPlayer)
bool setTimeLastSeen (ObjectT o, Time time)
bool setHeteroPlayerType (ObjectT o, int iPlayer)
PlayerT getPlayerType (ObjectT o=OBJECT_ILLEGAL)
bool isInPlayerSet (ObjectT o, PlayerSetT ps)
VecPosition getPosOpponentGoal ()
VecPosition getPosOwnGoal ()
double getRelDistanceOpponentGoal ()
AngDeg getRelAngleOpponentGoal ()
ObjectT getLastOpponentDefender (double *dX=NULL)
HeteroPlayerSettings getInfoHeteroPlayer (int iIndex)
HeteroPlayerSettings getHeteroInfoPlayer (ObjectT obj)
int getHeteroPlayerType (ObjectT obj)
bool setSubstitutedOpp (ObjectT obj)
ObjectT getSubstitutedOpp ()
double getDashPowerRate (ObjectT obj)
double getPlayerSpeedMax (ObjectT obj)
double getPlayerDecay (ObjectT obj)
double getMaximalKickDist (ObjectT obj)
double getStaminaIncMax (ObjectT obj)
double getPlayerSize (ObjectT obj)
double getInertiaMoment (ObjectT obj)
double getEffortMax (ObjectT obj)
double getEffectiveMaxSpeed (ObjectT obj, bool bWithNoise=false)
bool isQueuedActionPerformed ()
bool isFreeKickUs (PlayModeT pm=PM_ILLEGAL)
bool isFreeKickThem (PlayModeT pm=PM_ILLEGAL)
bool isCornerKickUs (PlayModeT pm=PM_ILLEGAL)
bool isCornerKickThem (PlayModeT pm=PM_ILLEGAL)
bool isOffsideUs (PlayModeT pm=PM_ILLEGAL)
bool isOffsideThem (PlayModeT pm=PM_ILLEGAL)
bool isKickInUs (PlayModeT pm=PM_ILLEGAL)
bool isKickInThem (PlayModeT pm=PM_ILLEGAL)
bool isFreeKickFaultUs (PlayModeT pm=PM_ILLEGAL)
bool isFreeKickFaultThem (PlayModeT pm=PM_ILLEGAL)
bool isKickOffUs (PlayModeT pm=PM_ILLEGAL)
bool isKickOffThem (PlayModeT pm=PM_ILLEGAL)
bool isBackPassUs (PlayModeT pm=PM_ILLEGAL)
bool isBackPassThem (PlayModeT pm=PM_ILLEGAL)
bool isGoalKickUs (PlayModeT pm=PM_ILLEGAL)
bool isGoalKickThem (PlayModeT pm=PM_ILLEGAL)
bool isBeforeKickOff (PlayModeT pm=PM_ILLEGAL)
bool isDeadBallUs (PlayModeT pm=PM_ILLEGAL)
bool isDeadBallThem (PlayModeT pm=PM_ILLEGAL)
bool isPenaltyUs (PlayModeT pm=PM_ILLEGAL)
bool isPenaltyThem (PlayModeT pm=PM_ILLEGAL)
bool isFullStateOn (SideT s=SIDE_ILLEGAL)
bool setChangeViewCommand (SoccerCommand soc)
SoccerCommand getChangeViewCommand ()
SideT getSidePenalty ()
bool setSidePenalty (SideT side)
void processSeeGlobalInfo (ObjectT o, Time time, VecPosition pos, VecPosition vel, AngDeg angBody, AngDeg angNeck)
bool processNewAgentInfo (ViewQualityT vq, ViewAngleT va, double dStamina, double dEffort, double dSpeed, AngDeg angSpeed, AngDeg angHeadAngle, int iTackleExpires, int iArmMovable, int iArmExpires, VecPosition posArm)
void processNewObjectInfo (ObjectT o, Time time, double dDist, int iDir, double dDistChange, double dDirChange, AngDeg angRelBodyAng, AngDeg angRelNeckAng, bool isGoalie, ObjectT objMin, ObjectT objMax, double dPointDir, bool isTackling)
bool processPerfectHearInfo (ObjectT o, VecPosition pos, double dConf, bool bIsGoalie=0)
bool processPerfectHearInfoBall (VecPosition pos, VecPosition vel, double dConf)
bool processUnsureHearInfo (ObjectT o, VecPosition pos, double dConf)
bool processNewHeteroPlayer (int iIndex, double dPlayerSpeedMax, double dStaminaIncMax, double dPlayerDecay, double dInertiaMoment, double dDashPowerRate, double dPlayerSize, double dKickableMargin, double dKickRand, double dExtraStamina, double dEffortMax, double dEffortMin)
void processCatchedBall (RefereeMessageT rm, Time time)
void processQueuedCommands (SoccerCommand commands[], int iCommands)
bool storePlayerMessage (int iPlayer, char *strMsg, int iCycle)
bool processPlayerMessage ()
bool processRecvThink (bool b)
bool updateAll ()
bool updateAfterSenseMessage ()
void mapUnknownPlayers (Time time)
bool updateSSToHeteroPlayerType (int iPlayerType)
bool resetTimeObjects ()
void removeGhosts ()
bool predictStateAfterCommand (SoccerCommand com, VecPosition *pos, VecPosition *vel, AngDeg *angGlobalBody, AngDeg *angGlobalNeck, ObjectT obj=OBJECT_ILLEGAL, Stamina *sta=NULL)
bool predictAgentStateAfterCommand (SoccerCommand com, VecPosition *pos, VecPosition *vel, AngDeg *angBody, AngDeg *angNeck, Stamina *sta)
bool predictObjectStateAfterCommand (ObjectT obj, SoccerCommand com, VecPosition *pos, VecPosition *vel, AngDeg *angBody, AngDeg *angNeck, Stamina *sta)
VecPosition predictAgentPosAfterCommand (SoccerCommand com)
void predictStateAfterDash (double dActualPower, VecPosition *pos, VecPosition *vel, Stamina *sta, double dDirection, ObjectT o=OBJECT_ILLEGAL)
void predictStateAfterTurn (AngDeg dSendAngle, VecPosition *pos, VecPosition *vel, AngDeg *angBody, AngDeg *angNeck, ObjectT obj=OBJECT_ILLEGAL, Stamina *sta=NULL)
void predictBallInfoAfterCommand (SoccerCommand soc, VecPosition *pos=NULL, VecPosition *vel=NULL)
VecPosition predictPosAfterNrCycles (ObjectT o, double dCycles, int iDashPower=100, VecPosition *posIn=NULL, VecPosition *velIn=NULL, bool bUpdate=true)
VecPosition predictAgentPos (int iCycles, int iDashPower=0)
VecPosition predictFinalAgentPos (VecPosition *pos=NULL, VecPosition *vel=NULL)
int predictNrCyclesForDistance (ObjectT o, double dDist, double dCurSpeed)
int predictNrCyclesToPoint (ObjectT o, VecPosition posTo)
int predictNrCyclesToObject (ObjectT objFrom, ObjectT objTo)
void predictStaminaAfterDash (double dPower, Stamina *sta)
SoccerCommand predictCommandTurnTowards (ObjectT obj, VecPosition posTo, int iCycles, double dDistBack, bool bMoveBack, VecPosition *pos=NULL, VecPosition *vel=NULL, AngDeg *angBody=NULL)
SoccerCommand predictCommandToMoveToPos (ObjectT obj, VecPosition posTo, int iCycles, double dDistBack=2.5, bool bMoveBack=false, VecPosition *pos=NULL, VecPosition *vel=NULL, AngDeg *angBody=NULL)
SoccerCommand predictCommandToInterceptBall (ObjectT obj, SoccerCommand soc, int *iCycles=NULL, VecPosition *posIntercept=NULL, VecPosition *pos=NULL, VecPosition *vel=NULL, AngDeg *angBody=NULL)
bool isCollisionAfterCommand (SoccerCommand soc)
int getNrInSetInRectangle (ObjectSetT objectSet, Rect *rect=NULL)
int getNrInSetInCircle (ObjectSetT objectSet, Circle c)
int getNrInSetInCone (ObjectSetT objectSet, double dWidth, VecPosition start, VecPosition end)
bool isEmptySpace (ObjectT obj, AngDeg ang, double dDist=4.0)
bool coordinateWith (ObjectT obj)
ObjectT getClosestInSetTo (ObjectSetT objectSet, ObjectT o, double *dDist=NULL, double dConfThr=-1.0)
ObjectT getClosestInSetTo (ObjectSetT objectSet, VecPosition pos, double *dDist=NULL, double dConfThr=-1.0)
ObjectT getClosestInSetTo (ObjectSetT objectSet, Line l, VecPosition pos1, VecPosition pos2, double *dDistToLine=NULL, double *dDistPos1To=NULL)
ObjectT getClosestRelativeInSet (ObjectSetT set, double *dDist=NULL)
ObjectT getSecondClosestInSetTo (ObjectSetT objectSet, ObjectT o, double *dDist=NULL, double dConfThr=-1.0)
ObjectT getSecondClosestRelativeInSet (ObjectSetT set, double *dDist=NULL)
void createInterceptFeatures ()
ObjectT getFastestInSetTo (ObjectSetT objectSet, ObjectT o, int *iCycles=NULL)
ObjectT getFastestInSetTo (ObjectSetT objectSet, VecPosition pos, VecPosition vel, double dDecay, int *iCycles=NULL)
ObjectT getFurthestInSetTo (ObjectSetT objectSet, ObjectT o, double *dDist=NULL, double dConfThr=-1.0)
ObjectT getFurthestRelativeInSet (ObjectSetT set, double *dDist=NULL)
VecPosition getPosClosestOpponentTo (double *dDist=NULL, ObjectT o=OBJECT_ILLEGAL)
double getMaxTraveledDistance (ObjectT o)
ObjectT getFirstEmptySpotInSet (ObjectSetT objectSet, int iUnknownPlayer=-1)
bool isVisible (ObjectT o)
bool isBallKickable ()
bool isBallCatchable ()
bool isBallHeadingToGoal ()
bool isBallInOurPossesion ()
bool isBallInOwnPenaltyArea ()
bool isInOwnPenaltyArea (VecPosition pos)
bool isInTheirPenaltyArea (VecPosition pos)
bool isConfidenceGood (ObjectT)
bool isConfidenceVeryGood (ObjectT)
bool isOnside (ObjectT)
bool isOpponentAtAngle (AngDeg ang, double dDist)
Time getTimeFromConfidence (double dConf)
double getOffsideX (bool bIncludeComm=true)
VecPosition getOuterPositionInField (VecPosition pos, AngDeg ang, double dDist=3.0, bool bWithPenalty=true)
AngDeg getDirectionOfWidestAngle (VecPosition posOrg, AngDeg angMin, AngDeg angMax, AngDeg *ang, double dDist)
bool isInField (VecPosition pos, double dMargin=1)
bool isBeforeGoal (VecPosition pos)
VecPosition getStrategicPosition (ObjectT obj, FormationT ft=FT_ILLEGAL)
VecPosition getStrategicPosition (int iPlayer=-1, FormationT ft=FT_ILLEGAL)
VecPosition getMarkingPosition (VecPosition pos, double dDist, MarkT mark)
int getClosestPlayerInFormationTo (VecPosition pos, bool bWithGoalie=1, ObjectT obj=OBJECT_ILLEGAL, PlayerSetT ps=PS_ALL, FormationT ft=FT_ILLEGAL)
double getActualKickPowerRate ()
double getKickPowerForSpeed (double dDesiredSpeed)
double getKickSpeedToTravel (double dDistance, double dEndSpeed)
double getFirstSpeedFromEndSpeed (double dEndSpeed, double dCycles, double dDecay=-1.0)
double getFirstSpeedFromDist (double dDist, double dCycles, double dDecay=-1.0)
double getEndSpeedFromFirstSpeed (double dFirstSpeed, double dCycles)
AngDeg getAngleForTurn (AngDeg angDesiredAngle, double dSpeed, ObjectT o=OBJECT_ILLEGAL)
AngDeg getActualTurnAngle (AngDeg angActualAngle, double dSpeed, ObjectT o=OBJECT_ILLEGAL)
double getPowerForDash (VecPosition posRelTo, AngDeg angBody, VecPosition vel, double dEffort, int iCycles=1)
 WorldModel (ServerSettings *ss, PlayerSettings *ps, Formations *fs)
 ~WorldModel ()
void show (ostream &os=cout)
void show (ObjectSetT set, ostream &os=cout)
void showQueuedCommands (ostream &os=cout)
void show (ObjectT o, ostream &os=cout)
bool waitForNewInformation ()
void logObjectInformation (int iLogLevel, ObjectT o)
void logDrawInfo (int iLogLevel)
void logCoordInfo (int iLogLevel)
bool logCircle (int iLogLevel, VecPosition pos, double dRadius, bool bAll=false)
bool logLine (int iLogLevel, VecPosition pos1, VecPosition pos2, bool bAll=false)
bool logDrawBallInfo (int iLogLevel)
void drawCoordinationGraph ()
bool isFeatureRelevant (FeatureT type)
Feature getFeature (FeatureT type)
bool setFeature (FeatureT type, Feature feature)

Public Attributes

bool m_bWasCollision
Time m_timeLastCollision
int iNrHoles
int iNrOpponentsSeen
int iNrTeammatesSeen
char strLastSeeMessage [MAX_MSG]
char strLastSenseMessage [MAX_MSG]
char strLastHearMessage [MAX_MSG]
char m_colorPlayers [11][8]
int m_iMultX
int m_iMultY

Private Methods

ObjectgetObjectPtrFromType (ObjectT o)
void processLastSeeMessage ()
bool updateAfterSeeMessage ()
bool updateAgentObjectAfterSee ()
bool updateDynamicObjectAfterSee (ObjectT o)
void processLastSenseMessage ()
bool updateAgentAndBallAfterSense ()
bool updateBallAfterKick (SoccerCommand soc)
bool updateDynamicObjectForNextCycle (ObjectT o, int iCycle)
bool updateBallForCollision (VecPosition posAgent)
bool updateRelativeFromGlobal ()
bool updateObjectRelativeFromGlobal (ObjectT o)
bool calculateStateAgent (VecPosition *posGlobal, VecPosition *velGlobal, AngDeg *angGlobal)
void initParticlesAgent (AngDeg angGlobal)
void initParticlesAgent (VecPosition posInitital)
int checkParticlesAgent (AngDeg angGlobalNeck)
void updateParticlesAgent (VecPosition vel, bool bAfterSense)
VecPosition averageParticles (VecPosition posArray[], int iLength)
void resampleParticlesAgent (int iLeft)
bool calculateStateAgent2 (VecPosition *posGlobal, VecPosition *velGlobal, AngDeg *angGlobal)
bool calculateStateAgent3 (VecPosition *posGlobal, VecPosition *velGlobal, AngDeg *angGlobal)
VecPosition calculatePosAgentWith2Flags (ObjectT objFlag1, ObjectT objFlag2)
AngDeg calculateAngleAgentWithPos (VecPosition pos)
bool calculateStateBall (VecPosition *posGlobal, VecPosition *velGlobal)
void initParticlesBall (VecPosition posArray[], VecPosition velArray[], int iLength)
void checkParticlesBall (VecPosition posArray[], VecPosition velArray[], int iLength, int *iNrLeft)
void updateParticlesBall (VecPosition posArray[], VecPosition velArray[], int iLength, double dPower, AngDeg ang)
void resampleParticlesBall (VecPosition posArray[], VecPosition velArray[], int iLength, int iLeft)
ObjectT getMaxRangeUnknownPlayer (ObjectT obj, char *strMsg)
VecPosition calculateVelocityDynamicObject (ObjectT o)
bool calculateStatePlayer (ObjectT o, VecPosition *posGlobal, VecPosition *velGlobal)
bool getMinMaxDistQuantizeValue (double dInput, double *dMin, double *dMax, double x1, double x2)
bool getMinMaxDirChange (double dOutput, double *dMin, double *dMax, double x1)
bool getMinMaxDistChange (double dOutput, double dDist, double *dMin, double *dMax, double x1, double xDist1, double xDist2)
double invQuantizeMin (double dOutput, double dQuantizeStep)
double invQuantizeMax (double dOutput, double dQuantizeStep)

Private Attributes

ServerSettingsSS
PlayerSettingsPS
HeteroPlayerSettings pt [MAX_HETERO_PLAYERS]
Formationsformations
Time timeLastSeeMessage
Time timeLastRecvSeeMessage
Time timeLastSenseMessage
Time timeLastRecvSenseMessage
Time timeLastHearMessage
bool bNewInfo
Time timeLastCatch
Time timeLastRefMessage
char strTeamName [MAX_TEAM_NAME_LENGTH]
int iPlayerNumber
SideT sideSide
PlayModeT playMode
int iGoalDiff
BallObject Ball
AgentObject agentObject
PlayerObject Teammates [MAX_TEAMMATES]
PlayerObject Opponents [MAX_OPPONENTS]
PlayerObject UnknownPlayers [MAX_TEAMMATES+MAX_OPPONENTS]
int iNrUnknownPlayers
FixedObject Flags [MAX_FLAGS]
FixedObject Lines [MAX_LINES]
VecPosition particlesPosAgent [iNrParticlesAgent]
VecPosition particlesPosBall [iNrParticlesBall]
VecPosition particlesVelBall [iNrParticlesBall]
double dTotalVarVel
double dTotalVarPos
SoccerCommand queuedCommands [CMD_MAX_COMMANDS]
bool performedCommands [CMD_MAX_COMMANDS]
int iCommandCounters [CMD_MAX_COMMANDS]
Time timeCheckBall
BallStatusT bsCheckBall
pthread_mutex_t mutex_newInfo
pthread_cond_t cond_newInfo
bool m_bRecvThink
char m_strPlayerMsg [MAX_MSG]
int m_iCycleInMsg
Time m_timePlayerMsg
int m_iMessageSender
char m_strCommunicate [MAX_SAY_MSG]
ObjectT m_objFocus
double m_dCommOffsideX
Time m_timeCommOffsideX
Feature m_features [MAX_FEATURES]
bool m_bPerformedKick
set< ObjectTm_setSubstitutedOpp
SoccerCommand m_changeViewCommand
SideT m_sidePenalty

Static Private Attributes

const int iNrParticlesAgent = 100
const int iNrParticlesBall = 100

Detailed Description

The Class WorlModel contains all the RoboCup information that is available on the field. It contains information about the players, ball, flags and lines. Furthermore it contains methods to extract useful information. The (large amount of) attributes can be separated into different groups: The methods can also be divided into different groups:

Definition at line 111 of file WorldModel.h.


Constructor & Destructor Documentation

WorldModel::WorldModel ServerSettings   ss,
PlayerSettings   ps,
Formations   fs
 

This constructor creates the worldmodel, all variables are initialized by default values

Parameters:
ss  reference to class in which all server parameters are stored
ps  reference to class in which all client parameters are stored
fs  reference to class in which all formation information is stored

Definition at line 70 of file WorldModel.cpp.

References agentObject, Ball, bNewInfo, BS_ILLEGAL, bsCheckBall, CMD_MAX_COMMANDS, SoccerCommand::commandType, cond_newInfo, dTotalVarPos, dTotalVarVel, Flags, formations, SoccerTypes::getOpponentObjectFromIndex(), ServerSettings::getStaminaMax(), SoccerTypes::getTeammateObjectFromIndex(), iCommandCounters, iGoalDiff, iNrHoles, iNrOpponentsSeen, iNrTeammatesSeen, iNrUnknownPlayers, Lines, m_bRecvThink, m_colorPlayers, m_features, m_sidePenalty, MAX_FEATURES, MAX_FLAGS, MAX_LINES, MAX_OPPONENTS, MAX_TEAMMATES, mutex_newInfo, OBJECT_BALL, OBJECT_ILLEGAL, Opponents, performedCommands, PM_BEFORE_KICK_OFF, PS, queuedCommands, setPlayMode(), setSide(), AgentObject::setStamina(), Feature::setTimeSee(), Feature::setTimeSense(), Object::setType(), SIDE_ILLEGAL, SS, strTeamName, Teammates, timeLastSenseMessage, UnknownPlayers, and UnknownTime.

WorldModel::~WorldModel  
 

Destructor

Definition at line 147 of file WorldModel.cpp.

References mutex_newInfo.


Member Function Documentation

int WorldModel::addOneToGoalDiff  
 

This method adds one goal to the goal difference. Call this method when your team has scored a goal

Returns:
new goal difference

Definition at line 469 of file WorldModel.cpp.

References iGoalDiff.

Referenced by SenseHandler::analyzeHearMessage().

VecPosition WorldModel::averageParticles VecPosition    posArray[],
int    iLength
[private]
 

This method returns the average of the particles contained in 'posArray'.

Parameters:
posArray  containing all possible global positions of the agent
iLength  number of particles in posArray
Returns:
average position of all the particles

Definition at line 1816 of file WorldModelUpdate.cpp.

References VecPosition::getX(), VecPosition::getY(), and UnknownDoubleValue.

Referenced by calculateStateAgent().

AngDeg WorldModel::calculateAngleAgentWithPos VecPosition    pos [private]
 

This method calculates the global neck angle of the agent using all available flag information and the estimation of the current global position of the agent 'pos'. For each perceived flag, the global direction is calculated using the known global position of the flag and the specified global position 'pos' of the agent. Then the global neck direction of the agent is determined using the relative direction to this flag. The average neck angle of all perceived flags is returned.

Parameters:
pos  current global position of the agent
Returns:
global neck angle of the agent

Definition at line 2048 of file WorldModelUpdate.cpp.

References AngDeg, atan2Deg(), cosDeg(), getGlobalPosition(), getRelativeAngle(), VecPosition::getX(), VecPosition::getY(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), VecPosition::normalizeAngle(), OBJECT_ILLEGAL, OBJECT_SET_FLAGS, ObjectT, sinDeg(), and UnknownAngleValue.

Referenced by calculateStateAgent(), and calculateStateAgent2().

VecPosition WorldModel::calculatePosAgentWith2Flags ObjectT    objFlag1,
ObjectT    objFlag2
[private]
 

This method calculates the global position of the agent using two flags. Using the perceived distance to the two flag, two circles are created with as center the global position of the flag. The intersection of these two circles is returned as the global position of the agent (note that the relative direction to both flags can be used to determine which of the two possible intersection points is the correct position). It is assumed that the relative information of the specified flags are from the last see message.

Parameters:
objFlag1  object type of first flag
objFlag2  object type of second flag
Returns:
global position of the agent

Definition at line 1993 of file WorldModelUpdate.cpp.

References AngDeg, getGlobalPosition(), getRelativeAngle(), getRelativeDistance(), VecPosition::getX(), VecPosition::getY(), and ObjectT.

Referenced by calculateStateAgent2(), and calculateStateAgent3().

bool WorldModel::calculateStateAgent VecPosition   posGlobal,
VecPosition   velGlobal,
AngDeg   angGlobal
[private]
 

This method calculates the different state information of the agent, that is the global position, global velocity and global neck angle using the available information in the world model. This method uses a particle filter to determine this information.

Parameters:
posGlobal  will be filled with global position of the agent
velGlobal  will be filled with global velocity of the agent
angGlobal  will be filled with global neck angle of the agent
Returns:
global position of the agent

Definition at line 1613 of file WorldModelUpdate.cpp.

References agentObject, AngDeg, averageParticles(), calculateAngleAgentWithPos(), calculateStateAgent2(), checkParticlesAgent(), getAgentGlobalNeckAngle(), getFurthestRelativeInSet(), getGlobalAngle(), VecPosition::getMagnitude(), ServerSettings::getPlayerDecay(), getRelativeAngle(), AgentObject::getSpeedRelToNeck(), initParticlesAgent(), VecPosition::normalizeAngle(), OBJECT_ILLEGAL, OBJECT_SET_LINES, ObjectT, particlesPosAgent, resampleParticlesAgent(), VecPosition::rotate(), VecPosition::setMagnitude(), SS, UnknownAngleValue, and updateParticlesAgent().

Referenced by updateAgentObjectAfterSee().

bool WorldModel::calculateStateAgent2 VecPosition   posGlobal,
VecPosition   velGlobal,
AngDeg   angGlobal
[private]
 

This method calculates the different state information of the agent, that is the global position, global velocity and global neck angle using the available information in the world model. This method uses a weighted average of all currently perceived flags.

Parameters:
posGlobal  will be filled with global position of the agent
velGlobal  will be filled with global velocity of the agent
angGlobal  will be filled with global neck angle of the agent
Returns:
global position of the agent

Definition at line 1852 of file WorldModelUpdate.cpp.

References agentObject, AngDeg, calculateAngleAgentWithPos(), calculatePosAgentWith2Flags(), getMinMaxDistQuantizeValue(), ServerSettings::getQuantizeStepL(), getRelativeDistance(), AgentObject::getSpeedRelToNeck(), VecPosition::getX(), VecPosition::getY(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, OBJECT_SET_FLAGS, ObjectT, VecPosition::rotate(), VecPosition::setVecPosition(), SS, and UnknownDoubleValue.

Referenced by calculateStateAgent().

bool WorldModel::calculateStateAgent3 VecPosition   posGlobal,
VecPosition   velGlobal,
AngDeg   angGlobal
[private]
 

This method calculates the different state information of the agent, that is the global position, global velocity and global neck angle using the available information in the world model. Only the closest two global flags are taken into account.

Parameters:
posGlobal  will be filled with global position of the agent
velGlobal  will be filled with global velocity of the agent
angGlobal  will be filled with global neck angle of the agent
Returns:
global position of the agent

Definition at line 1927 of file WorldModelUpdate.cpp.

References agentObject, AngDeg, calculatePosAgentWith2Flags(), getClosestRelativeInSet(), getCurrentCycle(), getFurthestRelativeInSet(), getGlobalAngle(), getGlobalPosition(), getRelativeAngle(), getRelativeDistance(), getSecondClosestRelativeInSet(), AgentObject::getSpeedRelToNeck(), VecPosition::getVecPositionFromPolar(), VecPosition::normalizeAngle(), OBJECT_ILLEGAL, OBJECT_SET_FLAGS, OBJECT_SET_LINES, ObjectT, and VecPosition::rotate().

bool WorldModel::calculateStateBall VecPosition   posGlobal,
VecPosition   velGlobal
[private]
 

This method calculates the global position and velocity of the ball using the newest visual information.

Parameters:
posGlobal  will be filled with the global position
velGlobal  will be filled with the global velocity
Returns:
true when calculations were succesful, false otherwise

Definition at line 2115 of file WorldModelUpdate.cpp.

References agentObject, Ball, calculateVelocityDynamicObject(), getAgentGlobalNeckAngle(), getAgentGlobalPosition(), ServerSettings::getBallDecay(), ServerSettings::getBallRand(), getBallSpeed(), ServerSettings::getBallSpeedMax(), getClosestInSetTo(), getCurrentTime(), getGlobalPosition(), Object::getGlobalPositionLastSee(), getGlobalVelocity(), VecPosition::getMagnitude(), ServerSettings::getMaximalKickDist(), getNrInSetInCircle(), getPlayMode(), AgentObject::getPositionDifference(), getRelativeAngle(), getRelativeDistance(), DynamicObject::getTimeChangeInformation(), Object::getTimeGlobalPosDerivedFromSee(), getTimeLastSeeMessage(), getTimeLastSeen(), getTimeSinceLastCatch(), ServerSettings::getVisibleDistance(), VecPosition::getX(), VecPosition::getY(), isBackPassThem(), isBackPassUs(), isBeforeKickOff(), isGoalKickThem(), isGoalKickUs(), isKickInThem(), isKickInUs(), isPenaltyThem(), isPenaltyUs(), m_bPerformedKick, m_bWasCollision, m_timeLastCollision, OBJECT_BALL, OBJECT_SET_OPPONENTS, OBJECT_SET_PLAYERS, PENALTY_AREA_WIDTH, PENALTY_X, PITCH_WIDTH, PM_PLAY_ON, POLAR, VecPosition::setMagnitude(), VecPosition::setVecPosition(), VecPosition::setY(), sign(), and SS.

Referenced by updateDynamicObjectAfterSee().

bool WorldModel::calculateStatePlayer ObjectT    o,
VecPosition   posGlobal,
VecPosition   velGlobal
[private]
 

This method determines the current state of a player and is called after a see message has arrived.

Parameters:
o  object type of the player
posGlobal  will be filled with global position of the player
velGlobal  will be filled with global velocity of the player
Returns:
bool indicating whether calculations succeeded.

Definition at line 2274 of file WorldModelUpdate.cpp.

References agentObject, calculateVelocityDynamicObject(), getAgentGlobalPosition(), PlayerObject::getGlobalNeckAngle(), getGlobalVelocity(), VecPosition::getMagnitude(), getObjectPtrFromType(), ServerSettings::getPlayerRand(), ServerSettings::getPlayerSpeedMax(), getRelativeAngle(), getRelativeDistance(), DynamicObject::getTimeChangeInformation(), getTimeLastSeen(), ObjectT, POLAR, VecPosition::setMagnitude(), and SS.

Referenced by updateDynamicObjectAfterSee().

VecPosition WorldModel::calculateVelocityDynamicObject ObjectT    o [private]
 

This method returns the velocity from the object o given the perceptions from the see message. It uses the soccer server formula directly (thus assuming no noise).

Parameters:
o  object type for which velocity is determined
Returns:
global velocity of the ball

Definition at line 2091 of file WorldModelUpdate.cpp.

References cosDeg(), Deg2Rad(), getAgentGlobalNeckAngle(), getAgentGlobalVelocity(), getObjectPtrFromType(), getRelativeAngle(), DynamicObject::getRelativeAngleChange(), getRelativeDistance(), DynamicObject::getRelativeDistanceChange(), ObjectT, VecPosition::relativeToGlobal(), sinDeg(), and UnknownDoubleValue.

Referenced by calculateStateBall(), and calculateStatePlayer().

int WorldModel::checkParticlesAgent AngDeg    angGlobalNeck [private]
 

This method checks all the particles that represent the global position of the agent using the flags in the last perceived see message. The global neck angle of the agent is used to make the perceived information global. Particles that are not possible are deleted and all legal particles will be shifted to the beginning of the array. The number of legal particles is returned.

Parameters:
angGlobalNeck  global neck of the angle
Returns:
number of legal particles

Definition at line 1744 of file WorldModelUpdate.cpp.

References AngDeg, VecPosition::getDistanceTo(), getGlobalPosition(), getMinMaxDistQuantizeValue(), ServerSettings::getQuantizeStepL(), getRelativeAngle(), getRelativeDistance(), iNrParticlesAgent, iterateObjectNext(), iterateObjectStart(), VecPosition::normalizeAngle(), OBJECT_ILLEGAL, OBJECT_SET_FLAGS, ObjectT, particlesPosAgent, and SS.

Referenced by calculateStateAgent().

void WorldModel::checkParticlesBall VecPosition    posArray[],
VecPosition    velArray[],
int    iLength,
int *    iNrParticlesLeft
[private]
 

This method checks all particles that represent the global position and global velocity of the ball. This is done by using the last perceived information. Using the possible ranges from which these values coule originate from, it can be checked which particles are legal. These particles are moved to the beginning of the array. Afterwards the number of legal particles is stored in 'iNrParticlesLeft'.

Parameters:
posArray  array that contains the position particles
velArray  array that contains the velocity particles
iLength  number of particles that have to be checked.
iNrParticlesLeft  will contain the number of legal particles

Definition at line 2879 of file WorldModelUpdate.cpp.

References AngDeg, Ball, getAgentGlobalNeckAngle(), getAgentGlobalPosition(), getAgentGlobalVelocity(), VecPosition::getDirection(), VecPosition::getMagnitude(), getMinMaxDirChange(), getMinMaxDistChange(), getMinMaxDistQuantizeValue(), getRelativeAngle(), DynamicObject::getRelativeAngleChange(), getRelativeDistance(), DynamicObject::getRelativeDistanceChange(), DynamicObject::getTimeChangeInformation(), getTimeLastSeeMessage(), getTimeLastSeen(), VecPosition::getX(), VecPosition::getY(), VecPosition::globalToRelative(), VecPosition::normalizeAngle(), OBJECT_BALL, Rad2Deg(), and UnknownDoubleValue.

bool WorldModel::coordinateWith ObjectT    obj
 

Definition at line 160 of file WorldModelHighLevel.cpp.

References getAgentObjectType(), getBallPos(), VecPosition::getDistanceTo(), getFastestInSetTo(), getGlobalPosition(), VecPosition::getX(), VecPosition::getY(), logCircle(), OBJECT_BALL, OBJECT_SET_TEAMMATES, and ObjectT.

void WorldModel::createInterceptFeatures  
 

Definition at line 523 of file WorldModelHighLevel.cpp.

References FEATURE_FASTEST_OPPONENT_TO_BALL, FEATURE_FASTEST_PLAYER_TO_BALL, FEATURE_FASTEST_TEAMMATE_TO_BALL, FEATURE_FASTEST_TEAMMATE_TO_BALL_NO_GOALIE, FEATURE_ILLEGAL, FEATURE_INTERCEPT_CYCLES_ME, FeatureT, getAgentObjectType(), VecPosition::getDistanceTo(), getFastestInSetTo(), getGlobalPosition(), getOwnGoalieType(), getPlayerNumber(), ServerSettings::getPlayerSpeedMax(), PlayerSettings::getPlayerWhenToIntercept(), getTimeLastHearMessage(), getTimeLastSeeMessage(), getTimeLastSenseMessage(), SoccerTypes::isOpponent(), SoccerTypes::isTeammate(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), min(), OBJECT_BALL, OBJECT_ILLEGAL, OBJECT_SET_OPPONENTS, OBJECT_SET_PLAYERS, OBJECT_SET_TEAMMATES, OBJECT_SET_TEAMMATES_NO_GOALIE, ObjectSetT, ObjectT, predictNrCyclesToPoint(), predictPosAfterNrCycles(), PS, setFeature(), and SS.

Referenced by getFastestInSetTo(), and predictNrCyclesToObject().

void WorldModel::drawCoordinationGraph  
 

This method draws a coordination graph between the relevant players and logs this information.

Definition at line 2530 of file WorldModel.cpp.

References getAgentGlobalPosition(), getAgentObjectType(), getCurrentCycle(), getCurrentTime(), VecPosition::getDistanceTo(), getFastestInSetTo(), getGlobalPosition(), SoccerTypes::getIndex(), SoccerTypes::getObjectStr(), getPlayerNumber(), getRelativeDistance(), getTeamName(), VecPosition::getX(), VecPosition::getY(), Time::isStopped(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), logLine(), OBJECT_BALL, OBJECT_ILLEGAL, OBJECT_SET_TEAMMATES, ObjectSetT, and ObjectT.

Referenced by updateAll().

double WorldModel::getActualKickPowerRate  
 

The actual power with which the ball is kicked depends on the relative location of the ball to the player. The kick is more powerful when the ball is very close to and in front of the player. The actual kickpowerrate with which the power of the kick command is multiplied is equal to
KickPowerRate*(1 - 0.25*DirDiff / 180 - 0.25*(DistBall-PlayerSize-BallSize)/KickableMargin)
with DirDiff = global angle of the ball rel to the body dir agent
DistBall = the distance from the center of the player to the ball
See soccermanual

Returns:
the actual kick power rate with which power is multiplied

Definition at line 1655 of file WorldModelHighLevel.cpp.

References ServerSettings::getBallSize(), ServerSettings::getKickableMargin(), ServerSettings::getKickPowerRate(), ServerSettings::getPlayerSize(), getRelativeAngle(), getRelativeDistance(), OBJECT_BALL, and SS.

Referenced by BasicPlayer::accelerateBallToVelocity(), getKickPowerForSpeed(), BasicPlayer::kickTo(), predictBallInfoAfterCommand(), and updateParticlesBall().

AngDeg WorldModel::getActualTurnAngle AngDeg    angTurn,
double    dSpeed,
ObjectT    o = OBJECT_ILLEGAL
 

This method determines the actual angle that is used when 'angTurn' is sent to the SoccerServer. This value depends on the current velocity and the inertia moment of the player

Parameters:
angAngleForSend  angle send with turn command
dSpeed  current speed of the player
Returns:
actual angle that player is turned

Definition at line 1785 of file WorldModelHighLevel.cpp.

References AngDeg, getInertiaMoment(), and ObjectT.

Referenced by predictStateAfterTurn().

int WorldModel::getAgentArmExpires  
 

This method returns how many cycles it will last before the arm of the agent stops pointing.

Definition at line 850 of file WorldModel.cpp.

References agentObject, and AgentObject::getArmExpires().

bool WorldModel::getAgentArmMovable  
 

This method returns whether the arm of the agent can be moved.

Definition at line 836 of file WorldModel.cpp.

References agentObject, and AgentObject::getArmMovable().

VecPosition WorldModel::getAgentArmPosition  
 

This method returns the current position the arm of the agent is pointing towards.

Definition at line 843 of file WorldModel.cpp.

References agentObject, and AgentObject::getGlobalArmPosition().

AngDeg WorldModel::getAgentBodyAngleRelToNeck   const
 

This method returns the body angle relative to the neck of the agent.

Returns:
AngDeg representing the body angle relative to the neck

Definition at line 706 of file WorldModel.cpp.

References agentObject, AngDeg, and AgentObject::getBodyAngleRelToNeck().

Referenced by BasicPlayer::alignNeckWithBody(), and getRelativeAngle().

double WorldModel::getAgentEffort   const
 

This method returns the effort information of the agent

Returns:
double effort of the agent

Definition at line 743 of file WorldModel.cpp.

References agentObject, Stamina::getEffort(), and AgentObject::getStamina().

Referenced by BasicPlayer::dashToPoint(), and predictCommandToMoveToPos().

AngDeg WorldModel::getAgentGlobalBodyAngle  
 

This method returns the global body angle of the agent in the world.

Returns:
global body angle agent

Definition at line 720 of file WorldModel.cpp.

References agentObject, AngDeg, and PlayerObject::getGlobalBodyAngle().

Referenced by BasicPlayer::accelerateBallToVelocity(), BasicPlayer::dashToPoint(), BasicPlayer::defendGoalLine(), Player::deMeer5_goalie(), BasicPlayer::directTowards(), BasicPlayer::dribble(), BasicPlayer::freezeBall(), BasicPlayer::getActiveInterceptionPointBall(), BasicPlayer::getDribblePoint(), BasicPlayer::getInterceptionPointBall(), BasicPlayer::holdBall(), BasicPlayer::interceptClose(), BasicPlayer::interceptCloseGoalie(), BasicPlayer::interceptScoringAttempt(), BasicPlayer::kickBallCloseToBody(), BasicPlayer::kickTo(), BasicPlayer::moveToPos(), BasicPlayer::moveToPosAlongLine(), BasicPlayer::outplayOpponent(), Player::performPenalty(), predictAgentStateAfterCommand(), predictBallInfoAfterCommand(), predictNrCyclesToPoint(), predictPosAfterNrCycles(), BasicPlayer::searchBall(), BasicPlayer::turnBackToPoint(), BasicPlayer::turnBodyToPoint(), BasicPlayer::turnWithBallTo(), updateAgentAndBallAfterSense(), and updateParticlesBall().

AngDeg WorldModel::getAgentGlobalNeckAngle   const
 

This method returns the global neck angle of the agent in the world.

Returns:
global neck angle agent

Definition at line 713 of file WorldModel.cpp.

References agentObject, AngDeg, and PlayerObject::getGlobalNeckAngle().

Referenced by calculateStateAgent(), calculateStateBall(), calculateVelocityDynamicObject(), checkParticlesBall(), Player::executeStringCommand(), BasicPlayer::getActiveInterceptionPointBall(), BasicPlayer::getInterceptionPointBall(), initParticlesBall(), BasicPlayer::kickTo(), mapUnknownPlayers(), predictAgentStateAfterCommand(), removeGhosts(), updateAgentAndBallAfterSense(), updateDynamicObjectAfterSee(), and updateObjectRelativeFromGlobal().

VecPosition WorldModel::getAgentGlobalPosition   const
 

This method returns the global position of the agent

Returns:
global position of the agent

Definition at line 764 of file WorldModel.cpp.

References agentObject, and Object::getGlobalPosition().

Referenced by calculateStateBall(), calculateStatePlayer(), checkParticlesBall(), BasicPlayer::collideWithBall(), BasicPlayer::dashToPoint(), BasicPlayer::defendGoalLine(), Player::deMeer5(), Player::deMeer5_goalie(), BasicPlayer::directTowards(), drawCoordinationGraph(), BasicPlayer::dribble(), Player::executeStringCommand(), BasicPlayer::getActiveInterceptionPointBall(), Player::getDeadBallPosition(), BasicPlayer::getDribblePoint(), BasicPlayer::getInterceptionPointBall(), getMarkingPosition(), getRelAngleOpponentGoal(), getRelDistanceOpponentGoal(), BasicPlayer::holdBall(), initParticlesBall(), BasicPlayer::intercept(), BasicPlayer::interceptClose(), BasicPlayer::interceptScoringAttempt(), isOpponentAtAngle(), BasicPlayer::kickTo(), mapUnknownPlayers(), BasicPlayer::mark(), BasicPlayer::moveToPos(), BasicPlayer::moveToPosAlongLine(), BasicPlayer::outplayOpponent(), Player::performPenalty(), predictAgentStateAfterCommand(), predictFinalAgentPos(), predictNrCyclesToPoint(), processNewAgentInfo(), processUnsureHearInfo(), removeGhosts(), BasicPlayer::searchBall(), BasicPlayer::turnWithBallTo(), updateAgentAndBallAfterSense(), and updateObjectRelativeFromGlobal().

VecPosition WorldModel::getAgentGlobalVelocity   const
 

This method returns the global velocity information of the agent

Returns:
global velocity of the agent

Definition at line 750 of file WorldModel.cpp.

References agentObject, and DynamicObject::getGlobalVelocity().

Referenced by calculateVelocityDynamicObject(), checkParticlesBall(), BasicPlayer::dashToPoint(), BasicPlayer::directTowards(), BasicPlayer::getActiveInterceptionPointBall(), BasicPlayer::getInterceptionPointBall(), initParticlesBall(), BasicPlayer::interceptClose(), BasicPlayer::interceptCloseGoalie(), predictAgentStateAfterCommand(), predictFinalAgentPos(), predictNrCyclesToPoint(), and updateAgentAndBallAfterSense().

int WorldModel::getAgentIndex   const
 

Definition at line 689 of file WorldModel.cpp.

References getAgentObjectType(), and SoccerTypes::getIndex().

Referenced by logCircle(), and logLine().

ObjectT WorldModel::getAgentObjectType   const
 

This method returns the ObjectType of the agent. This is an ObjectT between OBJECT_TEAMMATE_1 and OBJECT_TEAMMATE_11

Returns:
ObjectT that represent the type of the agent

Definition at line 684 of file WorldModel.cpp.

References agentObject, Object::getType(), and ObjectT.

Referenced by Player::amIAgentToSaySomething(), SenseHandler::analyzeFullStateMessage(), coordinateWith(), createInterceptFeatures(), Player::deMeer5(), Player::deMeer5_goalie(), drawCoordinationGraph(), Player::executeStringCommand(), BasicPlayer::getActiveInterceptionPointBall(), getAgentIndex(), Player::getDeadBallPosition(), getFirstEmptySpotInSet(), getHeteroInfoPlayer(), BasicPlayer::getInterceptionPointBall(), getMaxRangeUnknownPlayer(), getPlayerType(), getPosClosestOpponentTo(), getProbTackleSucceeds(), getTackleExpires(), BasicPlayer::intercept(), BasicPlayer::interceptClose(), BasicPlayer::interceptCloseGoalie(), isConfidenceGood(), isConfidenceVeryGood(), logCoordInfo(), mapUnknownPlayers(), predictAgentPos(), predictAgentStateAfterCommand(), predictCommandToInterceptBall(), predictNrCyclesToObject(), predictNrCyclesToPoint(), predictObjectStateAfterCommand(), predictPosAfterNrCycles(), processLastSeeMessage(), processNewObjectInfo(), processPerfectHearInfo(), processUnsureHearInfo(), setHeteroPlayerType(), BasicPlayer::turnBackToPoint(), BasicPlayer::turnBodyToPoint(), BasicPlayer::turnWithBallTo(), updateAfterSeeMessage(), updateAfterSenseMessage(), updateAgentAndBallAfterSense(), updateAll(), and updateRelativeFromGlobal().

double WorldModel::getAgentSpeed   const
 

This method returns the speed of the agent

Returns:
speed of the agent

Definition at line 757 of file WorldModel.cpp.

References agentObject, and DynamicObject::getSpeed().

Referenced by BasicPlayer::getActiveInterceptionPointBall(), BasicPlayer::getInterceptionPointBall(), BasicPlayer::turnBackToPoint(), and BasicPlayer::turnBodyToPoint().

Stamina WorldModel::getAgentStamina   const
 

This method returns the stamina information of the agent

Returns:
Stamina stamina of the agent

Definition at line 727 of file WorldModel.cpp.

References agentObject, and AgentObject::getStamina().

Referenced by Player::deMeer5(), BasicPlayer::getActiveInterceptionPointBall(), getAgentTiredNess(), BasicPlayer::getInterceptionPointBall(), BasicPlayer::interceptClose(), BasicPlayer::interceptCloseGoalie(), Player::performPenalty(), predictAgentStateAfterCommand(), predictCommandToInterceptBall(), predictPosAfterNrCycles(), and updateAgentAndBallAfterSense().

TiredNessT WorldModel::getAgentTiredNess   const
 

This method returns a TiredNessT value that indicates how tired the agent is.

Returns:
TiredNessT value that indicates how tired the agent is.

Definition at line 735 of file WorldModel.cpp.

References getAgentStamina(), ServerSettings::getRecoverDecThr(), ServerSettings::getStaminaMax(), Stamina::getTiredNess(), SS, and TiredNessT.

ViewAngleT WorldModel::getAgentViewAngle   const
 

This method returns the view angle of the agent.

Returns:
ViewAngleT view angle of the agent (VA_NARROW, VA_NORMAL, VA_WIDE)

Definition at line 782 of file WorldModel.cpp.

References agentObject, AgentObject::getViewAngle(), and ViewAngleT.

Referenced by getAgentViewFrequency(), and Player::performPenalty().

double WorldModel::getAgentViewFrequency ViewAngleT    va = VA_ILLEGAL,
ViewQualityT    vq = VQ_ILLEGAL
 

This method returns the view frequency of see messages for the agent relative to the time of the sense_body interval. So 0.5 means a see message arrives twice in every simulation cycle.

Returns:
double representing the view frequency

Definition at line 805 of file WorldModel.cpp.

References getAgentViewAngle(), getAgentViewQuality(), VA_ILLEGAL, VA_NARROW, VA_NORMAL, VA_WIDE, ViewAngleT, ViewQualityT, VQ_HIGH, VQ_ILLEGAL, and VQ_LOW.

Referenced by SenseHandler::analyzeSeeMessage(), and SenseHandler::setTimeSignal().

ViewQualityT WorldModel::getAgentViewQuality   const
 

This method returns the view quality of the agent

Returns:
ViewQualityT of the agent (VA_LOW, VA_HIGH).

Definition at line 796 of file WorldModel.cpp.

References agentObject, AgentObject::getViewQuality(), and ViewQualityT.

Referenced by getAgentViewFrequency().

AngDeg WorldModel::getAngleForTurn AngDeg    angDesiredAngle,
double    dSpeed,
ObjectT    obj = OBJECT_ILLEGAL
 

This method determines the angle that should be sent to the soccerserver when the player wants to turn angDesiredAngle. This value depends on the current velocity and the inertia moment of the player

Parameters:
angDesiredAngle  angle that player wants to turn
dSpeed  current speed of the player
Returns:
angle that can be sent with turn command

Definition at line 1767 of file WorldModelHighLevel.cpp.

References AngDeg, getInertiaMoment(), ServerSettings::getMaxMoment(), ServerSettings::getMinMoment(), ObjectT, and SS.

Referenced by BasicPlayer::directTowards(), BasicPlayer::getActiveInterceptionPointBall(), BasicPlayer::getInterceptionPointBall(), BasicPlayer::interceptClose(), predictCommandTurnTowards(), BasicPlayer::turnBackToPoint(), and BasicPlayer::turnBodyToPoint().

AngDeg WorldModel::getBallDirection  
 

This method returns the global direction of the ball velocity.

Returns:
global direction of the ball velocity

Definition at line 873 of file WorldModel.cpp.

References AngDeg, Ball, VecPosition::getDirection(), and DynamicObject::getGlobalVelocity().

Referenced by BasicPlayer::freezeBall(), BasicPlayer::interceptScoringAttempt(), and isBallHeadingToGoal().

VecPosition WorldModel::getBallPos  
 

This method returns the global position of the ball. The method getConfidence with as argument OBJECT_BALL should be called to check the confidence of this global position.

Returns:
global position bal.

Definition at line 859 of file WorldModel.cpp.

References getGlobalPosition(), and OBJECT_BALL.

Referenced by Player::amIAgentToSaySomething(), BasicPlayer::clearBall(), coordinateWith(), BasicPlayer::defendGoalLine(), Player::deMeer5(), Player::deMeer5_goalie(), BasicPlayer::freezeBall(), getClosestPlayerInFormationTo(), Player::getDeadBallPosition(), BasicPlayer::getEndSpeedForPass(), getMarkingPosition(), getOffsideX(), getProbTackleSucceeds(), BasicPlayer::getShootPositionOnLine(), getStrategicPosition(), BasicPlayer::holdBall(), BasicPlayer::interceptScoringAttempt(), isBallCatchable(), isBallHeadingToGoal(), isBallInOwnPenaltyArea(), BasicPlayer::kickBallCloseToBody(), BasicPlayer::kickTo(), logDrawBallInfo(), Player::mainLoop(), BasicPlayer::moveToPosAlongLine(), predictNrCyclesToObject(), BasicPlayer::searchBall(), BasicPlayer::turnWithBallTo(), updateAgentAndBallAfterSense(), and updateDynamicObjectForNextCycle().

double WorldModel::getBallSpeed  
 

This method returns the current estimate of the speed of the ball.

Returns:
speed of the ball (magnitude of the global velocity vector).

Definition at line 866 of file WorldModel.cpp.

References Ball, DynamicObject::getGlobalVelocity(), and VecPosition::getMagnitude().

Referenced by calculateStateBall(), BasicPlayer::collideWithBall(), BasicPlayer::freezeBall(), isCollisionAfterCommand(), BasicPlayer::kickBallCloseToBody(), predictNrCyclesToObject(), and BasicPlayer::turnWithBallTo().

SoccerCommand WorldModel::getChangeViewCommand  
 

Definition at line 1736 of file WorldModel.cpp.

References m_changeViewCommand.

Referenced by updateAll().

BallStatusT WorldModel::getCheckBallStatus   const
 

This method returns the status of the ball. This value is derived from the check_ball command that can only be used by the coach. The status of the ball corresponds to the server time returned by getTimeCheckBall.

Returns:
BallStatus status of the ball.

Definition at line 532 of file WorldModel.cpp.

References BallStatusT, and bsCheckBall.

ObjectT WorldModel::getClosestInSetTo ObjectSetT    set,
Line    l,
VecPosition    pos1,
VecPosition    pos2,
double *    dDistObjToLine = NULL,
double *    dDistPos1ToPoint = NULL
 

This method returns the closest object in 'set' to the line 'l'. The projection p of the global position of this object on the line 'l' should lie between pos1 and pos2. After the method is finished, it returns this object and the last two arguments of this method are set to the the distance between the object and p and the distance from pos1 to p respectively.

Parameters:
set  ObjectSetT which denotes objects taken into consideration
l  line to which opponents should be projected
pos1  minimum allowed projection point
pos2  maximum allowed projection point
dDistObjToLine  will contain distance from opponent to line l
dDistPos1ToPoint  will contain distance from pos1 to projection point opponent on line l
Returns:
object type of closest object to line l

Definition at line 281 of file WorldModelHighLevel.cpp.

References VecPosition::getDistanceTo(), getGlobalPosition(), PlayerSettings::getPlayerConfThr(), Line::getPointOnLineClosestTo(), Line::isInBetween(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, ObjectSetT, ObjectT, and PS.

ObjectT WorldModel::getClosestInSetTo ObjectSetT    set,
VecPosition    pos,
double *    dDist = NULL,
double    dConfThr = -1.0
 

This method returns the ojbect type of the closest object to the specified position and that is part of the object set 'set' with a confidence higher than the supplied threshold. If no threshold is supplied, the threshold defined in PlayerSettings is used.

Parameters:
set  ObjectSetT which denotes objects taken into consideration
pos  position to which player should be compared
dDist  will be filled with the distance between pos and closest object
dConfThr  minimum confidence threshold for the objects in 'set'
Returns:
ObjectT representing object that is closest to pos

Definition at line 240 of file WorldModelHighLevel.cpp.

References getGlobalPosition(), VecPosition::getMagnitude(), PlayerSettings::getPlayerConfThr(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, ObjectSetT, ObjectT, and PS.

ObjectT WorldModel::getClosestInSetTo ObjectSetT    set,
ObjectT    objTarget,
double *    dDist = NULL,
double    dConfThr = -1.0
 

This method returns the object type of the closest object to the ObjectT that is supplied as the second argument. Only objects are taken into account that are part of the set 'set' and have a confidence higher than the supplied threshold. If no threshold is supplied, the threshold defined in PlayerSettings is used.

Parameters:
set  ObjectSetT which denotes objects taken into consideration
objTarget  ObjectT that represent the type of the object to compare to
dDist  will be filled with the closest distance
dConfThr  minimum confidence threshold for the objects in 'set'
Returns:
ObjectType that is closest to o

Definition at line 196 of file WorldModelHighLevel.cpp.

References getGlobalPosition(), VecPosition::getMagnitude(), PlayerSettings::getPlayerConfThr(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, ObjectSetT, ObjectT, and PS.

Referenced by Player::amIAgentToSaySomething(), calculateStateBall(), Player::getDeadBallPosition(), getPosClosestOpponentTo(), getProbTackleClosestOpp(), BasicPlayer::holdBall(), BasicPlayer::interceptClose(), BasicPlayer::kickTo(), processUnsureHearInfo(), removeGhosts(), Player::sayOppAttackerStatus(), BasicPlayer::turnWithBallTo(), updateAgentAndBallAfterSense(), and updateDynamicObjectForNextCycle().

int WorldModel::getClosestPlayerInFormationTo VecPosition    pos,
bool    bIncludeGoalie = 1,
ObjectT    objWithout = OBJECT_ILLEGAL,
PlayerSetT    ps = PS_ALL,
FormationT    ft = FT_ILLEGAL
 

This method returns the closest player in the current formation to the position 'pos'. In case of a dead ball situation this method can be used to determine whether you should move to the ball.

Parameters:
pos  position which is used in the comparision
bIncludeGoalie  boolean to determine whether goalkeeper should be taken into account
ps  player set to which the returned player must belong
Returns:
role number of the agent in the current formation who is closest to this position

Definition at line 1837 of file WorldModelHighLevel.cpp.

References formations, FormationT, getBallPos(), VecPosition::getDistanceTo(), Formations::getPlayerType(), getStrategicPosition(), SoccerTypes::getTeammateObjectFromIndex(), VecPosition::getX(), isDeadBallUs(), SoccerTypes::isPlayerTypeInSet(), MAX_TEAMMATES, ObjectT, PITCH_LENGTH, and PlayerSetT.

ObjectT WorldModel::getClosestRelativeInSet ObjectSetT    set,
double *    dDist = NULL
 

This method returns the object type of the closest object relative to the agent. Only objects are taken into account that are part of the set 'set'.

Parameters:
set  ObjectSetT which denotes objects taken into consideration
dDist  will be filled with the closest relative distance
Returns:
ObjectType that is closest to the agent

Definition at line 323 of file WorldModelHighLevel.cpp.

References getRelativeDistance(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, ObjectSetT, and ObjectT.

Referenced by calculateStateAgent3(), and initParticlesAgent().

char * WorldModel::getCommunicationString  
 

This method returns the string that we want communicate. It can be set during the creation of the action. When the ActHandler sends its actions, it sends this string to the server.

Returns:
communication string.

Definition at line 558 of file WorldModel.cpp.

References m_strCommunicate.

Referenced by ActHandler::sendCommands().

double WorldModel::getConfidence ObjectT    o
 

This method returns the confidence value of the object supplied as the first argument. The confidence is calculated using the current server cycle and the time the object was last seen.

Parameters:
ObjectT  that represent the type of the object to check
Returns:
confidence value [0.0, 1.0] that indicates the confidence value

Definition at line 1046 of file WorldModel.cpp.

References Object::getConfidence(), getCurrentTime(), getObjectPtrFromType(), and ObjectT.

Referenced by Player::amIAgentToSaySomething(), BasicPlayer::defendGoalLine(), Player::deMeer5(), Player::deMeer5_goalie(), getFirstEmptySpotInSet(), getStrategicPosition(), isConfidenceGood(), isConfidenceVeryGood(), iterateObjectNext(), logObjectInformation(), mapUnknownPlayers(), and processPerfectHearInfoBall().

int WorldModel::getCurrentCycle  
 

This method returns the current cycle number. In case of a player this is the cycle of the last sense message, in case of the coach this is the cycle of the last see_global message.

Returns:
actual time

Definition at line 237 of file WorldModel.cpp.

References getCurrentTime(), and Time::getTime().

Referenced by Player::amIAgentToSaySomething(), SenseHandler::analyzeMessage(), calculateStateAgent3(), Player::deMeer5(), drawCoordinationGraph(), BasicPlayer::freezeBall(), getFastestInSetTo(), logCircle(), logCoordInfo(), logDrawInfo(), logLine(), logObjectInformation(), Player::mainLoop(), Player::makeBallInfo(), predictCommandToInterceptBall(), predictNrCyclesToObject(), predictNrCyclesToPoint(), processPlayerMessage(), Player::sayOppAttackerStatus(), ActHandler::sendCommands(), Player::shallISaySomething(), and updateAll().

Time WorldModel::getCurrentTime  
 

This method returns the current time. In case of a player this is the time of the last sense message, in case of the coach this is the time of the last see_global message.

Returns:
actual time

Definition at line 225 of file WorldModel.cpp.

References getPlayerNumber(), getTimeLastRecvSenseMessage(), and getTimeLastSeeGlobalMessage().

Referenced by Player::amIAgentToSaySomething(), SenseHandler::analyzeFullStateMessage(), SenseHandler::analyzeMessage(), SenseHandler::analyzeSeeGlobalMessage(), SenseHandler::analyzeSenseMessage(), calculateStateBall(), drawCoordinationGraph(), getConfidence(), getCurrentCycle(), BasicPlayer::getInterceptionPointBall(), getMaxTraveledDistance(), getOffsideX(), getProbTackleSucceeds(), getTackleExpires(), getTimeFromConfidence(), isTimeStopped(), logObjectInformation(), Player::mainLoop(), mapUnknownPlayers(), BasicPlayer::outplayOpponent(), predictCommandToInterceptBall(), predictPosAfterNrCycles(), processCatchedBall(), processNewObjectInfo(), processPerfectHearInfo(), processPerfectHearInfoBall(), processPlayerMessage(), processQueuedCommands(), removeGhosts(), BasicPlayer::searchBall(), ActHandler::sendCommands(), Player::shallISaySomething(), show(), storePlayerMessage(), updateAfterSeeMessage(), updateAfterSenseMessage(), updateAgentAndBallAfterSense(), updateAll(), updateBallAfterKick(), updateBallForCollision(), and updateDynamicObjectForNextCycle().

double WorldModel::getDashPowerRate ObjectT    obj
 

This method returns the dash power rate of the object 'obj'.

Definition at line 1554 of file WorldModel.cpp.

References HeteroPlayerSettings::dDashPowerRate, getHeteroInfoPlayer(), and ObjectT.

Referenced by predictNrCyclesForDistance(), and predictStateAfterDash().

AngDeg WorldModel::getDirectionOfWidestAngle VecPosition    posOrg,
AngDeg    angMin,
AngDeg    angMax,
AngDeg   angLargest,
double    dDist
 

This method determines the (global) direction which has the largest angle between the opponents and is located in the interval angMin.. angMax.

Parameters:
origin  of which the angles angMin and angMax are based on.
angMin  minimal global direction that should be returned
angMax  maximal global direction that should be returned
angLargest  will contain the size of the largest angle of the direction that is returned
dDist  only opponents with relative distance smaller than this value will be taken into account.
Returns:
global direction with the largest angle between opponents

Definition at line 1296 of file WorldModelHighLevel.cpp.

References AngDeg, getBisectorTwoAngles(), VecPosition::getDistanceTo(), getGlobalPosition(), getOppGoalieType(), PlayerSettings::getPlayerConfThr(), getRelativeDistance(), VecPosition::getX(), VecPosition::getY(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), max(), MAX_OPPONENTS, min(), VecPosition::normalizeAngle(), OBJECT_ILLEGAL, OBJECT_SET_OPPONENTS, ObjectT, PITCH_LENGTH, PS, and UnknownAngleValue.

Referenced by BasicPlayer::clearBall(), and BasicPlayer::getShootPositionOnLine().

double WorldModel::getEffectiveMaxSpeed ObjectT    obj,
bool    bWithNoise = false
 

This method returns the effective max speed of the object 'obj'.

Definition at line 1602 of file WorldModel.cpp.

References HeteroPlayerSettings::dDashPowerRate, HeteroPlayerSettings::dEffortMax, HeteroPlayerSettings::dPlayerDecay, HeteroPlayerSettings::dPlayerSpeedMax, getEffectiveMaxSpeed(), getHeteroInfoPlayer(), ServerSettings::getMaxPower(), ServerSettings::getPlayerRand(), ObjectT, pt, and SS.

Referenced by getEffectiveMaxSpeed().

double WorldModel::getEffortMax ObjectT    obj
 

This method returns the maximum effort of the object 'obj'.

Definition at line 1596 of file WorldModel.cpp.

References HeteroPlayerSettings::dEffortMax, getEffortMax(), getHeteroInfoPlayer(), and ObjectT.

Referenced by getEffortMax(), and predictStateAfterDash().

double WorldModel::getEndSpeedFromFirstSpeed double    dFirstSpeed,
double    dCycles
 

This method returns the speed the ball will have after 'dCycles' cycles when it is given an initial speed of 'dFirstSpeed'. This can be calculated using a geometric series.

Parameters:
dFirstSpeed  given speed to the ball
dCycles  nr of cycles after which ball speed should be determined
Returns:
speed of the ball after 'dCycles' server cycles

Definition at line 1753 of file WorldModelHighLevel.cpp.

References ServerSettings::getBallDecay(), and SS.

Referenced by BasicPlayer::getEndSpeedForPass().

ObjectT WorldModel::getFastestInSetTo ObjectSetT    set,
VecPosition    pos,
VecPosition    vel,
double    dDecay,
int *    iCyclesToIntercept = NULL
 

This method returns the fastest object to another object that is currently located at position 'pos' and has velocity 'vel' that decays with a value 'dDecay'. The last argument will be filled with the predicted amount of cycles needed to reach this object.

Parameters:
set  ObjectSetT which denotes objects taken into consideration
pos  current position of the object
vel  current velocity of the object
dDecay  decay value of the velocity of the object
iCyclesToIntercept  will be filled with the amount of cycles needed
Returns:
object that can reach it fastest

Definition at line 859 of file WorldModelHighLevel.cpp.

References EPSILON, VecPosition::getDistanceTo(), getGlobalPosition(), VecPosition::getMagnitude(), PlayerSettings::getPlayerConfThr(), ServerSettings::getPlayerSpeedMax(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, ObjectSetT, ObjectT, predictNrCyclesToPoint(), PS, and SS.

ObjectT WorldModel::getFastestInSetTo ObjectSetT    set,
ObjectT    obj,
int *    iCyclesToIntercept = NULL
 

This method returns the fastest object to a specified object and fills the last argument with the predicted amount of cycles needed to intercept this object. Only objects within the set 'set' are taken into consideration and the objects have to have a confidence higher than the player confidence threshold defined in PlayerSettings.

Parameters:
set  ObjectSetT which denotes objects taken into consideration
obj  object type of object that should be intercepted
iCyclesToIntercept  will be filled with the amount of cycles needed
Returns:
object that can intercept object obj fastest

Definition at line 722 of file WorldModelHighLevel.cpp.

References createInterceptFeatures(), FEATURE_FASTEST_OPPONENT_TO_BALL, FEATURE_FASTEST_PLAYER_TO_BALL, FEATURE_FASTEST_TEAMMATE_TO_BALL, FEATURE_FASTEST_TEAMMATE_TO_BALL_NO_GOALIE, FEATURE_ILLEGAL, FeatureT, getCurrentCycle(), VecPosition::getDistanceTo(), getFeature(), getGlobalPosition(), Feature::getInfo(), Feature::getObject(), PlayerSettings::getPlayerConfThr(), ServerSettings::getPlayerSpeedMax(), getTimeLastHearMessage(), getTimeLastSeeMessage(), getTimeLastSenseMessage(), isFeatureRelevant(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), max(), OBJECT_BALL, OBJECT_ILLEGAL, OBJECT_SET_OPPONENTS, OBJECT_SET_PLAYERS, OBJECT_SET_TEAMMATES, OBJECT_SET_TEAMMATES_NO_GOALIE, ObjectSetT, ObjectT, predictNrCyclesToPoint(), predictPosAfterNrCycles(), PS, setFeature(), and SS.

Referenced by coordinateWith(), createInterceptFeatures(), Player::deMeer5(), Player::deMeer5_goalie(), drawCoordinationGraph(), BasicPlayer::getInterceptionPointBall(), isBallInOurPossesion(), updateAll(), and updateDynamicObjectForNextCycle().

Feature WorldModel::getFeature FeatureT    type
 

This method return the feature corresponding to the type 'type'.

Parameters:
type  type of this feature, e.g., FEATURE_FASTEST_PLAYER_TO_BALL.
Returns:
corresponding feature.

Definition at line 2512 of file WorldModel.cpp.

References FeatureT, and m_features.

Referenced by getFastestInSetTo(), BasicPlayer::interceptClose(), predictCommandToInterceptBall(), and predictNrCyclesToObject().

ObjectT WorldModel::getFirstEmptySpotInSet ObjectSetT    set,
int    iUnknownPlayer = -1
 

This method returns the first empty spot in the set 'set'. The first empty spot is returned as the object which has a lower confidence than the threshold player_conf_thr defined in the PlayerSettings. This can be used when information of an unknown object is perceived. It is set on the first position where there is currently no information stored. If 'iUnknownPlayer' is specified, the range that corresponds to this unknown player is used to dermine the position.

Parameters:
set  ObjectSetT consisting of the objects to check
iUnknownPlayer  indicates the unknownplayer that has to be mapped
Returns:
object type of which currently no up to date information is stored

Definition at line 918 of file WorldModelHighLevel.cpp.

References getAgentObjectType(), getConfidence(), PlayerSettings::getPlayerConfThr(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, ObjectSetT, ObjectT, and PS.

Referenced by mapUnknownPlayers(), and processUnsureHearInfo().

double WorldModel::getFirstSpeedFromDist double    dDist,
double    dCycles,
double    dDecay = -1.0
 

This method returns the speed that has to be given to an object when it should have travelled a distance 'dDist' after 'dCycles' number of cycles. This can be calculated using a geometric series where 'dDecay' is the used decay factor (default this value equals ball_decay).

Parameters:
dDist  distance the ball has to travel
dCycles  nr of cycles after which ball should have travelled 'dDist'
dDecay  decay of the geometric series.
Returns:
initial speed for the ball to travel 'dDist' in 'dCycles' cycles

Definition at line 1738 of file WorldModelHighLevel.cpp.

References ServerSettings::getBallDecay(), Geometry::getFirstGeomSeries(), and SS.

Referenced by BasicPlayer::getEndSpeedForPass(), and getPowerForDash().

double WorldModel::getFirstSpeedFromEndSpeed double    dEndSpeed,
double    dCycles,
double    dDecay = -1.0
 

This method returns the speed that has to be given to the ball when it should have an endspeed of 'dEndSpeed' after 'dCycles' number of cycles. This can be calculated using a geometric series.

Parameters:
dEndSpeed  desired end speed for the ball
dCycles  nr of cycles after which ball should have speed 'dEndSpeed'
Returns:
initial speed given to the ball to have speed 'dEndSpeed' after 'dCycles' cycles.

Definition at line 1718 of file WorldModelHighLevel.cpp.

References ServerSettings::getBallDecay(), and SS.

Referenced by getKickSpeedToTravel().

ObjectT WorldModel::getFurthestInSetTo ObjectSetT    set,
ObjectT    objTarget,
double *    dDist = NULL,
double    dConfThr = -1.0
 

This method returns the object type of the furthest object to the ObjectT that is supplied as the second argument. Only objects are taken into account that are part of the set 'set' and have a confidence higher than the supplied threshold. If no threshold is supplied, the threshold defined in PlayerSettings is used.

Parameters:
set  ObjectSetT which denotes objects taken into consideration
o  ObjectT that represent the type of the object to compare to
dDist  will be filled with the furthest distance
dConfThr  minimum confidence threshold for the objects in 'set'
Returns:
ObjectType that is furthest to o

Definition at line 447 of file WorldModelHighLevel.cpp.

References getGlobalPosition(), VecPosition::getMagnitude(), PlayerSettings::getPlayerConfThr(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, ObjectSetT, ObjectT, and PS.

ObjectT WorldModel::getFurthestRelativeInSet ObjectSetT    set,
double *    dDist = NULL
 

This method returns the type of the object that is located furthest relative to the agent. Only objects are taken into account that are part of the set 'set'.

Parameters:
set  ObjectSetT which denotes objects taken into consideration
dDist  will be filled with the furthest relative distance
Returns:
ObjectType that is furthest to the agent

Definition at line 483 of file WorldModelHighLevel.cpp.

References getRelativeDistance(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, ObjectSetT, and ObjectT.

Referenced by calculateStateAgent(), and calculateStateAgent3().

AngDeg WorldModel::getGlobalAngle ObjectT    o
 

This method returns the global angle of the specified object (this object is normally a line).

Parameters:
ObjectT  that represent the type of the object to check
Returns:
global angle of this object in the field

Definition at line 1033 of file WorldModel.cpp.

References AngDeg, SoccerTypes::getGlobalAngleLine(), getSide(), SoccerTypes::isLine(), ObjectT, and UnknownAngleValue.

Referenced by calculateStateAgent(), and calculateStateAgent3().

AngDeg WorldModel::getGlobalArmDirection ObjectT    o
 

This method returns the arm direction of object 'o'. It does not keep track of how relevant this information is. When the pointing agent stops pointing the angle is set to UnknownAngleValue.

Definition at line 1251 of file WorldModel.cpp.

References AngDeg, PlayerObject::getGlobalArm(), getObjectPtrFromType(), ObjectT, and UnknownAngleValue.

AngDeg WorldModel::getGlobalBodyAngle ObjectT    o
 

This method returns the global body angle of the specified object. No check is made whether this information is up to date (use getTimeGlobalAngles).

Parameters:
ObjectT  that represent the type of the object to check
Returns:
last known global body angle of this object

Definition at line 1008 of file WorldModel.cpp.

References AngDeg, PlayerObject::getGlobalBodyAngle(), getObjectPtrFromType(), ObjectT, and UnknownAngleValue.

Referenced by getProbTackleSucceeds(), BasicPlayer::holdBall(), logObjectInformation(), BasicPlayer::outplayOpponent(), predictCommandToInterceptBall(), predictCommandToMoveToPos(), predictCommandTurnTowards(), predictNrCyclesToPoint(), predictObjectStateAfterCommand(), predictPosAfterNrCycles(), and removeGhosts().

AngDeg WorldModel::getGlobalBodyAngleLastSee ObjectT    o
 

This method returns the last global body angle derived from a see message. The time corresponds to the method 'getTimeChangeInformation'.

Parameters:
object  type of object that should be checked
Returns:
global body angle related to the last see message.

Definition at line 1224 of file WorldModel.cpp.

References AngDeg, PlayerObject::getGlobalBodyAngleLastSee(), getObjectPtrFromType(), ObjectT, and UnknownAngleValue.

Referenced by predictNrCyclesToPoint().

AngDeg WorldModel::getGlobalNeckAngle ObjectT    o
 

This method returns the global neck angle of the specified object. No check is made whether this information is up to date (use getTimeGlobalAngles).

Parameters:
ObjectT  that represent the type of the object to check
Returns:
last known global neck angle of this object

Definition at line 1021 of file WorldModel.cpp.

References AngDeg, PlayerObject::getGlobalNeckAngle(), getObjectPtrFromType(), ObjectT, and UnknownAngleValue.

Referenced by logObjectInformation(), predictCommandToInterceptBall(), predictCommandTurnTowards(), and predictObjectStateAfterCommand().

VecPosition WorldModel::getGlobalPosition ObjectT    o
 

This method returns the global position of an objectType. This method is normally used for the objects on the field (player, opponents and the ball). When the global position cannot be determined, a VecPosition with both the x and y coordinate are set to 'UnknownDoubleValue'.

Parameters:
ObjectT  that represent the type of the object to check
Returns:
VecPosition containing the global position.

Definition at line 899 of file WorldModel.cpp.

References Object::getGlobalPosition(), SoccerTypes::getGlobalPositionFlag(), ServerSettings::getGoalWidth(), getObjectPtrFromType(), getSide(), SoccerTypes::isFlag(), SoccerTypes::isGoal(), ObjectT, SS, and UnknownDoubleValue.

Referenced by calculateAngleAgentWithPos(), calculatePosAgentWith2Flags(), calculateStateAgent3(), calculateStateBall(), checkParticlesAgent(), coordinateWith(), createInterceptFeatures(), drawCoordinationGraph(), getBallPos(), getClosestInSetTo(), Player::getDeadBallPosition(), getDirectionOfWidestAngle(), getFastestInSetTo(), getFurthestInSetTo(), getListCloseOpponents(), BasicPlayer::getMarkingPosition(), getNrInSetInCircle(), getNrInSetInCone(), getNrInSetInRectangle(), getPosClosestOpponentTo(), getProbTackleSucceeds(), getSecondClosestInSetTo(), getStrategicPosition(), BasicPlayer::getThroughPassShootingPoint(), BasicPlayer::holdBall(), initParticlesAgent(), isEmptySpace(), isOnside(), isOpponentAtAngle(), BasicPlayer::kickTo(), BasicPlayer::leadingPass(), logCoordInfo(), logDrawInfo(), logObjectInformation(), mapUnknownPlayers(), BasicPlayer::mark(), BasicPlayer::outplayOpponent(), predictBallInfoAfterCommand(), predictCommandToInterceptBall(), predictCommandToMoveToPos(), predictCommandTurnTowards(), predictNrCyclesToObject(), predictObjectStateAfterCommand(), predictPosAfterNrCycles(), removeGhosts(), Player::sayBallStatus(), Player::sayOppAttackerStatus(), BasicPlayer::turnWithBallTo(), updateAll(), updateBallForCollision(), and updateDynamicObjectForNextCycle().

VecPosition WorldModel::getGlobalPositionLastSee ObjectT    o
 

This method returns the last global position derived from a see message. The time corresponds to the method 'getTimeGlobalPositionLastSee'.

Parameters:
object  type of object that should be checked
Returns:
global position related to the last see message.

Definition at line 1187 of file WorldModel.cpp.

References Object::getGlobalPositionLastSee(), getObjectPtrFromType(), ObjectT, and UnknownDoubleValue.

Referenced by predictNrCyclesToPoint().

VecPosition WorldModel::getGlobalVelocity ObjectT    o
 

This method returns the global velocity of an objectType. When the global position cannot be determined, a VecPosition is returned with both the x and y coordinate set to 'UnknownDoubleValue'.

Parameters:
ObjectT  that represent the type of the object to check
Returns:
VecPosition containing the global position.

Definition at line 931 of file WorldModel.cpp.

References DynamicObject::getGlobalVelocity(), getObjectPtrFromType(), ObjectT, and UnknownDoubleValue.

Referenced by BasicPlayer::accelerateBallToVelocity(), calculateStateBall(), calculateStatePlayer(), BasicPlayer::defendGoalLine(), getProbTackleSucceeds(), BasicPlayer::kickBallCloseToBody(), BasicPlayer::kickTo(), logDrawBallInfo(), logObjectInformation(), predictBallInfoAfterCommand(), predictCommandToInterceptBall(), predictCommandToMoveToPos(), predictCommandTurnTowards(), predictObjectStateAfterCommand(), predictPosAfterNrCycles(), processPerfectHearInfoBall(), processPlayerMessage(), Player::sayBallStatus(), updateBallForCollision(), and updateDynamicObjectForNextCycle().

VecPosition WorldModel::getGlobalVelocityLastSee ObjectT    o
 

This method returns the last global velocity derived from a see message. The time corresponds to the method 'getTimeChangeInformation'.

Parameters:
object  type of object that should be checked
Returns:
global velocity related to the last see message.

Definition at line 1212 of file WorldModel.cpp.

References DynamicObject::getGlobalVelocityLastSee(), getObjectPtrFromType(), ObjectT, and UnknownDoubleValue.

Referenced by predictNrCyclesToPoint().

int WorldModel::getGoalDiff   const
 

This method returns the goal difference. When this value is below zero, the team of agent is behind, 0 means that the score is currently the same for both teams and a value higher than zero means that you're winning!.

Returns:
goal difference

Definition at line 461 of file WorldModel.cpp.

References iGoalDiff.

HeteroPlayerSettings WorldModel::getHeteroInfoPlayer ObjectT    obj
 

This method returns the heterogeneous player information of the object 'obj'. This information consists of a subset of the ServerSettings values that fully specify the information of the heterogeneous player.

Definition at line 1517 of file WorldModel.cpp.

References getAgentObjectType(), PlayerObject::getHeteroPlayerType(), getInfoHeteroPlayer(), getObjectPtrFromType(), SoccerTypes::isKnownPlayer(), and ObjectT.

Referenced by getDashPowerRate(), getEffectiveMaxSpeed(), getEffortMax(), getInertiaMoment(), getMaximalKickDist(), getPlayerDecay(), getPlayerSize(), getPlayerSpeedMax(), and getStaminaIncMax().

int WorldModel::getHeteroPlayerType ObjectT    obj
 

This methods returns the heterogeneous player type of object 'obj'. Initially, the player types of all players are set to the type of the agent itself. After new information from the coach, they are set correctly.

Definition at line 1442 of file WorldModel.cpp.

References PlayerObject::getHeteroPlayerType(), getObjectPtrFromType(), and ObjectT.

Referenced by SenseHandler::analyzeChangePlayerTypeMessage(), and mapUnknownPlayers().

double WorldModel::getInertiaMoment ObjectT    obj
 

This method returns the inertia moment of the object 'obj'.

Definition at line 1590 of file WorldModel.cpp.

References HeteroPlayerSettings::dInertiaMoment, getHeteroInfoPlayer(), getInertiaMoment(), and ObjectT.

Referenced by getActualTurnAngle(), getAngleForTurn(), getInertiaMoment(), and predictCommandTurnTowards().

HeteroPlayerSettings WorldModel::getInfoHeteroPlayer int    iIndex
 

This method returns information about the heterogeneous player at index 'iIndex'. This information consists of a subset of the ServerSettings values that fully specify the information of the heterogeneous player.

Definition at line 1509 of file WorldModel.cpp.

References pt.

Referenced by getHeteroInfoPlayer(), and BasicCoach::mainLoopNormal().

double WorldModel::getKickPowerForSpeed double    dDesiredSpeed
 

The actual power with which the ball must be kicked depends on the relative location of the ball to the player. The kick is more powerful when the ball is very close to and in front of the player. The actual power with which the ball must be kicked is equal to
Speed / KickPowerRate*(1 - 0.25*DirDiff / 180 - 0.25*(DistBall-PlayerSize-BallSize)/KickableMargin)
with DirDiff = global angle of the ball rel to the body dir agent
DistBall = the distance from the center of the player to the ball
See soccermanual for further information. This method receives a speed vector which the ball should have after the kick command and calculates the power for the kick command to reach this. This value can be higher than is possible to shoot!

Parameters:
dDesiredSpeed  the desired speed after the kick command
Returns:
the actual power for kick command to get dDesiredSpeed

Definition at line 1679 of file WorldModelHighLevel.cpp.

References getActualKickPowerRate().

Referenced by BasicPlayer::accelerateBallToVelocity(), BasicPlayer::freezeBall(), BasicPlayer::kickBallCloseToBody(), and BasicPlayer::kickTo().

double WorldModel::getKickSpeedToTravel double    dDistance,
double    dEndSpeed
 

This method determines the power with which the ball must be kicked in order to travel a given distance and still have a speed after that distance

Parameters:
dDistance  distance ball should travel
dEndSpeed  speed ball should have at target position
Returns:
power value for kick command

Definition at line 1693 of file WorldModelHighLevel.cpp.

References ServerSettings::getBallDecay(), Geometry::getFirstInfGeomSeries(), getFirstSpeedFromEndSpeed(), Geometry::getLengthGeomSeries(), and SS.

Referenced by BasicPlayer::kickTo().

ObjectT WorldModel::getLastOpponentDefender double *    dX = NULL
 

This method returns the object type of the last opponent defender. This opponent resembles the offside line.

Parameters:
if  non-null dX will be filled with the x position of this object
Returns:
object type of the last opponent defender

Definition at line 1174 of file WorldModelHighLevel.cpp.

References Object::getGlobalPosition(), getOppGoalieType(), Object::getType(), VecPosition::getX(), isConfidenceGood(), MAX_OPPONENTS, OBJECT_ILLEGAL, ObjectT, Opponents, and PENALTY_X.

Referenced by getOffsideX().

list< ObjectT > WorldModel::getListCloseOpponents VecPosition    pos,
double    dDist = 15
 

This method returns a list with all the opponents that are location within distance of 'dDist' of position 'pos'.

Definition at line 1356 of file WorldModel.cpp.

References VecPosition::getDistanceTo(), getGlobalPosition(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, OBJECT_SET_OPPONENTS, and ObjectT.

VecPosition WorldModel::getMarkingPosition VecPosition    pos,
double    dDist,
MarkT    mark
 

This method returns a global position on the field which denotes the position to mark position 'pos'. It receives three arguments: a position pos (usually an opponent) that the agent wants to mark, a distance 'dDist' representing the desired distance between o and the marking position and a type indicator that denotes the type of marking that is required. We distinguish three types of marking: - MARK BALL: marking the opponent by standing at a distance 'dDist' away from him on the line between him and the ball. This type of marking will make it di±cult for the opponent to receive a pass.

  • MARK GOAL: marking the opponent by standing at a distance 'dDist' away from him on the line between him and the center point of the goal he attacks. This type of marking will make it difficult for the opponent to score a goal. - MARK BISECTOR: marking the opponent by standing at a distance 'dDist' away from him on the bisector of the ball-opponent-goal angle. This type of marking enables the agent to intercept both a direct and a leading pass to the opponent.
Parameters:
pos  position that has to be marked
dDist  distance marking position is located from object position
mark  marking technique that should be used
Returns:
position that is the marking position.

Definition at line 1561 of file WorldModelHighLevel.cpp.

References AngDeg, getAgentGlobalPosition(), getBallPos(), getBisectorTwoAngles(), VecPosition::getDistanceTo(), Line::getPointOnLineClosestTo(), getPosOwnGoal(), VecPosition::getX(), VecPosition::getY(), Line::getYGivenX(), Line::isInBetween(), Line::makeLineFromTwoPoints(), MARK_BALL, MARK_BISECTOR, MARK_GOAL, MarkT, min(), PITCH_LENGTH, POLAR, VecPosition::setVecPosition(), VecPosition::setX(), VecPosition::setY(), and sign().

Referenced by BasicPlayer::getMarkingPosition().

double WorldModel::getMaximalKickDist ObjectT    obj
 

This method returns the maximal kick distance of the object 'obj'.

Definition at line 1572 of file WorldModel.cpp.

References HeteroPlayerSettings::dMaximalKickDist, getHeteroInfoPlayer(), getMaximalKickDist(), and ObjectT.

Referenced by getMaximalKickDist(), predictCommandToInterceptBall(), predictCommandTurnTowards(), predictNrCyclesForDistance(), predictNrCyclesToPoint(), and updateDynamicObjectForNextCycle().

ObjectT WorldModel::getMaxRangeUnknownPlayer ObjectT    obj,
char *    strMsg
[private]
 

Definition at line 3016 of file WorldModelUpdate.cpp.

References getAgentObjectType(), SoccerTypes::getIndex(), SoccerTypes::getObjectFromStr(), SoccerTypes::getOpponentObjectFromIndex(), getSide(), SoccerTypes::getTeammateObjectFromIndex(), getTeamName(), Parse::gotoFirstOccurenceOf(), SoccerTypes::isKnownPlayer(), SoccerTypes::isOpponent(), SoccerTypes::isPlayer(), SoccerTypes::isTeammate(), OBJECT_OPPONENT_1, OBJECT_OPPONENT_11, OBJECT_TEAMMATE_1, OBJECT_TEAMMATE_11, ObjectT, and SIDE_LEFT.

Referenced by processLastSeeMessage().

double WorldModel::getMaxTraveledDistance ObjectT    o
 

Definition at line 517 of file WorldModelHighLevel.cpp.

References getCurrentTime(), ServerSettings::getPlayerSpeedMax(), getTimeLastSeen(), ObjectT, and SS.

Referenced by mapUnknownPlayers(), processNewObjectInfo(), and removeGhosts().

bool WorldModel::getMinMaxDirChange double    dOutput,
double *    dMin,
double *    dMax,
double    x1
[private]
 

This method determines the minimum and maximum input values that will produce a quantized (noise used in the soccer server) for the direction change of 'dOutput'. See the soccer server manual for details.

Parameters:
dOutput  resulting quantized value for direction change
dMin  will be filled with minimum possible value
dMax  will be filled with maximum possible value
x1  value of outer quantize call (normally 0.1)
Returns:
bool indicating whether values were filled correctly

Definition at line 2351 of file WorldModelUpdate.cpp.

References invQuantizeMax(), and invQuantizeMin().

Referenced by checkParticlesBall(), and initParticlesBall().

bool WorldModel::getMinMaxDistChange double    dOutput,
double    dDist,
double *    dMin,
double *    dMax,
double    x1,
double    xDist1,
double    xDist2
[private]
 

This method determines the minimum and maximum input values that will produce a quantized (noise used in the soccer server) for the distance change of 'dOutput'. See the soccer server manual for details.

Parameters:
dOutput  resulting quantized value for direction change
dDist  distance to the perceived object
dMin  will be filled with minimum possible value
dMax  will be filled with maximum possible value
x1  quantize step for distance change
xDist1  value of inner quantize call to determine quantize value corresponding to distance
xDist2  value of outer quantize call to determine quantize value corresponding to distance
Returns:
bool indicating whether values were filled correctly

Definition at line 2373 of file WorldModelUpdate.cpp.

References getMinMaxDistQuantizeValue(), invQuantizeMax(), invQuantizeMin(), max(), and min().

Referenced by checkParticlesBall(), and initParticlesBall().

bool WorldModel::getMinMaxDistQuantizeValue double    dOutput,
double *    dMin,
double *    dMax,
double    x1,
double    x2
[private]
 

This method determines the minimum and maximum input values that will produce a quantized (noise used in the soccer server) distance of 'dOutput'. With other words, this is the range of values that will have the same quantized value 'dOutput'. The quantized steps are defined by x1 and x2. See the soccer server manual for details.

Parameters:
dOutput  resulting quantized value
dMin  will be filled with minimum possible value
dMax  will be filled with maximum possible value
x1  value of inner quantize call-0.1 for player/ball, 0.01 for flags
x2  value of outer quantize call (normally 0.1)
Returns:
bool indicating whether values were filled correctly

Definition at line 2322 of file WorldModelUpdate.cpp.

References invQuantizeMax(), and invQuantizeMin().

Referenced by calculateStateAgent2(), checkParticlesAgent(), checkParticlesBall(), getMinMaxDistChange(), initParticlesAgent(), and initParticlesBall().

int WorldModel::getNrInSetInCircle ObjectSetT    set,
Circle    c
 

This method returns the number of objects that are within the circle 'c' Only objects are taken into account that are part of the set 'set' and have a confidence higher than the threshold defined in PlayerSettings.

Parameters:
c  circle in which objects should be located to be counted
Returns:
number of objects from 'set' in circle 'c'

Definition at line 58 of file WorldModelHighLevel.cpp.

References getGlobalPosition(), PlayerSettings::getPlayerConfThr(), Circle::isInside(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, ObjectSetT, ObjectT, and PS.

Referenced by calculateStateBall(), Player::deMeer5_goalie(), isEmptySpace(), and BasicPlayer::outplayOpponent().

int WorldModel::getNrInSetInCone ObjectSetT    set,
double    dWidth,
VecPosition    start,
VecPosition    end
 

This method returns the number of objects in the specified cone. A cone is like a piece of a pie, in which 'start' is the center of the pie, 'end' is the edge of the pie and 'dWidth' is the half width of the piece after distance 1. Only objects are taken into consideration that are within the set 'set' and have a confidence higher than the threshold defined in PlayerSettings.

Parameters:
set  ObjectSetT of which objects are taken into consideration
dWidth  half width of the cone after distance 1.0
start  center of the cone
end  position that is the end of the cone.
Returns:
number of objects part of 'set' and located in this cone.

Definition at line 113 of file WorldModelHighLevel.cpp.

References VecPosition::getDistanceTo(), getGlobalPosition(), PlayerSettings::getPlayerConfThr(), Line::getPointOnLineClosestTo(), Line::isInBetween(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), Line::makeLineFromTwoPoints(), OBJECT_ILLEGAL, ObjectSetT, ObjectT, and PS.

Referenced by Player::executeStringCommand(), and BasicPlayer::outplayOpponent().

int WorldModel::getNrInSetInRectangle ObjectSetT    set,
Rect   rect = NULL
 

This method returns the number of visible objects that are part of the object set 'set' and located in the rectangle 'rect'. When no rectangle is defined (rect=NULL) the whole field is taken into account. Only objects with a confidence value higher than the threshold defined in PlayerSettings are taken into consideration.

Parameters:
set  ObjectSetT from which objects are taken into consideration
rect  Rectangle in which objects are counted (default NULL)
Returns:
number of objects in Rectangle 'rect'.

Definition at line 85 of file WorldModelHighLevel.cpp.

References getGlobalPosition(), PlayerSettings::getPlayerConfThr(), Rect::isInside(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, ObjectSetT, ObjectT, and PS.

Referenced by updateAll().

int WorldModel::getNrOfCommands CommandT    c const
 

This method returns the amount of commands c performed by the agent. This is supplied in the sense_body message.

Parameters:
c  CommandT of which number of commands should be returned.
Returns:
amount of commands c performed by the soccerserver.

Definition at line 486 of file WorldModel.cpp.

References CommandT, and iCommandCounters.

Referenced by show().

ObjectT WorldModel::getObjectFocus  
 

This methods returns the object type of the object that is currently listened to. This information is gathered from a sense message. When this agent says a message, we will definitely hear it.

Definition at line 567 of file WorldModel.cpp.

References m_objFocus, and ObjectT.

Object * WorldModel::getObjectPtrFromType ObjectT    o [private]
 

This method returns a pointer to the Object information of the object type that is passed as the first argument.

Parameters:
o  ObjectType of which information should be returned
Returns:
pointer to object information of supplied ObjectT argument

Definition at line 158 of file WorldModel.cpp.

References agentObject, Ball, Flags, SoccerTypes::getIndex(), getOppGoalieType(), getOwnGoalieType(), Object::getType(), SoccerTypes::isBall(), SoccerTypes::isFlag(), SoccerTypes::isKnownPlayer(), SoccerTypes::isLine(), SoccerTypes::isTeammate(), Lines, OBJECT_ILLEGAL, OBJECT_OPPONENT_GOALIE, OBJECT_TEAMMATE_GOALIE, ObjectT, Opponents, and Teammates.

Referenced by calculateStatePlayer(), calculateVelocityDynamicObject(), getConfidence(), getGlobalArmDirection(), getGlobalBodyAngle(), getGlobalBodyAngleLastSee(), getGlobalNeckAngle(), getGlobalPosition(), getGlobalPositionLastSee(), getGlobalVelocity(), getGlobalVelocityLastSee(), getHeteroInfoPlayer(), getHeteroPlayerType(), getRelativeAngle(), getRelativeDistance(), getRelativePosition(), getTackleExpires(), getTimeChangeInformation(), getTimeGlobalAngles(), getTimeGlobalArmDirection(), getTimeGlobalPosition(), getTimeGlobalPositionLastSee(), getTimeGlobalVelocity(), getTimeLastSeen(), isKnownPlayer(), isVisible(), processNewObjectInfo(), processPerfectHearInfo(), processSeeGlobalInfo(), removeGhosts(), setHeteroPlayerType(), setIsKnownPlayer(), setTimeLastSeen(), show(), updateAfterSenseMessage(), updateDynamicObjectAfterSee(), updateDynamicObjectForNextCycle(), and updateObjectRelativeFromGlobal().

double WorldModel::getOffsideX bool    bIncludeComm = true
 

This method returns the x coordinate of the offside line using the known information in the WorldModel. If a player moves beyond this line, he stands offside. First the opponent with the second highest x coordinate is located, then the maximum of this x coordinate and the ball x coordinate is returned.

Parameters:
bIncludeComm  boolean indicating whether communicated offside line should also be included.
Returns:
x coordinate of the offside line.

Definition at line 1221 of file WorldModelHighLevel.cpp.

References getBallPos(), getCurrentTime(), getLastOpponentDefender(), VecPosition::getX(), m_dCommOffsideX, m_timeCommOffsideX, and max().

Referenced by getStrategicPosition(), isOnside(), Player::makeBallInfo(), Player::sayOppAttackerStatus(), and updateAll().

ObjectT WorldModel::getOppGoalieType  
 

This method returns the object type of the opponent goalkeeper. Which object type is the actual goalkeeper is checked in different ways. First of all this information is can be available in a see message. When no player is stored in the world model of which this is is perceived, the opponent goalkeeper is assumed the player with the highest x coordinate, but only if this player stands very close in front of the goal

Returns:
ObjectT that represents the opponent goalkeeper, OBJECT_ILLEGAL if it cannot be determined which object type is the opponent goalkeeper.

Definition at line 1081 of file WorldModel.cpp.

References Object::getGlobalPosition(), ServerSettings::getGoalWidth(), PlayerObject::getIsGoalie(), Object::getType(), VecPosition::getX(), VecPosition::getY(), isConfidenceGood(), isKnownPlayer(), MAX_OPPONENTS, OBJECT_ILLEGAL, OBJECT_OPPONENT_1, ObjectT, Opponents, PENALTY_X, PITCH_LENGTH, SS, and UnknownDoubleValue.

Referenced by getDirectionOfWidestAngle(), getLastOpponentDefender(), getObjectPtrFromType(), getProbTackleSucceeds(), removeGhosts(), and updateDynamicObjectForNextCycle().

VecPosition WorldModel::getOuterPositionInField VecPosition    pos,
AngDeg    ang,
double    dDist = 3.0,
bool    bWithPenalty = true
 

This method returns the outer position on the field given a position 'pos' and a global angle 'ang'. The outer position is defined as the point on the field where the line created from this position and angle crosses either a side line, goal line or penalty line. To be on the safe side a small value is specified, which denotes the distance from the side line that should be returned.

Parameters:
pos  position on the field from which outer position should be calculated
ang  global angle which denotes the global direction in pos
dDist  distance from line
bWithPenalty  boolean denoting whether penalty area should be taken into account (if false only goal line and side line are used.
Returns:
position denoting the outer position on the field

Definition at line 1247 of file WorldModelHighLevel.cpp.

References AngDeg, Line::getIntersection(), VecPosition::getY(), Line::makeLineFromPositionAndAngle(), PENALTY_AREA_WIDTH, PENALTY_X, PITCH_LENGTH, and PITCH_WIDTH.

Referenced by BasicPlayer::getDribblePoint().

ObjectT WorldModel::getOwnGoalieType  
 

This method returns the object type of the own goalkeeper. Which object type is the actual goalkeeper is checked in different ways. First of all this information is available in the see, when (goalie) is behind the perceived object. When no player is stored in the world model of which this is perceived, the own goalkeeper is assumed the player with the lowest x coordinate, but only if this player stands close in front of the goal.

Returns:
ObjectT that represents the own goalkeeper, OBJECT_ILLEGAL if it cannot be determined which object type is the own goalkeeper.

Definition at line 1130 of file WorldModel.cpp.

References Object::getGlobalPosition(), ServerSettings::getGoalWidth(), PlayerObject::getIsGoalie(), Object::getType(), VecPosition::getX(), VecPosition::getY(), isConfidenceGood(), MAX_TEAMMATES, OBJECT_ILLEGAL, OBJECT_TEAMMATE_1, ObjectT, PENALTY_X, PITCH_LENGTH, SS, Teammates, and UnknownDoubleValue.

Referenced by createInterceptFeatures(), getObjectPtrFromType(), and iterateObjectNext().

double WorldModel::getPlayerDecay ObjectT    obj
 

This method returns the decay of the object 'obj'.

Definition at line 1566 of file WorldModel.cpp.

References HeteroPlayerSettings::dPlayerDecay, getHeteroInfoPlayer(), getPlayerDecay(), and ObjectT.

Referenced by getPlayerDecay(), predictNrCyclesForDistance(), and predictStateAfterDash().

int WorldModel::getPlayerNumber   const
 

This method returns the player number of the agent. The player number is the fixed number which is given by the server after initialization.

Returns:
player number of this player.

Definition at line 385 of file WorldModel.cpp.

References iPlayerNumber.

Referenced by Player::amIAgentToSaySomething(), SenseHandler::analyzeMessage(), SenseHandler::analyzePlayerMessage(), createInterceptFeatures(), Player::deMeer5(), drawCoordinationGraph(), getCurrentTime(), Player::mainLoop(), Player::makeBallInfo(), Player::performPenalty(), SenseHandler::readServerParam(), ActHandler::sendCommands(), and updateAll().

double WorldModel::getPlayerSize ObjectT    obj
 

This method returns the size of the object 'obj'.

Definition at line 1584 of file WorldModel.cpp.

References HeteroPlayerSettings::dPlayerSize, getHeteroInfoPlayer(), getPlayerSize(), and ObjectT.

Referenced by getPlayerSize().

double WorldModel::getPlayerSpeedMax ObjectT    obj
 

This method returns the maximum speed of the object 'obj'.

Definition at line 1560 of file WorldModel.cpp.

References HeteroPlayerSettings::dPlayerSpeedMax, getHeteroInfoPlayer(), getPlayerSpeedMax(), and ObjectT.

Referenced by getPlayerSpeedMax(), and predictCommandToInterceptBall().

PlayerT WorldModel::getPlayerType ObjectT    o = OBJECT_ILLEGAL
 

This method returns the player type of the object 'o' in the current formation.

Definition at line 1424 of file WorldModel.cpp.

References formations, getAgentObjectType(), SoccerTypes::getIndex(), Formations::getPlayerType(), OBJECT_ILLEGAL, ObjectT, and PlayerT.

Referenced by isInPlayerSet().

PlayModeT WorldModel::getPlayMode   const
 

This method returns the current playmode. This playmode is passed through by the referee.

Returns:
current playmode (see SoccerTypes for possibilities)

Definition at line 440 of file WorldModel.cpp.

References playMode, and PlayModeT.

Referenced by calculateStateBall(), Player::deMeer5_goalie(), isBackPassThem(), isBackPassUs(), isBeforeKickOff(), isCornerKickThem(), isCornerKickUs(), isDeadBallThem(), isDeadBallUs(), isFreeKickFaultThem(), isFreeKickFaultUs(), isFreeKickThem(), isFreeKickUs(), isGoalKickThem(), isGoalKickUs(), isKickInThem(), isKickInUs(), isKickOffThem(), isKickOffUs(), isOffsideThem(), isOffsideUs(), isPenaltyThem(), isPenaltyUs(), Player::mainLoop(), BasicCoach::mainLoopNormal(), Player::performPenalty(), and updateDynamicObjectForNextCycle().

VecPosition WorldModel::getPosClosestOpponentTo double *    dDist = NULL,
ObjectT    o = OBJECT_ILLEGAL
 

Definition at line 506 of file WorldModelHighLevel.cpp.

References getAgentObjectType(), getClosestInSetTo(), getGlobalPosition(), OBJECT_ILLEGAL, OBJECT_SET_OPPONENTS, ObjectT, and UnknownDoubleValue.

VecPosition WorldModel::getPosOpponentGoal  
 

This method returns the global position of the opponent goal.

Returns:
VecPosition containing the position of the opponent goal.

Definition at line 1453 of file WorldModel.cpp.

References SoccerTypes::getGlobalPositionFlag(), SoccerTypes::getGoalOpponent(), ServerSettings::getGoalWidth(), getSide(), getSidePenalty(), isPenaltyThem(), isPenaltyUs(), OBJECT_GOAL_L, OBJECT_GOAL_R, ObjectT, SIDE_LEFT, and SS.

Referenced by getRelDistanceOpponentGoal(), BasicPlayer::holdBall(), and BasicPlayer::interceptClose().

VecPosition WorldModel::getPosOwnGoal  
 

This method returns the global position of the own goal.

Returns:
VecPosition containing the position of the own goal.

Definition at line 1466 of file WorldModel.cpp.

References SoccerTypes::getGlobalPositionFlag(), ServerSettings::getGoalWidth(), SoccerTypes::getOwnGoal(), getSide(), getSidePenalty(), isPenaltyThem(), isPenaltyUs(), OBJECT_GOAL_L, OBJECT_GOAL_R, ObjectT, SIDE_LEFT, SideT, and SS.

Referenced by BasicPlayer::defendGoalLine(), getMarkingPosition(), and isBallHeadingToGoal().

double WorldModel::getPowerForDash VecPosition    posRelTo,
AngDeg    angBody,
VecPosition    vel,
double    dEffort,
int    iCycles = 1
 

This method determines the optimal dash power to mantain an optimal speed When the current speed is too high and the distance is very small, a negative dash is performed. Otherwise the difference with the maximal speed is determined and the dash power rate is set to compensate for this difference.

Parameters:
posRelTo  relative point to which we want to dash
angBody  body angle of the agent
vel  current velocity of the agent
dEffort  current effort of the player
iCycles  desired number of cycles to reach this point
Returns:
dash power that should be sent with dash command

Definition at line 1801 of file WorldModelHighLevel.cpp.

References AngDeg, ServerSettings::getDashPowerRate(), getFirstSpeedFromDist(), ServerSettings::getMaxPower(), ServerSettings::getMinPower(), ServerSettings::getPlayerDecay(), ServerSettings::getPlayerSpeedMax(), VecPosition::getX(), VecPosition::rotate(), and SS.

Referenced by BasicPlayer::dashToPoint(), BasicPlayer::interceptClose(), BasicPlayer::interceptCloseGoalie(), and predictCommandToMoveToPos().

double WorldModel::getProbTackleClosestOpp int    iExtraCycles = 0
 

This method returns the tackle probability of the closest opponent to the ball.

Definition at line 1374 of file WorldModel.cpp.

References getClosestInSetTo(), getProbTackleSucceeds(), OBJECT_BALL, OBJECT_ILLEGAL, OBJECT_SET_OPPONENTS, and ObjectT.

double WorldModel::getProbTackleSucceeds ObjectT    o = OBJECT_ILLEGAL,
int    iExtraCycles = 0,
VecPosition   pos = NULL
 

This method returns the probability that a tackle performed by object o will succeed. This probability depends on the relative distance to the ball in both the x and y direction and various server parameters. In the case that o equals OBJECT_ILLEGAL, the returned probability corresponds to that of the agent object.

Definition at line 1277 of file WorldModel.cpp.

References AngDeg, getAgentObjectType(), getBallPos(), getCurrentTime(), VecPosition::getDistanceTo(), getGlobalBodyAngle(), getGlobalPosition(), getGlobalVelocity(), VecPosition::getMagnitude(), getOppGoalieType(), ServerSettings::getTackleBackDist(), ServerSettings::getTackleDist(), ServerSettings::getTackleExponent(), ServerSettings::getTackleWidth(), getTimeGlobalAngles(), getTimeLastSeeMessage(), getTimeLastSeen(), ServerSettings::getVisibleDistance(), VecPosition::getX(), VecPosition::getY(), max(), min(), VecPosition::normalizeAngle(), OBJECT_ILLEGAL, ObjectT, POLAR, VecPosition::rotate(), and SS.

Referenced by getProbTackleClosestOpp().

bool WorldModel::getRecvThink  
 

This method returns a boolean indicating whether the synchronization method indicated we are ready.

Definition at line 549 of file WorldModel.cpp.

References m_bRecvThink.

Referenced by Player::mainLoop().

double WorldModel::getRelAngleOpponentGoal  
 

This method returns the relative angle to the opponent goal. This relative angle is the relative angle between the opponent goal position and the agent position. The neck and body angle of the agent are NOT taken into account.

Returns:
relative angle between goal and agent position.

Definition at line 1494 of file WorldModel.cpp.

References getAgentGlobalPosition(), SoccerTypes::getGlobalPositionFlag(), OBJECT_GOAL_L, OBJECT_GOAL_R, SIDE_LEFT, and sideSide.

AngDeg WorldModel::getRelativeAngle ObjectT    o,
bool    bWithBody = false
 

This method returns the relative angle between the agent and the object supplied as the first argument. No check is made whether this information is up to date (use isVisible or getConfidence for that). By default the returned angle is relative to the neck of the agent. When the second argument 'bWithBody' is set to true, the returned angle is relative to the body of the agent.

Parameters:
ObjectT  that represent the type of the object to check
bWithBody  when true angle is relative to body, otherwise to neck (default false)
Returns:
relative angle to this object

Definition at line 976 of file WorldModel.cpp.

References AngDeg, getAgentBodyAngleRelToNeck(), getObjectPtrFromType(), Object::getRelativeAngle(), VecPosition::normalizeAngle(), ObjectT, and UnknownDoubleValue.

Referenced by calculateAngleAgentWithPos(), calculatePosAgentWith2Flags(), calculateStateAgent(), calculateStateAgent3(), calculateStateBall(), calculateStatePlayer(), calculateVelocityDynamicObject(), BasicPlayer::catchBall(), checkParticlesAgent(), checkParticlesBall(), Player::deMeer5(), getActualKickPowerRate(), initParticlesAgent(), initParticlesBall(), BasicPlayer::kickBallCloseToBody(), BasicPlayer::kickTo(), mapUnknownPlayers(), and removeGhosts().

double WorldModel::getRelativeDistance ObjectT    o
 

This method returns the relative distance between the agent and the object supplied as the first argument. No check is made whether this information is up to date (use isVisible or getConfidence for that).

Parameters:
ObjectT  that represent the type of the object to check
Returns:
relative distance to this object

Definition at line 945 of file WorldModel.cpp.

References getObjectPtrFromType(), Object::getRelativeDistance(), ObjectT, and UnknownDoubleValue.

Referenced by Player::amIAgentToSaySomething(), SenseHandler::analyzeSeeMessage(), SenseHandler::analyzeSenseMessage(), calculatePosAgentWith2Flags(), calculateStateAgent2(), calculateStateAgent3(), calculateStateBall(), calculateStatePlayer(), calculateVelocityDynamicObject(), checkParticlesAgent(), checkParticlesBall(), BasicPlayer::collideWithBall(), drawCoordinationGraph(), getActualKickPowerRate(), getClosestRelativeInSet(), getDirectionOfWidestAngle(), getFurthestRelativeInSet(), getSecondClosestRelativeInSet(), initParticlesAgent(), initParticlesBall(), BasicPlayer::interceptClose(), BasicPlayer::interceptCloseGoalie(), isBallCatchable(), isBallKickable(), BasicPlayer::kickTo(), logObjectInformation(), mapUnknownPlayers(), processPlayerMessage(), removeGhosts(), Player::sayBallStatus(), updateAll(), and updateBallAfterKick().

VecPosition WorldModel::getRelativePosition ObjectT    o
 

This method returns the relative position of the object to the agent. No check is made whether this information is up to date (use isVisible or getConfidence for that).

Parameters:
ObjectT  that represent the type of the object to check
Returns:
relative position to this object

Definition at line 958 of file WorldModel.cpp.

References getObjectPtrFromType(), Object::getRelativePosition(), ObjectT, and UnknownDoubleValue.

Referenced by processNewObjectInfo().

double WorldModel::getRelDistanceOpponentGoal  
 

This method returns the relative distance to the opponent goal

Returns:
relative distance from the agent to the opponent goal.

Definition at line 1481 of file WorldModel.cpp.

References getAgentGlobalPosition(), VecPosition::getDistanceTo(), and getPosOpponentGoal().

ObjectT WorldModel::getSecondClosestInSetTo ObjectSetT    set,
ObjectT    obj,
double *    dDist = NULL,
double    dConfThr = -1.0
 

This method returns the object type of the second closest object to the object type that is supplied as the second argument. Only objects are taken into account within set 'set' and with a confidence higher than the supplied threshold. If no threshold is supplied, the threshold defined in PlayerSettings is used.

Parameters:
set  ObjectSetT which denotes objects taken into consideration
obj  ObjectT that represent the type of the object to check
dDist  will be filled with the distance to this player.
dConfThr  minimum confidence threshold for the objects in 'set'
Returns:
ObjectType that is second closest to obj

Definition at line 356 of file WorldModelHighLevel.cpp.

References getGlobalPosition(), VecPosition::getMagnitude(), PlayerSettings::getPlayerConfThr(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, ObjectSetT, ObjectT, and PS.

ObjectT WorldModel::getSecondClosestRelativeInSet ObjectSetT    set,
double *    dDist = NULL
 

This method returns the object type of the second closest object relative to the agent. Only objects are taken into account within set 'set' and which where seen in the last see message.

Parameters:
set  ObjectSetT which denotes objects taken into consideration
dDist  will be filled with the distance to this this object
Returns:
ObjectType that is second closest to the agent

Definition at line 401 of file WorldModelHighLevel.cpp.

References getRelativeDistance(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, ObjectSetT, and ObjectT.

Referenced by calculateStateAgent3().

SideT WorldModel::getSide   const
 

This method returns the side of the agent. Note that the side of the agent does not change after half time.

Returns:
side (SIDE_LEFT or SIDE_RIGHT) for agent

Definition at line 403 of file WorldModel.cpp.

References sideSide, and SideT.

Referenced by SenseHandler::analyzeFullStateMessage(), SenseHandler::analyzeHearMessage(), Player::deMeer5_goalie(), getGlobalAngle(), getGlobalPosition(), getMaxRangeUnknownPlayer(), getPosOpponentGoal(), getPosOwnGoal(), BasicPlayer::interceptScoringAttempt(), isBackPassThem(), isBackPassUs(), isBallHeadingToGoal(), isCornerKickThem(), isCornerKickUs(), isFreeKickFaultThem(), isFreeKickFaultUs(), isFreeKickThem(), isFreeKickUs(), isFullStateOn(), isGoalKickThem(), isGoalKickUs(), isInOwnPenaltyArea(), isInTheirPenaltyArea(), isKickInThem(), isKickInUs(), isKickOffThem(), isKickOffUs(), isOffsideThem(), isOffsideUs(), isPenaltyThem(), isPenaltyUs(), logDrawInfo(), Player::performPenalty(), processLastSeeMessage(), setPlayMode(), setSide(), and show().

SideT WorldModel::getSidePenalty  
 

This method returns the side the penalty kick is taken.

Definition at line 1742 of file WorldModel.cpp.

References m_sidePenalty, and SideT.

Referenced by getPosOpponentGoal(), getPosOwnGoal(), BasicPlayer::interceptScoringAttempt(), isBallHeadingToGoal(), isInOwnPenaltyArea(), and Player::performPenalty().

double WorldModel::getStaminaIncMax ObjectT    obj
 

This method returns the stamina increase of the object 'obj'.

Definition at line 1578 of file WorldModel.cpp.

References HeteroPlayerSettings::dStaminaIncMax, getHeteroInfoPlayer(), getStaminaIncMax(), and ObjectT.

Referenced by getStaminaIncMax().

VecPosition WorldModel::getStrategicPosition int    iPlayer = -1,
FormationT    ft = FT_ILLEGAL
 

This method determine the strategic position for the specified player. This is done using the Formations class. In this class all information about the current formation, player number in formation and otheic values are stored. The strategic position is based on the position of the ball. If the confidence in the position of the ball is lower than the threshold defined in PlayerSettings, it is assumed that the ball is at position (0,0).

Parameters:
iPlayer  role in formation for which strategic position should be returnd. With default value is -1 it is assumed that the strategic position of the agent itself should be returned.
ft  formation for which to calculate the strategic position
Returns:
VecPosition strategic position for player 'iPlayer'

Definition at line 1481 of file WorldModelHighLevel.cpp.

References formations, FormationT, PlayerSettings::getBallConfThr(), getBallPos(), getConfidence(), PlayerSettings::getCyclesCatchWait(), getGlobalPosition(), PlayerSettings::getMaxYPercentage(), getOffsideX(), Formations::getPlayerInFormation(), Formations::getStrategicPosition(), SoccerTypes::getTeammateObjectFromIndex(), getTimeSinceLastCatch(), VecPosition::getX(), isBallInOurPossesion(), isBeforeKickOff(), isDeadBallThem(), isDeadBallUs(), isFreeKickThem(), isFreeKickUs(), isGoalKickThem(), isGoalKickUs(), isOffsideUs(), max(), MAX_TEAMMATES, min(), OBJECT_BALL, PENALTY_X, PITCH_LENGTH, predictPosAfterNrCycles(), PS, VecPosition::setVecPosition(), and VecPosition::setX().

VecPosition WorldModel::getStrategicPosition ObjectT    obj,
FormationT    ft = FT_ILLEGAL
 

This method determine the strategic position for the specified object. This is done using the Formations class. In this class all information about the current formation, player number in formation and otheic values are stored. The strategic position is based on the position of the ball. If the confidence in the position of the ball is lower than the threshold defined in PlayerSettings, it is assumed that the ball is at position (0,0).

Parameters:
obj  for which the strategic position should be calculated.
ft  formation for which to calculate the strategic position
Returns:
VecPosition strategic position for player 'iPlayer'

Definition at line 1464 of file WorldModelHighLevel.cpp.

References FormationT, SoccerTypes::getIndex(), and ObjectT.

Referenced by Player::deMeer5(), Player::deMeer5_goalie(), getClosestPlayerInFormationTo(), and updateAfterSenseMessage().

ObjectT WorldModel::getSubstitutedOpp  
 

This method returns the first substituted opponent player in the set of substituted opponent players and then erases this opponent from the set.

Definition at line 1542 of file WorldModel.cpp.

References m_setSubstitutedOpp, OBJECT_ILLEGAL, and ObjectT.

int WorldModel::getTackleExpires ObjectT    o = OBJECT_ILLEGAL
 

This method returns the number of cycles it will take the tackle to expire. In case of the argument OBJECT_ILLEGAL, the number of cycles for the agentObject is returned.

Definition at line 1235 of file WorldModel.cpp.

References agentObject, getAgentObjectType(), getCurrentTime(), getObjectPtrFromType(), ServerSettings::getTackleCycles(), AgentObject::getTackleExpires(), PlayerObject::getTimeTackle(), max(), OBJECT_ILLEGAL, ObjectT, and SS.

const char * WorldModel::getTeamName   const
 

This method returns the teamname of the agent in this worldmodel

Returns:
teamname for the agent in this worldmodel

Definition at line 421 of file WorldModel.cpp.

References strTeamName.

Referenced by SenseHandler::analyzeSeeGlobalMessage(), drawCoordinationGraph(), getMaxRangeUnknownPlayer(), processLastSeeMessage(), and show().

Time WorldModel::getTimeChangeInformation ObjectT    o
 

This method returns the last server cycle the relative distance change of the specified object has been reported.

Parameters:
object  type of object that should be checked
Returns:
server time relative distance change of this object was last seen (in a see message).

Definition at line 1174 of file WorldModel.cpp.

References getObjectPtrFromType(), DynamicObject::getTimeChangeInformation(), and ObjectT.

Referenced by Player::amIAgentToSaySomething(), predictNrCyclesToPoint(), and processPlayerMessage().

Time WorldModel::getTimeCheckBall   const
 

This method returns the time the status of the ball was last checked (coach only).

Returns:
server cycle the status of the ball was last checked.

Definition at line 513 of file WorldModel.cpp.

References timeCheckBall.

Time WorldModel::getTimeFromConfidence double    dConf
 

This method returns the inverse confidence, i.e. the time that belongs to the specified confidence. This can be used to determine the time the object was last seen when the confidence is given. Herefore the current time is used.

Parameters:
dConf  confidence
Returns:
server cycle the object was last seen.

Definition at line 1165 of file WorldModelHighLevel.cpp.

References getCurrentTime().

Referenced by logObjectInformation(), processPerfectHearInfo(), and processPerfectHearInfoBall().

Time WorldModel::getTimeGlobalAngles ObjectT    o
 

This method returns the time of the global angles (both body and neck angle) of the specified object.

Parameters:
ObjectT  that represent the type of the object to check
Returns:
time corresponding to both the stored body and neck angle

Definition at line 995 of file WorldModel.cpp.

References getObjectPtrFromType(), PlayerObject::getTimeGlobalAngles(), and ObjectT.

Referenced by getProbTackleSucceeds(), BasicPlayer::outplayOpponent(), predictPosAfterNrCycles(), and removeGhosts().

Time WorldModel::getTimeGlobalArmDirection ObjectT    o
 

This method returns the time related to the global arm direction of object 'o'. When the pointing agent stops pointing the angle is set to UnknownAngleValue and the returned time is not relevant.

Definition at line 1263 of file WorldModel.cpp.

References getObjectPtrFromType(), PlayerObject::getTimeGlobalArm(), and ObjectT.

Time WorldModel::getTimeGlobalPosition ObjectT    o
 

This method returns the time of the global position of the specified object.

Parameters:
ObjectT  that represent the type of the object to check
Returns:
time corresponding to the global position of 'o'

Definition at line 882 of file WorldModel.cpp.

References getObjectPtrFromType(), Object::getTimeGlobalPosition(), ObjectT, and UnknownTime.

Referenced by updateAfterSenseMessage().

Time WorldModel::getTimeGlobalPositionLastSee ObjectT    o
 

This method returns the last server cycle the global position the specified object has been calculated.

Parameters:
object  type of object that should be checked
Returns:
server time global position of this object was last derived (from a see message).

Definition at line 1200 of file WorldModel.cpp.

References getObjectPtrFromType(), Object::getTimeGlobalPosDerivedFromSee(), ObjectT, and UnknownTime.

Referenced by predictNrCyclesToPoint().

Time WorldModel::getTimeGlobalVelocity ObjectT    o
 

This method returns the time of the global velocity of the specified object.

Parameters:
ObjectT  that represent the type of the object to check
Returns:
time corresponding to the global velocity of 'o'

Definition at line 917 of file WorldModel.cpp.

References getObjectPtrFromType(), DynamicObject::getTimeGlobalVelocity(), ObjectT, and UnknownTime.

Referenced by logObjectInformation().

Time WorldModel::getTimeLastHearMessage   const
 

This method returns the time of the last hear message

Returns:
time of last hear message

Definition at line 368 of file WorldModel.cpp.

References timeLastHearMessage.

Referenced by createInterceptFeatures(), getFastestInSetTo(), BasicPlayer::interceptClose(), isFeatureRelevant(), and predictCommandToInterceptBall().

Time WorldModel::getTimeLastRecvSeeMessage   const
 

This method returns the time of the last received see message. The difference with getTimeLastSeeMessage is that that method returns the last see message that has been updated in the world model. In most cases these are equal.

Returns:
time of last received sense message

Definition at line 289 of file WorldModel.cpp.

References timeLastRecvSeeMessage.

Referenced by getTimeLastSeeGlobalMessage(), and updateAll().

Time WorldModel::getTimeLastRecvSenseMessage   const
 

This method returns the time of the last received sense message. The difference with getTimeLastSenseMessage is that that method returns the last sense message that has been updated in the world model. In most cases these are equal.

Returns:
time of last received sense message

Definition at line 333 of file WorldModel.cpp.

References timeLastRecvSenseMessage.

Referenced by SenseHandler::analyzeSeeMessage(), getCurrentTime(), and updateAll().

Time WorldModel::getTimeLastRefereeMessage  
 

This method returns the time of the last received referee message.

Returns:
time of last received referee message.

Definition at line 216 of file WorldModel.cpp.

References timeLastRefMessage.

Time WorldModel::getTimeLastSeeGlobalMessage   const
 

This method returns the time of the last see global message. This message can only be received by the coach.

Returns:
time of last see_global message

Definition at line 263 of file WorldModel.cpp.

References getTimeLastRecvSeeMessage().

Referenced by getCurrentTime(), and BasicCoach::mainLoopNormal().

Time WorldModel::getTimeLastSeeMessage   const
 

This method returns the time of the last see message

Returns:
time of last see message

Definition at line 279 of file WorldModel.cpp.

References timeLastSeeMessage.

Referenced by SenseHandler::analyzeSeeMessage(), calculateStateBall(), checkParticlesBall(), createInterceptFeatures(), getFastestInSetTo(), getProbTackleSucceeds(), initParticlesBall(), BasicPlayer::interceptClose(), isFeatureRelevant(), isLastMessageSee(), isVisible(), iterateObjectNext(), Player::mainLoop(), predictCommandToInterceptBall(), processLastSeeMessage(), removeGhosts(), updateAfterSeeMessage(), updateAgentObjectAfterSee(), updateAll(), and updateDynamicObjectAfterSee().

Time WorldModel::getTimeLastSeen ObjectT    o
 

This method returns the last server cycle the specified object has been seen.

Parameters:
object  type of object that should be checked
Returns:
server time this object was last seen (in a see message).

Definition at line 1160 of file WorldModel.cpp.

References getObjectPtrFromType(), Object::getTimeLastSeen(), and ObjectT.

Referenced by Player::amIAgentToSaySomething(), calculateStateBall(), calculateStatePlayer(), checkParticlesBall(), getMaxTraveledDistance(), getProbTackleSucceeds(), iterateObjectNext(), mapUnknownPlayers(), processPerfectHearInfoBall(), processPlayerMessage(), removeGhosts(), and updateAfterSeeMessage().

Time WorldModel::getTimeLastSenseMessage   const
 

This method returns the time of the last sense message

Returns:
time of last sense message

Definition at line 323 of file WorldModel.cpp.

References timeLastSenseMessage.

Referenced by createInterceptFeatures(), getFastestInSetTo(), BasicPlayer::interceptClose(), isFeatureRelevant(), isLastMessageSee(), isQueuedActionPerformed(), predictCommandToInterceptBall(), setPlayMode(), updateAfterSenseMessage(), and updateAll().

int WorldModel::getTimeSinceLastCatch  
 

This method returns the number of cycles since the last catch.

Returns:
cycles since last catch.

Definition at line 198 of file WorldModel.cpp.

References Time::getTime(), timeLastCatch, and timeLastSenseMessage.

Referenced by calculateStateBall(), Player::deMeer5_goalie(), getStrategicPosition(), and isBallCatchable().

void WorldModel::initParticlesAgent VecPosition    posInitial [private]
 

This method initializes all particles that represent the global position of the agent. All points are initialized with the position 'posInitial'. This method can be used when you are completely sure of the position of the agent (for example after a 'move' command).

Parameters:
posInitial  global position of the agent

Definition at line 1729 of file WorldModelUpdate.cpp.

References iNrParticlesAgent, and particlesPosAgent.

void WorldModel::initParticlesAgent AngDeg    angGlobal [private]
 

This method initializes all particles that represent the global position of the agent. This is done using the closest perceived flag. Points are generated from the area that could generate the perceived information. The global neck angle of the agent 'angGlobal' is used to determine the global position of the agent based on the perceived relative information to the closest flag.

Parameters:
angGlobal  global neck angle of the agent

Definition at line 1685 of file WorldModelUpdate.cpp.

References AngDeg, getClosestRelativeInSet(), getGlobalPosition(), getMinMaxDistQuantizeValue(), ServerSettings::getQuantizeStepL(), getRelativeAngle(), getRelativeDistance(), iNrParticlesAgent, VecPosition::normalizeAngle(), OBJECT_ILLEGAL, OBJECT_SET_FLAGS, ObjectT, particlesPosAgent, POLAR, and SS.

Referenced by calculateStateAgent(), and updateAgentAndBallAfterSense().

void WorldModel::initParticlesBall VecPosition    posArray[],
VecPosition    velArray[],
int    iLength
[private]
 

This method initializes all particles that represent the global position and global velocity of the ball. This is done by taking the last perceived information and generate particles within the range that can produce the perceived values. Note that each position is related to the velocity with the same index. The state of the ball is implicitly represented as a 4-tuple (pos_x, pos_y, vel_x, vel_y).

Parameters:
posArray  array that will be filled with the position particles
velArray  array that will be filled with the velocity particles
iLength  number of particles that have to be initialized.

Definition at line 2809 of file WorldModelUpdate.cpp.

References AngDeg, Ball, cosDeg(), Deg2Rad(), getAgentGlobalNeckAngle(), getAgentGlobalPosition(), getAgentGlobalVelocity(), getMinMaxDirChange(), getMinMaxDistChange(), getMinMaxDistQuantizeValue(), getRelativeAngle(), DynamicObject::getRelativeAngleChange(), getRelativeDistance(), DynamicObject::getRelativeDistanceChange(), DynamicObject::getTimeChangeInformation(), getTimeLastSeeMessage(), Object::getTimeRelativePosition(), OBJECT_BALL, POLAR, VecPosition::relativeToGlobal(), VecPosition::setVecPosition(), sinDeg(), UnknownAngleValue, and UnknownDoubleValue.

double WorldModel::invQuantizeMax double    dOutput,
double    dQuantizeStep
[private]
 

This method returns the maximum value that generates dOutput as a quantized value when 'dQuantizeStep' is used as the quantized step.

Parameters:
dOutput  quantized output
dQuantizeStep  quantize step
Returns:
maximum value that when quantized produces 'dOutput'

Definition at line 2408 of file WorldModelUpdate.cpp.

Referenced by getMinMaxDirChange(), getMinMaxDistChange(), and getMinMaxDistQuantizeValue().

double WorldModel::invQuantizeMin double    dOutput,
double    dQuantizeStep
[private]
 

This method returns the minimum value that generates dOutput as a quantized value when 'dQuantizeStep' is used as the quantized step.

Parameters:
dOutput  quantized output
dQuantizeStep  quantize step
Returns:
minimum value that when quantized produces 'dOutput'

Definition at line 2396 of file WorldModelUpdate.cpp.

References max().

Referenced by getMinMaxDirChange(), getMinMaxDistChange(), and getMinMaxDistQuantizeValue().

bool WorldModel::isBackPassThem PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that the other team has made a back pass (which is not allowed). This occurs when an opponent has passed the ball back to the goalkeeper and he catched it. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether the other team has made a back pass.

Definition at line 1938 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_BACK_PASS_LEFT, PM_BACK_PASS_RIGHT, PM_ILLEGAL, SIDE_LEFT, and SIDE_RIGHT.

Referenced by calculateStateBall(), Player::getDeadBallPosition(), and isDeadBallUs().

bool WorldModel::isBackPassUs PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that we have made a back pass (which is not allowed). This occurs when a teamamte has passed the ball back to the goalkeeper and he catched it. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether we have made a back pass.

Definition at line 1920 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_BACK_PASS_LEFT, PM_BACK_PASS_RIGHT, PM_ILLEGAL, SIDE_LEFT, and SIDE_RIGHT.

Referenced by calculateStateBall(), and isDeadBallThem().

bool WorldModel::isBallCatchable  
 

This method determines whether the ball is catchable. This only applies to a goalie. Three things are tested:

  • the ball hasn't been catched in catch_ban_cycles (see ServerSettings) before the current cycle
  • the relative distance to the ball is smaller than the length of the catchable area length of the goalie (see also ServerSettings)
  • the ball is in the (own) penalty area.
Returns:
true when above three constraints are met, false otherwise.

Definition at line 971 of file WorldModelHighLevel.cpp.

References getBallPos(), ServerSettings::getCatchableAreaL(), ServerSettings::getCatchBanCycle(), getRelativeDistance(), getTimeSinceLastCatch(), isInOwnPenaltyArea(), OBJECT_BALL, and SS.

Referenced by Player::deMeer5_goalie(), and Player::performPenalty().

bool WorldModel::isBallHeadingToGoal  
 

This method checks whether the ball is currently heading towards our own goal. For the ball to be heading to our goal a few constraints must be met:

  • ball must be located in our penalty area
  • line of ball heading must intersect with goal line within goal width + small constant.
  • ball must pass goal line within 20 cycles.
If all these constraints are met true is returned, false otherwise
Returns:
bool indicating whether the ball is heading towards our own goal

Definition at line 987 of file WorldModelHighLevel.cpp.

References getBallDirection(), getBallPos(), ServerSettings::getGoalWidth(), Line::getIntersection(), getPosOwnGoal(), getSide(), getSidePenalty(), VecPosition::getX(), VecPosition::getY(), isConfidenceGood(), isPenaltyThem(), isPenaltyUs(), Line::makeLineFromPositionAndAngle(), Line::makeLineFromTwoPoints(), OBJECT_BALL, PENALTY_X, PITCH_LENGTH, predictPosAfterNrCycles(), and SS.

bool WorldModel::isBallInOurPossesion  
 

This method returns whether the ball is in our possesion. This is defined by the fact if the fastest player to the ball is a teammate or not.

Returns:
bool indicating whether a teammate is the fastest player to the ball.

Definition at line 1033 of file WorldModelHighLevel.cpp.

References getFastestInSetTo(), SoccerTypes::isTeammate(), OBJECT_BALL, OBJECT_ILLEGAL, OBJECT_SET_PLAYERS, and ObjectT.

Referenced by getStrategicPosition().

bool WorldModel::isBallInOwnPenaltyArea  
 

This method returns whether the ball lies in the own penalty area.

Returns:
bool indicating whether ball lies in own penalty area.

Definition at line 1048 of file WorldModelHighLevel.cpp.

References getBallPos(), and isInOwnPenaltyArea().

bool WorldModel::isBallKickable  
 

This method determines whether the ball is kicakble, i.e. the ball is in the kickable range of the agent (see ServerSettings). This value can be different for the different heterogeneous player types.

Returns:
bool indicating whether ball can be kicked.

Definition at line 957 of file WorldModelHighLevel.cpp.

References ServerSettings::getMaximalKickDist(), getRelativeDistance(), OBJECT_BALL, and SS.

Referenced by Player::deMeer5(), Player::deMeer5_goalie(), and Player::performPenalty().

bool WorldModel::isBeforeGoal VecPosition    pos
 

This method returns whether the position 'pos' is before the opp goal.

Definition at line 1446 of file WorldModelHighLevel.cpp.

References ServerSettings::getGoalWidth(), PENALTY_X, PITCH_LENGTH, and SS.

Referenced by BasicPlayer::getInterceptionPointBall().

bool WorldModel::isBeforeKickOff PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the play mode indicates that there is (or will be) a before kick off situation. This is the case when the play mode equals PM_BEFORE_KICK_OFF or either PM_GOAL_LEFT or PM_GOAL_RIGHT since after the goal the play mode will go to PM_BEFORE_KICK_OFF. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether there is a before kick off situation.

Definition at line 1684 of file WorldModel.cpp.

References getPlayMode(), isKickOffThem(), isKickOffUs(), PlayModeT, PM_BEFORE_KICK_OFF, PM_GOAL_LEFT, PM_GOAL_RIGHT, and PM_ILLEGAL.

Referenced by SenseHandler::analyzeFullStateMessage(), calculateStateBall(), Player::deMeer5(), Player::deMeer5_goalie(), getStrategicPosition(), and updateAfterSenseMessage().

bool WorldModel::isCollisionAfterCommand SoccerCommand    soc
 

This method determines whether a dash command (supplied as the first argument) will result in collision with another player. This is checked by determing the global position after the command and then check whether the positions of one of the other players lies with the player size. Since it cannot be known what kind of action the other player takes in this cycle, it is also difficult to predict what the global position of the player will be in the next cycle. This method therefore assumes the other players have issued a dash with maximum power in the last cycle.

Returns:
bool indicating whether dash will result in a collision.

Definition at line 929 of file WorldModelPredict.cpp.

References AngDeg, CMD_KICK, SoccerCommand::commandType, ServerSettings::getBallRand(), ServerSettings::getBallSize(), getBallSpeed(), VecPosition::getDistanceTo(), VecPosition::getMagnitude(), ServerSettings::getPlayerDecay(), ServerSettings::getPlayerRand(), ServerSettings::getPlayerSize(), OBJECT_BALL, predictAgentStateAfterCommand(), predictBallInfoAfterCommand(), predictPosAfterNrCycles(), and SS.

Referenced by BasicPlayer::dribble().

bool WorldModel::isConfidenceGood ObjectT    o
 

This method determines whether the confidence for 'o' is good. The confidence of the object is compared to the player_conf_thr defined in PlayerSettings. When the confidence is higher than this value and the object does not equal the agent object type true is returned, otherwise false.

Parameters:
o  object of which confidence value should be returned
Returns:
bool indicating whether object information has good confidence.

Definition at line 1100 of file WorldModelHighLevel.cpp.

References getAgentObjectType(), getConfidence(), PlayerSettings::getPlayerConfThr(), ObjectT, and PS.

Referenced by getLastOpponentDefender(), getOppGoalieType(), getOwnGoalieType(), isBallHeadingToGoal(), BasicCoach::mainLoopNormal(), mapUnknownPlayers(), show(), and updateRelativeFromGlobal().

bool WorldModel::isConfidenceVeryGood ObjectT    o
 

This method determines whether the confidence for 'o' is very good. The confidence of the object is compared to the player_high_conf_thr defined in PlayerSettings. When the confidence is higher than this value and the object does not equal the agent object type true is returned, otherwise false.

Parameters:
o  object of which confidence value should be returned
Returns:
bool indicating whether object information has good confidence.

Definition at line 1114 of file WorldModelHighLevel.cpp.

References getAgentObjectType(), getConfidence(), PlayerSettings::getPlayerHighConfThr(), ObjectT, and PS.

bool WorldModel::isCornerKickThem PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that the other team has a corner kick. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether the other team has a corner kick.

Definition at line 1776 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_CORNER_KICK_LEFT, PM_CORNER_KICK_RIGHT, PM_ILLEGAL, SIDE_LEFT, and SIDE_RIGHT.

Referenced by Player::deMeer5_goalie(), and isDeadBallThem().

bool WorldModel::isCornerKickUs PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that we have a corner kick. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether we have a corner kick.

Definition at line 1761 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_CORNER_KICK_LEFT, PM_CORNER_KICK_RIGHT, PM_ILLEGAL, SIDE_LEFT, and SIDE_RIGHT.

Referenced by Player::getDeadBallPosition(), and isDeadBallUs().

bool WorldModel::isDeadBallThem PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that there is a dead ball situation and their team is allowed to perform the action. That is their team has either a free kick, kick in, corner kick or a kick in. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether they have a dead ball situation.

Definition at line 1720 of file WorldModel.cpp.

References getPlayMode(), isBackPassUs(), isCornerKickThem(), isFreeKickFaultUs(), isFreeKickThem(), isGoalKickThem(), isKickInThem(), isKickOffThem(), isOffsideUs(), PlayModeT, and PM_ILLEGAL.

Referenced by Player::deMeer5(), getStrategicPosition(), and updateDynamicObjectForNextCycle().

bool WorldModel::isDeadBallUs PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the play mode indicates that there is a dead ball situation and our team is allowed to perform the action. That is our team has either a free kick, kick in, corner kick or a kick in. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether we have a dead ball situation.

Definition at line 1701 of file WorldModel.cpp.

References getPlayMode(), isBackPassThem(), isCornerKickUs(), isFreeKickFaultThem(), isFreeKickUs(), isGoalKickUs(), isKickInUs(), isKickOffUs(), isOffsideThem(), PlayModeT, and PM_ILLEGAL.

Referenced by getClosestPlayerInFormationTo(), getStrategicPosition(), BasicPlayer::kickBallCloseToBody(), predictCommandToInterceptBall(), and updateDynamicObjectForNextCycle().

bool WorldModel::isEmptySpace ObjectT    obj,
AngDeg    ang,
double    dDist = 4.0
 

This method returns whether the space in direction 'ang'' of object 'obj' is occupied by any opponents.

Definition at line 145 of file WorldModelHighLevel.cpp.

References AngDeg, getGlobalPosition(), getNrInSetInCircle(), OBJECT_ILLEGAL, OBJECT_SET_OPPONENTS, ObjectT, and POLAR.

bool WorldModel::isFeatureRelevant FeatureT    type
 

This method checks whether the feature of type 'type' is relevant. This is done by comparing the time of the feature with the current time. When it is equal, the feature is assumed relevant, otherwise irrelevant.

Parameters:
type  feature that should be checked on relevance
Returns:
bool indicating whether the feature is relevant.

Definition at line 2475 of file WorldModel.cpp.

References FEATURE_INTERCEPT_CLOSE, FEATURE_INTERCEPTION_POINT_BALL, FeatureT, Feature::getTimeHear(), getTimeLastHearMessage(), getTimeLastSeeMessage(), getTimeLastSenseMessage(), Feature::getTimeSee(), Feature::getTimeSense(), m_bPerformedKick, and m_features.

Referenced by getFastestInSetTo(), BasicPlayer::interceptClose(), predictCommandToInterceptBall(), and predictNrCyclesToObject().

bool WorldModel::isFreeKickFaultThem PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that the other team has made a free kick fault. This happens when a player kicks the ball twice after a free kick or a kick in. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether the other team has made a free kick fault.

Definition at line 1872 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_FREE_KICK_FAULT_LEFT, PM_FREE_KICK_FAULT_RIGHT, PM_ILLEGAL, SIDE_LEFT, and SIDE_RIGHT.

Referenced by Player::getDeadBallPosition(), and isDeadBallUs().

bool WorldModel::isFreeKickFaultUs PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that we have made a free kick fault. This happens when a player kicks the ball twice after a free kick or a kick in. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether we have made a free kick fault.

Definition at line 1853 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_FREE_KICK_FAULT_LEFT, PM_FREE_KICK_FAULT_RIGHT, PM_ILLEGAL, SIDE_LEFT, and SIDE_RIGHT.

Referenced by isDeadBallThem().

bool WorldModel::isFreeKickThem PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the play mode indicates that the other team has a free kick. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether the other team has a free kick.

Definition at line 1663 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_FREE_KICK_LEFT, PM_FREE_KICK_RIGHT, PM_ILLEGAL, PM_INDIRECT_FREE_KICK_LEFT, PM_INDIRECT_FREE_KICK_RIGHT, SIDE_LEFT, and SIDE_RIGHT.

Referenced by Player::deMeer5_goalie(), getStrategicPosition(), and isDeadBallThem().

bool WorldModel::isFreeKickUs PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the play mode indicates that we have a free kick. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether we have a free kick.

Definition at line 1645 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_FREE_KICK_LEFT, PM_FREE_KICK_RIGHT, PM_ILLEGAL, PM_INDIRECT_FREE_KICK_LEFT, PM_INDIRECT_FREE_KICK_RIGHT, SIDE_LEFT, and SIDE_RIGHT.

Referenced by Player::deMeer5_goalie(), Player::getDeadBallPosition(), getStrategicPosition(), and isDeadBallUs().

bool WorldModel::isFullStateOn SideT    s = SIDE_ILLEGAL
 

Definition at line 2020 of file WorldModel.cpp.

References ServerSettings::getFullStateLeft(), ServerSettings::getFullStateRight(), getSide(), SIDE_ILLEGAL, SIDE_LEFT, SIDE_RIGHT, SideT, and SS.

Referenced by SenseHandler::analyzeMessage(), ActHandler::sendCommands(), and updateAll().

bool WorldModel::isGoalKickThem PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that the other team has a kick off. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether the other team has a kick off.

Definition at line 1968 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_GOAL_KICK_LEFT, PM_GOAL_KICK_RIGHT, PM_ILLEGAL, SIDE_LEFT, and SIDE_RIGHT.

Referenced by calculateStateBall(), getStrategicPosition(), and isDeadBallThem().

bool WorldModel::isGoalKickUs PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that we have a goal kick. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether we have a goal kick.

Definition at line 1953 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_GOAL_KICK_LEFT, PM_GOAL_KICK_RIGHT, PM_ILLEGAL, SIDE_LEFT, and SIDE_RIGHT.

Referenced by calculateStateBall(), Player::deMeer5_goalie(), Player::getDeadBallPosition(), getStrategicPosition(), isDeadBallUs(), and predictCommandToInterceptBall().

bool WorldModel::isInField VecPosition    pos,
double    dMargin = 1
 

This method returns whether the position 'pos' is inside the playfield.

Definition at line 1435 of file WorldModelHighLevel.cpp.

References PITCH_LENGTH, and PITCH_WIDTH.

Referenced by BasicPlayer::getInterceptionPointBall(), and predictCommandToInterceptBall().

bool WorldModel::isInOwnPenaltyArea VecPosition    pos
 

This method returns whether the specified position lies in the own penalty area.

Parameters:
pos  position which should be checked
Returns:
bool indicating whether 'pos' lies in own penalty area.

Definition at line 1057 of file WorldModelHighLevel.cpp.

References SoccerTypes::getGlobalPositionFlag(), getSide(), getSidePenalty(), VecPosition::getX(), VecPosition::getY(), isPenaltyThem(), isPenaltyUs(), OBJECT_FLAG_P_L_C, OBJECT_FLAG_P_R_C, ObjectT, PENALTY_AREA_WIDTH, and SIDE_LEFT.

Referenced by BasicPlayer::defendGoalLine(), Player::deMeer5_goalie(), BasicPlayer::getActiveInterceptionPointBall(), isBallCatchable(), and isBallInOwnPenaltyArea().

bool WorldModel::isInPlayerSet ObjectT    o,
PlayerSetT    ps
 

This method returns whether the object 'o' is located in the set of player types 'ps'.

Definition at line 1433 of file WorldModel.cpp.

References getPlayerType(), SoccerTypes::isPlayerTypeInSet(), ObjectT, and PlayerSetT.

bool WorldModel::isInTheirPenaltyArea VecPosition    pos
 

This method returns whether the specified position lies in the opponent penalty area.

Parameters:
pos  position which should be checked
Returns:
boolean indicating whether 'pos' lies in opponent penalty area.

Definition at line 1078 of file WorldModelHighLevel.cpp.

References SoccerTypes::getGlobalPositionFlag(), getSide(), VecPosition::getX(), VecPosition::getY(), OBJECT_FLAG_P_L_C, OBJECT_FLAG_P_R_C, ObjectT, PENALTY_AREA_WIDTH, and SIDE_LEFT.

bool WorldModel::isKickInThem PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that the other team has a kick in. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether the other team has a kick in.

Definition at line 1836 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_ILLEGAL, PM_KICK_IN_LEFT, PM_KICK_IN_RIGHT, SIDE_LEFT, and SIDE_RIGHT.

Referenced by calculateStateBall(), and isDeadBallThem().

bool WorldModel::isKickInUs PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that we have a kick in. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether we have a kick in.

Definition at line 1821 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_ILLEGAL, PM_KICK_IN_LEFT, PM_KICK_IN_RIGHT, SIDE_LEFT, and SIDE_RIGHT.

Referenced by calculateStateBall(), Player::getDeadBallPosition(), and isDeadBallUs().

bool WorldModel::isKickOffThem PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that the other team has a kick off. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether the other team has a kick off.

Definition at line 1903 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_ILLEGAL, PM_KICK_OFF_LEFT, PM_KICK_OFF_RIGHT, SIDE_LEFT, and SIDE_RIGHT.

Referenced by isBeforeKickOff(), and isDeadBallThem().

bool WorldModel::isKickOffUs PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that we have a kick off. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether we have a kick off.

Definition at line 1887 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_ILLEGAL, PM_KICK_OFF_LEFT, PM_KICK_OFF_RIGHT, SIDE_LEFT, and SIDE_RIGHT.

Referenced by Player::deMeer5(), isBeforeKickOff(), and isDeadBallUs().

bool WorldModel::isKnownPlayer ObjectT    o
 

This method returns wheter the specified object type is a known player. A known player is a player of which we know for certain that the player number is correct. If a player is seen without a number and it cannot be mapped to a player, it is put on the first empty position in the player list and the status of known player is set to false.

Parameters:
o  object type of player that should be checked
Returns:
bool indicating whether we are certain of number of player 'o'.

Definition at line 1062 of file WorldModel.cpp.

References PlayerObject::getIsKnownPlayer(), getObjectPtrFromType(), and ObjectT.

Referenced by getOppGoalieType(), logObjectInformation(), processNewObjectInfo(), and setIsKnownPlayer().

bool WorldModel::isLastMessageSee   const
 

This method returns whether the last received message was a see or not.

Returns:
bool indicating whether the last received message was a see.

Definition at line 255 of file WorldModel.cpp.

References getTimeLastSeeMessage(), and getTimeLastSenseMessage().

Referenced by updateAll().

bool WorldModel::isOffsideThem PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that the other team stood offside. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether the other team stood offside.

Definition at line 1806 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_ILLEGAL, PM_OFFSIDE_LEFT, PM_OFFSIDE_RIGHT, SIDE_LEFT, and SIDE_RIGHT.

Referenced by Player::getDeadBallPosition(), and isDeadBallUs().

bool WorldModel::isOffsideUs PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that we stood offside. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether we stood offside.

Definition at line 1791 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_ILLEGAL, PM_OFFSIDE_LEFT, PM_OFFSIDE_RIGHT, SIDE_LEFT, and SIDE_RIGHT.

Referenced by getStrategicPosition(), and isDeadBallThem().

bool WorldModel::isOnside ObjectT    obj
 

This method checks whether the specified object stands onside. This is done by comparing the x coordinate of the object to the offside line.

Returns:
boolean indicating whether 'obj' stands onside.

Definition at line 1123 of file WorldModelHighLevel.cpp.

References getGlobalPosition(), getOffsideX(), VecPosition::getX(), and ObjectT.

bool WorldModel::isOpponentAtAngle AngDeg    ang,
double    dDist
 

This method determines whether there stands an opponent in the global direction of the specified angle and in distance 'dDist'. An opponent is considered to stand in the global direction when the angle difference with the specified angle is smaller than 60 degrees.

Parameters:
ang  angle of the global direction in which to check opponents
dDist  distance in which opponents should be checked
Returns:
bool indicating wheter an opponent was found.

Definition at line 1135 of file WorldModelHighLevel.cpp.

References AngDeg, getAgentGlobalPosition(), VecPosition::getDistanceTo(), getGlobalPosition(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, OBJECT_SET_OPPONENTS, and ObjectT.

bool WorldModel::isPenaltyThem PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that the other team takes a penalty. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether the other team has a penalty.

Definition at line 2005 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_ILLEGAL, PM_PENALTY_READY_LEFT, PM_PENALTY_READY_RIGHT, PM_PENALTY_SETUP_LEFT, PM_PENALTY_SETUP_RIGHT, PM_PENALTY_TAKEN_LEFT, PM_PENALTY_TAKEN_RIGHT, SIDE_LEFT, and SIDE_RIGHT.

Referenced by calculateStateBall(), getPosOpponentGoal(), getPosOwnGoal(), BasicPlayer::interceptScoringAttempt(), isBallHeadingToGoal(), isInOwnPenaltyArea(), Player::mainLoop(), and Player::performPenalty().

bool WorldModel::isPenaltyUs PlayModeT    pm = PM_ILLEGAL
 

This method checks whether the current play mode indicates that we have a penalty. When the specified PlayModeT equals PM_ILLEGAL (default), the current play mode is used.

Parameters:
pm  play mode to check. In default case (PM_ILLEGAL) the current play mode is used.
Returns:
bool indicating whether we have a penalty.

Definition at line 1983 of file WorldModel.cpp.

References getPlayMode(), getSide(), PlayModeT, PM_ILLEGAL, PM_PENALTY_READY_LEFT, PM_PENALTY_READY_RIGHT, PM_PENALTY_SETUP_LEFT, PM_PENALTY_SETUP_RIGHT, PM_PENALTY_TAKEN_LEFT, PM_PENALTY_TAKEN_RIGHT, SIDE_LEFT, and SIDE_RIGHT.

Referenced by calculateStateBall(), getPosOpponentGoal(), getPosOwnGoal(), BasicPlayer::interceptScoringAttempt(), isBallHeadingToGoal(), isInOwnPenaltyArea(), Player::mainLoop(), and Player::performPenalty().

bool WorldModel::isQueuedActionPerformed  
 

This method checks whether a queued action is performed. The commands in QueuedCommands are the commands that are sent to the server by the ActHandler. The performedCommands array contains the commands that are performed in the last cycle (using the count information in the sense_body message). Using these two array it is possible to check whether a command is actually performed by the server. When there is an action that is sent to the server and not performed, this method returns false, true otherwise.

Returns:
true when all commands sent to the server are performed.

Definition at line 1627 of file WorldModel.cpp.

References CMD_MAX_COMMANDS, getTimeLastSenseMessage(), performedCommands, queuedCommands, and SoccerCommand::time.

Referenced by ActHandler::sendCommands(), and updateAll().

bool WorldModel::isTimeStopped  
 

This method returns whether the time of the server stands still. This occurs during non play-on modes (kick_in, kick_off, etc.).

Returns:
bool indicating whether time of the server stands still.

Definition at line 248 of file WorldModel.cpp.

References getCurrentTime(), and Time::isStopped().

Referenced by updateAll().

bool WorldModel::isVisible ObjectT    o
 

This method returns a truth value that represents whether the object supplied as the first argument was seen in the last see message. If "touch" information was received, i.e. the object was very close to the agent but not in its view cone, false is also returned.

Parameters:
ObjectT  that represent the type of the object to check
Returns:
bool indicating whether o was seen in the last see message

Definition at line 940 of file WorldModelHighLevel.cpp.

References getObjectPtrFromType(), getTimeLastSeeMessage(), Object::getTimeLastSeen(), and ObjectT.

void WorldModel::iterateObjectDone int &    iIndex
 

This method finsished the iteration. It should be called after iterateObjectNext has returned OBJECT_ILLEGAL indicating no more objects are available that satisfy the constraints.

Parameters:
iIndex  index of iteration

Definition at line 676 of file WorldModel.cpp.

Referenced by calculateAngleAgentWithPos(), calculateStateAgent2(), createInterceptFeatures(), drawCoordinationGraph(), getClosestInSetTo(), getClosestRelativeInSet(), getDirectionOfWidestAngle(), getFastestInSetTo(), getFurthestInSetTo(), getFurthestRelativeInSet(), getListCloseOpponents(), getNrInSetInCircle(), getNrInSetInCone(), getNrInSetInRectangle(), getSecondClosestInSetTo(), getSecondClosestRelativeInSet(), isOpponentAtAngle(), logCoordInfo(), logDrawInfo(), processNewObjectInfo(), removeGhosts(), updateAfterSeeMessage(), updateAfterSenseMessage(), and updateRelativeFromGlobal().

ObjectT WorldModel::iterateObjectNext int &    iIndex,
ObjectSetT    g,
double    dConf = -1.0,
bool    bForward = false
 

This method gets the next object in the iteration over an object set g. iterateObjectStart should have been called first. Only ObjectT with a confidence higher than dConf will be returned. When no more objects are available OBJECT_ILLEGAL is returned.

Parameters:
iIndex  same argument as was supplied to iterateObjectStart.
g  ObjectSetT of which the ObjecT should be returned.
dConf  minimum confidence needed for ObjectT to be returned.
Returns:
ObjectT that is next in the set g.

Definition at line 617 of file WorldModel.cpp.

References getConfidence(), getOwnGoalieType(), PlayerSettings::getPlayerConfThr(), getTimeLastSeeMessage(), getTimeLastSeen(), SoccerTypes::isInSet(), OBJECT_ILLEGAL, OBJECT_MAX_OBJECTS, OBJECT_SET_OPPONENTS, OBJECT_SET_PLAYERS, OBJECT_SET_TEAMMATES, OBJECT_SET_TEAMMATES_NO_GOALIE, OBJECT_TEAMMATE_1, ObjectSetT, ObjectT, and PS.

Referenced by calculateAngleAgentWithPos(), calculateStateAgent2(), checkParticlesAgent(), createInterceptFeatures(), drawCoordinationGraph(), getClosestInSetTo(), getClosestRelativeInSet(), getDirectionOfWidestAngle(), getFastestInSetTo(), getFirstEmptySpotInSet(), getFurthestInSetTo(), getFurthestRelativeInSet(), getListCloseOpponents(), getNrInSetInCircle(), getNrInSetInCone(), getNrInSetInRectangle(), getSecondClosestInSetTo(), getSecondClosestRelativeInSet(), isOpponentAtAngle(), iterateObjectStart(), logCoordInfo(), logDrawInfo(), logObjectInformation(), processNewObjectInfo(), removeGhosts(), show(), updateAfterSeeMessage(), updateAfterSenseMessage(), and updateRelativeFromGlobal().

ObjectT WorldModel::iterateObjectStart int &    iIndex,
ObjectSetT    g,
double    dConf = -1.0,
bool    bForward = false
 

This method starts an iteration over an object set g. This method will return the first ObjectT in an ObjectSetT that has a confidence higher than dConf. After this call use the method iterateObjectNext with the same argument to get the other objects that belong to this set.

Parameters:
iIndex  index that should be used in consecutive cycles.
g  ObjectSetT of which the ObjecT should be returned.
dConf  minimum confidence needed for ObjectT to be returned.
Returns:
ObjectT that is first in the set g.

Definition at line 602 of file WorldModel.cpp.

References iterateObjectNext(), ObjectSetT, and ObjectT.

Referenced by calculateAngleAgentWithPos(), calculateStateAgent2(), checkParticlesAgent(), createInterceptFeatures(), drawCoordinationGraph(), getClosestInSetTo(), getClosestRelativeInSet(), getDirectionOfWidestAngle(), getFastestInSetTo(), getFirstEmptySpotInSet(), getFurthestInSetTo(), getFurthestRelativeInSet(), getListCloseOpponents(), getNrInSetInCircle(), getNrInSetInCone(), getNrInSetInRectangle(), getSecondClosestInSetTo(), getSecondClosestRelativeInSet(), isOpponentAtAngle(), logCoordInfo(), logDrawInfo(), logObjectInformation(), processNewObjectInfo(), removeGhosts(), show(), updateAfterSeeMessage(), updateAfterSenseMessage(), and updateRelativeFromGlobal().

bool WorldModel::logCircle int    iLogLevel,
VecPosition    pos,
double    dRadius,
bool    bAll = false
 

Definition at line 2400 of file WorldModel.cpp.

References getAgentIndex(), getCurrentCycle(), ServerSettings::getHalfTime(), ServerSettings::getSimulatorStep(), VecPosition::getX(), VecPosition::getY(), m_colorPlayers, m_iMultX, m_iMultY, and SS.

Referenced by coordinateWith(), BasicPlayer::getActiveInterceptionPointBall(), BasicPlayer::interceptClose(), predictCommandToInterceptBall(), and updateAll().

void WorldModel::logCoordInfo int    iLogLevel
 

This method logs drawing information to the log file LogDraw. The drawing information is written in the syntax that is understood by the soccer monitor. The contents of the created file can afterwards be read by an (adapted) logplayer to show the logged information. This method logs all the information about the coordination graphs.

Parameters:
iLogLevel  loglevel that has to be passed to the Logger.

Definition at line 2342 of file WorldModel.cpp.

References getAgentObjectType(), getCurrentCycle(), VecPosition::getDistanceTo(), getGlobalPosition(), ServerSettings::getHalfTime(), SoccerTypes::getIndex(), PlayerSettings::getPlayerConfThr(), ServerSettings::getSimulatorStep(), VecPosition::getX(), VecPosition::getY(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), m_colorPlayers, m_iMultX, m_iMultY, MAX_MSG, OBJECT_BALL, OBJECT_ILLEGAL, OBJECT_SET_TEAMMATES, ObjectT, PS, and SS.

Referenced by Player::mainLoop().

bool WorldModel::logDrawBallInfo int    iLogLevel
 

Definition at line 2437 of file WorldModel.cpp.

References AngDeg, ServerSettings::getBallDecay(), getBallPos(), VecPosition::getDirection(), getGlobalVelocity(), VecPosition::getMagnitude(), VecPosition::getX(), VecPosition::getY(), m_iMultX, m_iMultY, MAX_MSG, VecPosition::normalizeAngle(), OBJECT_BALL, POLAR, and SS.

Referenced by Player::mainLoop().

void WorldModel::logDrawInfo int    iLogLevel
 

This method logs drawing information to the log file LogDraw. The drawing information is written in the syntax that is understood by the soccer monitor. The contents of the created file can afterwards be read by an (adapted) logplayer to show the logged information. The information logged in this method is all the global position information of the players on the field.

Parameters:
iLogLevel  loglevel that has to be passed to the Logger.

Definition at line 2274 of file WorldModel.cpp.

References getCurrentCycle(), getGlobalPosition(), ServerSettings::getHalfTime(), PlayerSettings::getPlayerConfThr(), getSide(), ServerSettings::getSimulatorStep(), VecPosition::getX(), VecPosition::getY(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), m_iMultX, m_iMultY, MAX_MSG, OBJECT_ILLEGAL, OBJECT_SET_OPPONENTS, OBJECT_SET_TEAMMATES, ObjectT, PS, SIDE_LEFT, and SS.

Referenced by Player::mainLoop().

bool WorldModel::logLine int    iLogLevel,
VecPosition    pos1,
VecPosition    pos2,
bool    bAll = false
 

Definition at line 2418 of file WorldModel.cpp.

References getAgentIndex(), getCurrentCycle(), ServerSettings::getHalfTime(), ServerSettings::getSimulatorStep(), VecPosition::getX(), VecPosition::getY(), m_colorPlayers, m_iMultX, m_iMultY, and SS.

Referenced by drawCoordinationGraph(), and updateAll().

void WorldModel::logObjectInformation int    iLogLevel,
ObjectT    obj
 

This method logs all object information that is currently stored in the World Model. The output is formatted as follows. First the current time (cycle_nr,cycle_stopped) is printed, followed by the object information of the specified object 'obj'. The global x and global y position are first printed, followed by the global x and global y velocity. Finally the body and the neck angle are printed. Then the information of the ball "pos_x pos_y vel_x vel_y conf" is printed, followed by the information of all eleven teammates "nr pos_x pos_y vel_x vel_y conf" and the same information about the eleven opponents. Values that are currently not known are replaced by the value -10.0000. This method is normally used by a player to log every cycle all its information contained in the world model to a file. If the coach (with perfect information) does the same, these two files can be analyzed to calculate the error for the different values.

Parameters:
iLogLevel  loglevel for which information should be printed
obj  object of which information should be printed at start line of this object also the body and neck angle are printed.

Definition at line 2190 of file WorldModel.cpp.

References getConfidence(), getCurrentCycle(), getCurrentTime(), getGlobalBodyAngle(), getGlobalNeckAngle(), getGlobalPosition(), getGlobalVelocity(), SoccerTypes::getIndex(), PlayerSettings::getPlayerConfThr(), getRelativeDistance(), getTimeFromConfidence(), getTimeGlobalVelocity(), VecPosition::getX(), VecPosition::getY(), isKnownPlayer(), SoccerTypes::isTeammate(), iterateObjectNext(), iterateObjectStart(), OBJECT_BALL, OBJECT_ILLEGAL, OBJECT_SET_PLAYERS, ObjectT, and PS.

Referenced by BasicCoach::mainLoopNormal(), and updateAll().

void WorldModel::mapUnknownPlayers Time    time
 

This method maps the information in the array of unknown players (players of which we do not know the number and/or team) to the player information located in the WorldModel. This is done by comparing the predicted position of players we haven't seen this cycle and the information of players of which we do not have the number and/or teamname.If this difference in the distance is smaller than tolerated (see PlayerSettings::getPlayerDistTolerance()), this player information is updated with the specified information.

Parameters:
time  time of the current cycle

Definition at line 2426 of file WorldModelUpdate.cpp.

References getAgentGlobalNeckAngle(), getAgentGlobalPosition(), getAgentObjectType(), getConfidence(), getCurrentTime(), VecPosition::getDistanceTo(), getFirstEmptySpotInSet(), getGlobalPosition(), getHeteroPlayerType(), SoccerTypes::getIndex(), getMaxTraveledDistance(), PlayerSettings::getPlayerDistTolerance(), getRelativeAngle(), Object::getRelativeDistance(), getRelativeDistance(), Time::getTime(), getTimeLastSeen(), Time::getTimeStopped(), Object::getType(), ServerSettings::getVisibleDistance(), VecPosition::getX(), VecPosition::getY(), iNrUnknownPlayers, isConfidenceGood(), SoccerTypes::isKnownPlayer(), SoccerTypes::isOpponent(), SoccerTypes::isTeammate(), MAX_OPPONENTS, MAX_TEAMMATES, VecPosition::normalizeAngle(), OBJECT_ILLEGAL, OBJECT_OPPONENT_UNKNOWN, OBJECT_PLAYER_UNKNOWN, OBJECT_SET_OPPONENTS, OBJECT_SET_PLAYERS, OBJECT_SET_TEAMMATES, OBJECT_TEAMMATE_UNKNOWN, ObjectT, Opponents, POLAR, PS, PlayerObject::setHeteroPlayerType(), Object::setType(), show(), SS, Teammates, and UnknownPlayers.

Referenced by updateAfterSeeMessage().

VecPosition WorldModel::predictAgentPos int    iCycles,
int    iDashPower = 0
 

This method predicts the position of the agent after 'iCycles' when every cycle is dashed with 'iDashPower'. The method 'predictGlobalPosAfterNrCycles' is used to calculate this position.

Parameters:
iCycles  number of cycles
iDashPower  dash power that is passed
Returns:
VecPosition indicating predicted global position of agent.

Definition at line 311 of file WorldModelPredict.cpp.

References getAgentObjectType(), and predictPosAfterNrCycles().

Referenced by BasicPlayer::freezeBall(), BasicPlayer::interceptClose(), BasicPlayer::interceptCloseGoalie(), BasicPlayer::kickBallCloseToBody(), BasicPlayer::kickTo(), BasicPlayer::moveToPos(), Player::sayBallStatus(), BasicPlayer::turnBackToPoint(), and BasicPlayer::turnBodyToPoint().

VecPosition WorldModel::predictAgentPosAfterCommand SoccerCommand    com
 

This method returns the global position of the agent after the specified command is performed. This method makes use of the method 'predictAgentInfoAfterCommand'

Parameters:
com  SoccerCommand that will be performed.
Returns:
VecPosition new global position of the agent.

Definition at line 156 of file WorldModelPredict.cpp.

References AngDeg, and predictAgentStateAfterCommand().

Referenced by Player::amIAgentToSaySomething(), BasicPlayer::collideWithBall(), BasicPlayer::holdBall(), and BasicPlayer::turnWithBallTo().

bool WorldModel::predictAgentStateAfterCommand SoccerCommand    com,
VecPosition   pos,
VecPosition   vel,
AngDeg   angGlobalBody,
AngDeg   angGlobalNeck,
Stamina   sta
 

This method predicts the state of the agent after it performs a specific SoccerCommand. This method makes use of the method predictInfoAfterCommand. All arguments are initialized with the current values of the agent.

Parameters:
com  SoccerCommand that will be performed
pos  will be filled with updated position of agent
vel  will be filled with updated velocity of agent
angGlobalBody  will be filled with global body angle of agent
angGlobalBody  will be filled with global neck angle of agent
current  will be filled with stamina information of agent
Returns:
boolean which indicates whether values were updated

Definition at line 110 of file WorldModelPredict.cpp.

References AngDeg, getAgentGlobalBodyAngle(), getAgentGlobalNeckAngle(), getAgentGlobalPosition(), getAgentGlobalVelocity(), getAgentObjectType(), getAgentStamina(), and predictStateAfterCommand().

Referenced by BasicPlayer::interceptClose(), BasicPlayer::interceptCloseGoalie(), isCollisionAfterCommand(), predictAgentPosAfterCommand(), predictObjectStateAfterCommand(), and BasicPlayer::turnNeckToPoint().

void WorldModel::predictBallInfoAfterCommand SoccerCommand    soc,
VecPosition   pos = NULL,
VecPosition   vel = NULL
 

Definition at line 224 of file WorldModelPredict.cpp.

References AngDeg, CMD_KICK, SoccerCommand::commandType, SoccerCommand::dAngle, SoccerCommand::dPower, getActualKickPowerRate(), getAgentGlobalBodyAngle(), ServerSettings::getBallDecay(), ServerSettings::getBallSpeedMax(), getGlobalPosition(), getGlobalVelocity(), VecPosition::getMagnitude(), VecPosition::normalizeAngle(), OBJECT_BALL, POLAR, VecPosition::setMagnitude(), and SS.

Referenced by Player::amIAgentToSaySomething(), BasicPlayer::freezeBall(), isCollisionAfterCommand(), BasicPlayer::kickTo(), Player::sayBallStatus(), and updateBallAfterKick().

SoccerCommand WorldModel::predictCommandToInterceptBall ObjectT    obj,
SoccerCommand    socClose,
int *    iCycles = NULL,
VecPosition   posIntercept = NULL,
VecPosition   posIn = NULL,
VecPosition   velIn = NULL,
AngDeg   angBodyIn = NULL
 

This command returns the command for object 'obj' to intercept the ball. It needs the command 'socClose' as the command to intercept a close ball (may be CMD_ILLEGAL). 'iCycles' will be filled with the number of cycles to get to this ball position and 'posIntercept' will be filled with the final interception point. When posIn, velInn, angBody are equal to NULL, the agent information is used in the calculations.

Definition at line 715 of file WorldModelPredict.cpp.

References AngDeg, CMD_ILLEGAL, SoccerCommand::commandType, FEATURE_INTERCEPTION_POINT_BALL, FeatureT, getAgentObjectType(), getAgentStamina(), Feature::getCommand(), getCurrentCycle(), getCurrentTime(), VecPosition::getDistanceTo(), getFeature(), getGlobalBodyAngle(), getGlobalNeckAngle(), getGlobalPosition(), getGlobalVelocity(), Feature::getInfo(), VecPosition::getMagnitude(), getMaximalKickDist(), getPlayerSpeedMax(), PlayerSettings::getPlayerWhenToIntercept(), getTimeLastHearMessage(), getTimeLastSeeMessage(), getTimeLastSenseMessage(), VecPosition::getX(), VecPosition::getY(), isDeadBallUs(), isFeatureRelevant(), isGoalKickUs(), SoccerCommand::isIllegal(), isInField(), logCircle(), max(), min(), OBJECT_BALL, OBJECT_ILLEGAL, ObjectT, predictCommandToMoveToPos(), predictPosAfterNrCycles(), predictStateAfterCommand(), PS, setFeature(), VecPosition::setVecPosition(), UnknownDoubleValue, and UnknownIntValue.

Referenced by BasicPlayer::intercept().

SoccerCommand WorldModel::predictCommandToMoveToPos ObjectT    obj,
VecPosition    posTo,
int    iCycles,
double    dDistBack = 2.5,
bool    bMoveBack = false,
VecPosition   posIn = NULL,
VecPosition   velIn = NULL,
AngDeg   angBodyIn = NULL
 

This method returns the command to move to a position, first it checks whether a turn is necessary. When this is the case, it performs the turn. Otherwise a dash command is generated to move in 'iCycles' cycles to the point 'posTo'.

Definition at line 686 of file WorldModelPredict.cpp.

References AngDeg, CMD_DASH, getAgentEffort(), getGlobalBodyAngle(), getGlobalPosition(), getGlobalVelocity(), getPowerForDash(), SoccerCommand::isIllegal(), ObjectT, and predictCommandTurnTowards().

Referenced by predictCommandToInterceptBall(), and predictNrCyclesToPoint().

SoccerCommand WorldModel::predictCommandTurnTowards ObjectT    obj,
VecPosition    posTo,
int    iCycles,
double    dDistBack,
bool    bMoveBack,
VecPosition   posIn = NULL,
VecPosition   velIn = NULL,
AngDeg   angBodyIn = NULL
 

This method returns the command for object 'obj' to turn towards a point 'posTo' on the field when it has 'iCycles' to reach that point. If the point is within 'dDistBack' behind the object it will try to dash backwards. In the case that 'bMoveBack' is true, it will always try to move backwards. When posIn, velIn and angBodyIn are equal to NULL, the current agent information is used.

Definition at line 588 of file WorldModelPredict.cpp.

References AngDeg, CMD_TURN, SoccerCommand::dAngle, getAngleForTurn(), VecPosition::getDirection(), VecPosition::getDistanceTo(), Line::getDistanceWithPoint(), getGlobalBodyAngle(), getGlobalNeckAngle(), getGlobalPosition(), getGlobalVelocity(), getInertiaMoment(), VecPosition::getMagnitude(), getMaximalKickDist(), PlayerSettings::getPlayerWhenToTurnAngle(), Line::makeLineFromPositionAndAngle(), min(), VecPosition::normalizeAngle(), ObjectT, predictPosAfterNrCycles(), predictStateAfterTurn(), and PS.

Referenced by predictCommandToMoveToPos().

VecPosition WorldModel::predictFinalAgentPos VecPosition   pos = NULL,
VecPosition   vel = NULL
 

This method predicts the final position of the agent when no commands are issued, but the agent just rolls out.

Returns:
VecPosition indicating predicted final global position of agent.

Definition at line 319 of file WorldModelPredict.cpp.

References getAgentGlobalPosition(), getAgentGlobalVelocity(), VecPosition::getDirection(), VecPosition::getMagnitude(), ServerSettings::getPlayerDecay(), Geometry::getSumInfGeomSeries(), POLAR, and SS.

Referenced by BasicPlayer::directTowards(), and BasicPlayer::moveToPos().

int WorldModel::predictNrCyclesForDistance ObjectT    o,
double    dDist,
double    dSpeed
 

This method check how many cycles are needed for object 'o' to travel a distance 'dDist' when it currently has a speed 'dSpeed'.

Definition at line 331 of file WorldModelPredict.cpp.

References EPSILON, getDashPowerRate(), getMaximalKickDist(), ServerSettings::getMaxPower(), getPlayerDecay(), ServerSettings::getPlayerSpeedMax(), max(), ObjectT, and SS.

Referenced by predictNrCyclesToPoint().

int WorldModel::predictNrCyclesToObject ObjectT    objFrom,
ObjectT    objTo
 

This method returns the number of cycles it will take the object 'objFrom' to reach the object 'objTo' (usually respectively the player and the ball).

Parameters:
objFrom  ObjectT that is the object that wants to move
objTo  ObjectT to which is moved
Returns:
number of cycles it will take objFrom to move to objTo

Definition at line 481 of file WorldModelPredict.cpp.

References createInterceptFeatures(), EPSILON, FEATURE_INTERCEPT_CYCLES_ME, FeatureT, getAgentObjectType(), getBallPos(), getBallSpeed(), getCurrentCycle(), VecPosition::getDistanceTo(), getFeature(), getGlobalPosition(), Feature::getInfo(), ServerSettings::getPlayerSpeedMax(), PlayerSettings::getPlayerWhenToIntercept(), isFeatureRelevant(), max(), OBJECT_BALL, OBJECT_ILLEGAL, ObjectT, predictNrCyclesToPoint(), predictPosAfterNrCycles(), PS, SS, and UnknownDoubleValue.

int WorldModel::predictNrCyclesToPoint ObjectT    o,
VecPosition    posTo
 

This method gives an estimate for the number of cycles a player needs to reach a specific position. A position is reached when the player is located in the maximal kick distance of this position. When this is not the case a dash (or turn) is performed until the player is in the kickable distance.

Parameters:
o  objectT which wants to reach posTo
posTo  global position which has to be reached
angToTurn  angle to 'posTo' when is turned (instead of dashed)
Returns:
predicted nr of cycles for o to reach posTo

Definition at line 371 of file WorldModelPredict.cpp.

References AngDeg, CMD_DASH, CMD_TURN, SoccerCommand::commandType, SoccerCommand::dPower, getAgentGlobalBodyAngle(), getAgentGlobalPosition(), getAgentGlobalVelocity(), getAgentObjectType(), getCurrentCycle(), VecPosition::getDistanceTo(), getGlobalBodyAngle(), getGlobalBodyAngleLastSee(), getGlobalPositionLastSee(), getGlobalVelocityLastSee(), VecPosition::getMagnitude(), getMaximalKickDist(), SoccerTypes::getObjectStr(), Time::getTime(), getTimeChangeInformation(), getTimeGlobalPositionLastSee(), VecPosition::getX(), SoccerTypes::isOpponent(), max(), VecPosition::normalizeAngle(), ObjectT, POLAR, predictCommandToMoveToPos(), predictNrCyclesForDistance(), predictStateAfterCommand(), VecPosition::rotate(), and VecPosition::setVecPosition().

Referenced by createInterceptFeatures(), Player::executeStringCommand(), BasicPlayer::getEndSpeedForPass(), getFastestInSetTo(), and predictNrCyclesToObject().

bool WorldModel::predictObjectStateAfterCommand ObjectT    obj,
SoccerCommand    com,
VecPosition   pos,
VecPosition   vel,
AngDeg   angGlobalBody,
AngDeg   angGlobalNeck,
Stamina   sta
 

This method predicts the state of the agent after it performs a specific SoccerCommand. This method makes use of the method predictInfoAfterCommand. All arguments are initialized with the current values of the agent.

Parameters:
com  SoccerCommand that will be performed
pos  will be filled with updated position of agent
vel  will be filled with updated velocity of agent
angGlobalBody  will be filled with global body angle of agent
angGlobalBody  will be filled with global neck angle of agent
current  will be filled with stamina information of agent
Returns:
boolean which indicates whether values were updated

Definition at line 135 of file WorldModelPredict.cpp.

References AngDeg, getAgentObjectType(), getGlobalBodyAngle(), getGlobalNeckAngle(), getGlobalPosition(), getGlobalVelocity(), ObjectT, predictAgentStateAfterCommand(), and predictStateAfterCommand().

VecPosition WorldModel::predictPosAfterNrCycles ObjectT    o,
double    dCycles,
int    iDashPower = 100,
VecPosition   posIn = NULL,
VecPosition   velIn = NULL,
bool    bUpdate = true
 

This method determines the global position of the object o after iCycles When the object is the ball, only the decay of the ball is taken into account. When the object is a player it is assumed that the player dashes with 'iDashPower' every cycle.

Parameters:
o  objectT of which global position will be predicted
iCycles  pos is predicted after this number of cycles
iDashPower  dash power that is used every cycle in dash (default 100)
vel  will be filled with predicted global velocity after iCycles
Returns:
predicted global position after iCycles.

Definition at line 263 of file WorldModelPredict.cpp.

References getAgentGlobalBodyAngle(), getAgentObjectType(), getAgentStamina(), ServerSettings::getBallDecay(), getCurrentTime(), VecPosition::getDirection(), getGlobalBodyAngle(), getGlobalPosition(), getGlobalVelocity(), VecPosition::getMagnitude(), Geometry::getSumGeomSeries(), getTimeGlobalAngles(), SoccerTypes::isKnownPlayer(), OBJECT_BALL, ObjectT, POLAR, predictStateAfterDash(), and SS.

Referenced by BasicPlayer::collideWithBall(), createInterceptFeatures(), BasicPlayer::getActiveInterceptionPointBall(), getFastestInSetTo(), BasicPlayer::getInterceptionPointBall(), getStrategicPosition(), BasicPlayer::holdBall(), BasicPlayer::interceptClose(), BasicPlayer::interceptCloseGoalie(), isBallHeadingToGoal(), isCollisionAfterCommand(), predictAgentPos(), predictCommandToInterceptBall(), predictCommandTurnTowards(), predictNrCyclesToObject(), BasicPlayer::turnBodyToObject(), BasicPlayer::turnNeckToObject(), BasicPlayer::turnWithBallTo(), and updateAll().

void WorldModel::predictStaminaAfterDash double    dPower,
Stamina   stamina
 

This method updates all the stamina variables using the calculations from the soccer manual. It is not really important since stamina is read from sense_body every cycle. That information is more up to date.

Parameters:
power  of last dash command
stamina  pointer to all stamina values, will change to new value
Returns:
stamina class will be updated to new stamina values

Definition at line 543 of file WorldModelPredict.cpp.

References Stamina::getEffort(), ServerSettings::getEffortDec(), ServerSettings::getEffortDecThr(), ServerSettings::getEffortInc(), ServerSettings::getEffortIncThr(), ServerSettings::getEffortMin(), ServerSettings::getRecoverDec(), ServerSettings::getRecoverDecThr(), ServerSettings::getRecoverMin(), Stamina::getRecovery(), Stamina::getStamina(), ServerSettings::getStaminaIncMax(), ServerSettings::getStaminaMax(), Stamina::setEffort(), Stamina::setRecovery(), Stamina::setStamina(), and SS.

Referenced by predictStateAfterDash().

bool WorldModel::predictStateAfterCommand SoccerCommand    com,
VecPosition   pos,
VecPosition   vel,
AngDeg   angGlobalBody,
AngDeg   angGlobalNeck,
ObjectT    obj = OBJECT_ILLEGAL,
Stamina   sta = NULL
 

This method predicts the state of an player after it performs a specific SoccerCommand. The current state of the agent is passed by giving the position, velocity and body and neck direction. These arguments are updated and after return of this method will contain the new values as if the command was performed.

Parameters:
com  SoccerCommand that will be performed
pos  current position of the object.
vel  current velocity of the object
angGlobalBody  global body angle
angGlobalBody  global neck angle
current  stamina information.
Returns:
boolean which indicates whether values were updated

Definition at line 66 of file WorldModelPredict.cpp.

References AngDeg, CMD_CATCH, CMD_DASH, CMD_ILLEGAL, CMD_KICK, CMD_MOVE, CMD_TACKLE, CMD_TURN, CMD_TURNNECK, SoccerCommand::commandType, SoccerCommand::dAngle, SoccerCommand::dPower, SoccerCommand::dX, SoccerCommand::dY, VecPosition::normalizeAngle(), ObjectT, predictStateAfterDash(), predictStateAfterTurn(), VecPosition::setMagnitude(), and VecPosition::setVecPosition().

Referenced by predictAgentStateAfterCommand(), predictCommandToInterceptBall(), predictNrCyclesToPoint(), predictObjectStateAfterCommand(), and updateAgentAndBallAfterSense().

void WorldModel::predictStateAfterDash double    dActualPower,
VecPosition   pos,
VecPosition   vel,
Stamina   sta,
double    dDirection,
ObjectT    obj = OBJECT_ILLEGAL
 

This method determines the state of a player after a dash command is performed. The current state of the player is specified by the passed arguments. After this method returns, all arguments are updated.

Parameters:
pos  initial position, will be changed to the predicted position
vel  intital velocity, will be changed to the predicted velocity
dActualPower  actual power that is send with dash command
sta  pointer to stamina, when not NULL, effort is used and updated
dDirection  direction of dash

Definition at line 173 of file WorldModelPredict.cpp.

References getDashPowerRate(), Stamina::getEffort(), getEffortMax(), VecPosition::getMagnitude(), getPlayerDecay(), ServerSettings::getPlayerSpeedMax(), VecPosition::getVecPositionFromPolar(), VecPosition::normalizeAngle(), ObjectT, predictStaminaAfterDash(), VecPosition::setMagnitude(), and SS.

Referenced by BasicPlayer::getActiveInterceptionPointBall(), BasicPlayer::getInterceptionPointBall(), BasicPlayer::interceptCloseGoalie(), predictPosAfterNrCycles(), predictStateAfterCommand(), predictStateAfterTurn(), and updateAgentAndBallAfterSense().

void WorldModel::predictStateAfterTurn AngDeg    dSendAngle,
VecPosition   pos,
VecPosition   vel,
AngDeg   angBody,
AngDeg   angNeck,
ObjectT    obj = OBJECT_ILLEGAL,
Stamina   sta = NULL
 

This method determines the state of a player after a turn command is performed. The global position is updated with the velocity and the velocity is updated. Then the actual turn angle is calculated taken the inertia into account. This actual turn angle is used to update both the global body and global neck direction.

Parameters:
dSendAngle  actual angle given in command
pos  initial position, will be changed to the predicted position
vel  intital velocity, will be changed to the predicted velocity
angBody  global body direction
angNeck  global neck direction
sta  Stamina of player can be NULL

Definition at line 209 of file WorldModelPredict.cpp.

References AngDeg, getActualTurnAngle(), VecPosition::getMagnitude(), VecPosition::normalizeAngle(), ObjectT, and predictStateAfterDash().

Referenced by BasicPlayer::directTowards(), BasicPlayer::getActiveInterceptionPointBall(), BasicPlayer::getInterceptionPointBall(), BasicPlayer::interceptClose(), predictCommandTurnTowards(), and predictStateAfterCommand().

void WorldModel::processCatchedBall RefereeMessageT    rm,
Time    time
 

This method sets the catch cycle time for the goalie. This is the cycle time that the ball is catched by the goalie. This information is said by the referee by indicating the side that catched the ball. This method checks whether our side catched the ball. If this is the case, the time is set and the goalie cannot catch the ball for a certain cycles (see ServerSettings).

Parameters:
rm  referee message to indicated side of goalie that catched ball
iTime  time the ball was catched.

Definition at line 596 of file WorldModelUpdate.cpp.

References Ball, getCurrentTime(), REFC_GOALIE_CATCH_BALL_LEFT, REFC_GOALIE_CATCH_BALL_RIGHT, RefereeMessageT, DynamicObject::setGlobalVelocity(), SIDE_LEFT, SIDE_RIGHT, sideSide, and timeLastCatch.

Referenced by SenseHandler::analyzeHearMessage().

void WorldModel::processLastSeeMessage   [private]
 

Definition at line 844 of file WorldModelUpdate.cpp.

References AngDeg, getAgentObjectType(), getMaxRangeUnknownPlayer(), SoccerTypes::getObjectFromStr(), getSide(), getTeamName(), getTimeLastSeeMessage(), Parse::gotoFirstOccurenceOf(), SoccerTypes::isKnownPlayer(), SoccerTypes::isOpponent(), SoccerTypes::isPlayer(), SoccerTypes::isTeammate(), MAX_MSG, OBJECT_ILLEGAL, OBJECT_OPPONENT_1, OBJECT_OPPONENT_11, OBJECT_OPPONENT_UNKNOWN, OBJECT_TEAMMATE_1, OBJECT_TEAMMATE_11, OBJECT_TEAMMATE_UNKNOWN, ObjectT, Parse::parseFirstDouble(), Parse::parseFirstInt(), processNewObjectInfo(), SIDE_LEFT, strLastSeeMessage, UnknownAngleValue, and UnknownDoubleValue.

Referenced by updateAfterSeeMessage().

void WorldModel::processLastSenseMessage   [private]
 

Definition at line 1110 of file WorldModelUpdate.cpp.

References AngDeg, CMD_ATTENTIONTO, CMD_CATCH, CMD_CHANGEVIEW, CMD_DASH, CMD_KICK, CMD_MOVE, CMD_POINTTO, CMD_SAY, CMD_TACKLE, CMD_TURN, CMD_TURNNECK, SoccerTypes::getTeammateObjectFromIndex(), SoccerTypes::getViewAngleFromStr(), SoccerTypes::getViewQualityFromStr(), Parse::gotoFirstOccurenceOf(), VecPosition::normalizeAngle(), Parse::parseFirstDouble(), Parse::parseFirstInt(), POLAR, processNewAgentInfo(), setNrOfCommands(), setObjectFocus(), strLastSenseMessage, ViewAngleT, and ViewQualityT.

Referenced by updateAfterSenseMessage().

bool WorldModel::processNewAgentInfo ViewQualityT    vq,
ViewAngleT    va,
double    dStamina,
double    dEffort,
double    dSpeed,
AngDeg    angSpeed,
AngDeg    angHeadAngle,
int    iTackleExpires,
int    iArmMovable,
int    iArmExpires,
VecPosition    posArm
 

This method is called when new visual information about the agent is received. It updates the information of the AgentObject stored in the WorldModel.

Parameters:
vq  new ViewQuality for the agent
va  new ViewAngle for the agent
dStamina  new stamina for the agent
dEffort  new effort for the agent
dSpeed  magnitude of the velocity
angSpeed  angle of the speed velocity (relative to neck)
angHeadAngle  new relative angle between body and neck
iTackleExpire  number of cycles before tackle expires
iArmMovable  indicates whether arm is movable
iArmExpires  number of cycles before arm expires
posArm  relative position to which arm is pointed
Returns:
bool indicating whether update was succesful

Definition at line 121 of file WorldModelUpdate.cpp.

References agentObject, AngDeg, getAgentGlobalPosition(), AgentObject::getStamina(), POLAR, AgentObject::setArmExpires(), AgentObject::setArmMovable(), AgentObject::setBodyAngleRelToNeck(), Stamina::setEffort(), AgentObject::setGlobalArmPosition(), AgentObject::setSpeedRelToNeck(), AgentObject::setStamina(), Stamina::setStamina(), AgentObject::setTackleExpires(), AgentObject::setViewAngle(), AgentObject::setViewQuality(), VA_ILLEGAL, ViewAngleT, ViewQualityT, and VQ_ILLEGAL.

Referenced by SenseHandler::analyzeFullStateMessage(), and processLastSenseMessage().

bool WorldModel::processNewHeteroPlayer int    iIndex,
double    dPlayerSpeedMax,
double    dStaminaIncMax,
double    dPlayerDecay,
double    dInertiaMoment,
double    dDashPowerRate,
double    dPlayerSize,
double    dKickableMargin,
double    dKickRand,
double    dExtraStamina,
double    dEffortMax,
double    dEffortMin
 

This methods fills the heterogeneous player array (stored as 'pt') with the specified information. This information is directly parsed from the player_type message received from the server. This method is therefore only called from the SenseHandler. The information in this array can later be used (by the coach) to determine the best heterogeneous player for a specific position on the field and to update the parameters in the ServerSettings when the player type of the agent is changed.

Parameters:
iIndex  index of the heterogeneous player as indicated by the server
dPlayerSpeedMax  maximum speed of the player
dStaminaIncMax  maximum increase of stamina for the player
dPlayerDecay  amount of velocity decay of the player
dIntertiaMoment  indication how fast is turned when moving
dDashPowerRate  how is power in dash command converted into speed
dPlayerSize  what is the size of the player
dKickableMarng  in which area can player still kick the ball
dKickRand  how much noise is added to kick command
dExtraStamina  how much extra stamina does player receive
dEffortMax  what is the maximum effort (effective dash)
dEffortMin  what is the minimum effort
Returns:
bool indicating whether update was succesfull.

Definition at line 563 of file WorldModelUpdate.cpp.

References HeteroPlayerSettings::dDashPowerRate, HeteroPlayerSettings::dEffortMax, HeteroPlayerSettings::dEffortMin, HeteroPlayerSettings::dExtraStamina, HeteroPlayerSettings::dInertiaMoment, HeteroPlayerSettings::dKickableMargin, HeteroPlayerSettings::dKickRand, HeteroPlayerSettings::dMaximalKickDist, HeteroPlayerSettings::dPlayerDecay, HeteroPlayerSettings::dPlayerSize, HeteroPlayerSettings::dPlayerSpeedMax, HeteroPlayerSettings::dStaminaIncMax, ServerSettings::getBallSize(), pt, and SS.

Referenced by SenseHandler::analyzePlayerTypeMessage().

void WorldModel::processNewObjectInfo ObjectT    o,
Time    time,
double    dDist,
int    iDir,
double    dDistChange,
double    dDirChange,
AngDeg    angRelBodyAng,
AngDeg    angRelNeckAng,
bool    isGoalie,
ObjectT    objMin,
ObjectT    objMax,
double    dPointDir,
bool    isTackling
 

This method is called when new visual information about other objects on the field is received. It updates the information of the Object that corresponds to the ObjectT that is supplied as the first argument. If some of the arguments are not received with the visual information, they are passed with the value 'UnknownDoubleValue'. Note that the objects are only updated with the (relative) information passed as arguments. To make sure all global information in the objects is synchronized with the relative information, the method updateAll() has to be called after all (relative) object information is updated.

Parameters:
o  objectType that should be updated
time  time of the corresponding values
dDist  distance from agent to this object o
iDir  angle from agent with this object o (relative to neck)
dDistChange  distance change between agent and this object o
dDirChange  angle change between agent and this object o
angRelBodyAng  angle between neck of agent and body of object o
angRelNeckAng  angle between neck of agent and neck of object o
isGoalie  bool indicating whether object is a goalie
dPointDir  pointing direction of arm of observed player
isTackling  bool indicating whether object is tackling
Returns:
bool indicating whether update was succesful

Definition at line 170 of file WorldModelUpdate.cpp.

References AngDeg, Flags, getAgentObjectType(), getCurrentTime(), SoccerTypes::getIndex(), getMaxTraveledDistance(), getObjectPtrFromType(), PlayerSettings::getPlayerDistTolerance(), Object::getRelativePosition(), getRelativePosition(), ServerSettings::getTackleCycles(), iNrUnknownPlayers, SoccerTypes::isBall(), SoccerTypes::isFlag(), isKnownPlayer(), SoccerTypes::isKnownPlayer(), SoccerTypes::isLine(), SoccerTypes::isOpponent(), SoccerTypes::isPlayer(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), Lines, OBJECT_ILLEGAL, OBJECT_SET_OPPONENTS, OBJECT_SET_TEAMMATES, ObjectSetT, ObjectT, PS, DynamicObject::setRelativeAngleChange(), DynamicObject::setRelativeDistanceChange(), Object::setRelativePosition(), Object::setTimeLastSeen(), Object::setType(), SS, UnknownAngleValue, UnknownDoubleValue, and UnknownPlayers.

Referenced by processLastSeeMessage().

bool WorldModel::processPerfectHearInfo ObjectT    o,
VecPosition    posGlobal,
double    dConf,
bool    bIsGoalie = 0
 

This method is called when new information about an object is heard. But only when the player who said the message was completely sure about the object type (it would not give information about a player it does not know the player number of, then it would call processUnsureHearInfo). It updates the information of the specified object only when the confidence is higher than the information already available in the WorldModel.

Parameters:
o  object type to which this information relates to
posGlobal  global position of this object type.
dConf  confidence in the object information.
bIsGoalie  boolean indicating whether 'o' is a goalie
Returns:
true when information is updated, false otherwise

Definition at line 453 of file WorldModelUpdate.cpp.

References getAgentObjectType(), Object::getConfidence(), getCurrentTime(), PlayerObject::getIsKnownPlayer(), getObjectPtrFromType(), getTimeFromConfidence(), SoccerTypes::isBall(), SoccerTypes::isKnownPlayer(), ObjectT, processUnsureHearInfo(), Object::setGlobalPosition(), DynamicObject::setGlobalVelocity(), PlayerObject::setIsGoalie(), PlayerObject::setIsKnownPlayer(), setTimeLastHearMessage(), Object::setTimeLastSeen(), and updateObjectRelativeFromGlobal().

Referenced by processPlayerMessage(), and processUnsureHearInfo().

bool WorldModel::processPerfectHearInfoBall VecPosition    posGlobal,
VecPosition    vel,
double    dConf
 

This method is called when new information about the ball is heard. It updates the information of the ball only when the confidence is higher than the information already available in the WorldModel.

Parameters:
posGlobal  global position of the ball
vel  global velocity of the ball
dConf  confidence in the ball information
Returns:
true when information is updated, false otherwise

Definition at line 423 of file WorldModelUpdate.cpp.

References Ball, Object::getConfidence(), getConfidence(), getCurrentTime(), VecPosition::getDistanceTo(), getGlobalVelocity(), Time::getTime(), getTimeFromConfidence(), getTimeLastSeen(), OBJECT_BALL, Object::setGlobalPosition(), DynamicObject::setGlobalVelocity(), setTimeLastHearMessage(), Object::setTimeLastSeen(), and updateObjectRelativeFromGlobal().

Referenced by processPlayerMessage().

bool WorldModel::processPlayerMessage  
 

This method processes a communication message from a teammate.

Definition at line 310 of file WorldModelUpdate.cpp.

References ServerSettings::getBallDecay(), getCurrentCycle(), getCurrentTime(), VecPosition::getDistanceTo(), getGlobalVelocity(), SoccerTypes::getOpponentObjectFromIndex(), getRelativeDistance(), Time::getTime(), getTimeChangeInformation(), getTimeLastSeen(), ServerSettings::getVisibleDistance(), VecPosition::getX(), VecPosition::getY(), m_dCommOffsideX, m_iCycleInMsg, m_strPlayerMsg, m_timeCommOffsideX, MAX_MSG, OBJECT_BALL, ObjectT, Parse::parseFirstInt(), processPerfectHearInfo(), processPerfectHearInfoBall(), and SS.

Referenced by updateAll().

void WorldModel::processQueuedCommands SoccerCommand    commands[],
int    iCommands
 

This method sets the performed commands by the agent object. Using this information, the future world states can be calculated when an update is performed. In this method a timestamp of the current time cycle is added to the commands structure for later usage. This method is called by the ActHandler when it has sent these commands to the server.

Parameters:
commands  all the commands that were sent in this cycle
iCommands  number of commands that were sent in this cycle.

Definition at line 613 of file WorldModelUpdate.cpp.

References CMD_MAX_COMMANDS, SoccerCommand::commandType, getCurrentTime(), queuedCommands, and SoccerCommand::time.

Referenced by ActHandler::sendCommands().

bool WorldModel::processRecvThink bool    b
 

Definition at line 396 of file WorldModelUpdate.cpp.

References bNewInfo, cond_newInfo, ServerSettings::getSynchMode(), m_bRecvThink, mutex_newInfo, and SS.

Referenced by SenseHandler::analyzeMessage(), and Player::mainLoop().

void WorldModel::processSeeGlobalInfo ObjectT    o,
Time    time,
VecPosition    pos,
VecPosition    vel,
AngDeg    angBody,
AngDeg    angNeck
 

This method is called when new visual information about objects on the field is received from the see_global message (only the coach receives these messages). This method updates the information of the Object that corresponds to the ObjectT that is supplied as the first argument.

Parameters:
o  objectType that should be updated
time  time of the corresponding values
pos  global position of this object
vel  global velocity of this object
angBody  body angle of this object
angNeck  neck angle of this object

Definition at line 75 of file WorldModelUpdate.cpp.

References AngDeg, getObjectPtrFromType(), SoccerTypes::isBall(), SoccerTypes::isPlayer(), VecPosition::normalizeAngle(), OBJECT_ILLEGAL, ObjectT, PlayerObject::setGlobalBodyAngle(), PlayerObject::setGlobalNeckAngle(), Object::setGlobalPosition(), Object::setGlobalPositionLastSee(), DynamicObject::setGlobalVelocity(), PlayerObject::setIsKnownPlayer(), DynamicObject::setTimeChangeInformation(), and Object::setTimeLastSeen().

Referenced by SenseHandler::analyzeFullStateMessage(), SenseHandler::analyzeHearMessage(), and SenseHandler::analyzeSeeGlobalMessage().

bool WorldModel::processUnsureHearInfo ObjectT    o,
VecPosition    pos,
double    dConf
 

This method is called when new information about an object is heard. But only when the player who said the message was not sure about the object type. It is tried to map the given information to an object already in the WorldModel. If we cannot find such a player, we add the player info at the position of the first player who we don't have information about. The information of the specified object is only updated when the confidence is higher than the information already available in the WorldModel.

Parameters:
o  object type to which this information relates to
pos  global position of this object type.
dConf  confidence in the object information.
Returns:
true when information is updated, false otherwise

Definition at line 498 of file WorldModelUpdate.cpp.

References getAgentGlobalPosition(), getAgentObjectType(), getClosestInSetTo(), VecPosition::getDistanceTo(), getFirstEmptySpotInSet(), PlayerSettings::getPlayerDistTolerance(), SoccerTypes::isKnownPlayer(), SoccerTypes::isOpponent(), SoccerTypes::isTeammate(), OBJECT_ILLEGAL, OBJECT_OPPONENT_UNKNOWN, OBJECT_SET_OPPONENTS, OBJECT_SET_TEAMMATES, OBJECT_TEAMMATE_UNKNOWN, ObjectT, processPerfectHearInfo(), PS, and setIsKnownPlayer().

Referenced by processPerfectHearInfo().

void WorldModel::removeGhosts  
 

This method removes ghosts from the WorldModel. Ghosts are objects that should have been seen in the last see message but aren't. Currently only the ball is removed from the WorldMOdel.

Definition at line 2653 of file WorldModelUpdate.cpp.

References agentObject, AngDeg, Ball, getAgentGlobalNeckAngle(), getAgentGlobalPosition(), getClosestInSetTo(), getCurrentTime(), VecPosition::getDistanceTo(), getGlobalBodyAngle(), getGlobalPosition(), SoccerTypes::getHalfViewAngleValue(), SoccerTypes::getIndex(), getMaxTraveledDistance(), getObjectPtrFromType(), getOppGoalieType(), getRelativeAngle(), getRelativeDistance(), Time::getTime(), getTimeGlobalAngles(), Object::getTimeGlobalPosition(), getTimeLastSeeMessage(), getTimeLastSeen(), AgentObject::getViewAngle(), ServerSettings::getVisibleDistance(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), VecPosition::normalizeAngle(), OBJECT_BALL, OBJECT_ILLEGAL, OBJECT_SET_OPPONENTS, OBJECT_SET_TEAMMATES, ObjectT, POLAR, Object::setGlobalPosition(), setTimeLastSeen(), Object::setTimeLastSeen(), SS, and updateObjectRelativeFromGlobal().

Referenced by updateAfterSeeMessage().

void WorldModel::resampleParticlesAgent int    iLeft [private]
 

This method resamples the particles that represent the global position of the agent. 'iLength' denotes the number of particles contained in 'posArray' and 'iLeft' the points that do do not have to be resampled. A particle is resampled by taking a random particle from the first part of the array.

Parameters:
iLeft  number of particles that should be contained

Definition at line 1838 of file WorldModelUpdate.cpp.

References iNrParticlesAgent, and particlesPosAgent.

Referenced by calculateStateAgent().

void WorldModel::resampleParticlesBall VecPosition    posArray[],
VecPosition    velArray[],
int    iLength,
int    iLeft
[private]
 

This method resamples all particles that represent the global position and global velocity of the ball. This is by copying existing legal particles at random. Since noise will be added to each particle, they will blur each time the particles are updated. The first 'iLeft' particles are legal particles and copied to the position at the end of the array.

Parameters:
posArray  array that contains the position particles
velArray  array that contains the velocity particles
iLength  number of particles that have to be checked.
iLeft  number of particles that are legal

Definition at line 3004 of file WorldModelUpdate.cpp.

bool WorldModel::resetTimeObjects  
 

This methods resets all the object information stored in the worldmodel. This means that the last see time of these objects are set to UnknownTime.

Returns:
bool indicating whether update was succesfull

Definition at line 2635 of file WorldModelUpdate.cpp.

References agentObject, Ball, Flags, Lines, MAX_FLAGS, MAX_LINES, MAX_OPPONENTS, MAX_TEAMMATES, Opponents, Object::setTimeLastSeen(), and Teammates.

bool WorldModel::setAgentObjectType ObjectT    o
 

This method sets the ObjectType of the agent. This is an objectT between OBJECT_TEAMMATE_1 and OBJECT_TEAMMATE_11

Parameters:
ObjectT  that represent the type of the agent
Returns:
bool indicating whether the update was succesful

Definition at line 698 of file WorldModel.cpp.

References agentObject, ObjectT, and Object::setType().

Referenced by SenseHandler::analyzeInitMessage().

bool WorldModel::setAgentViewAngle ViewAngleT    va
 

This method sets the view angle of the agent.

Returns:
bool indicating whether update was successful.

Definition at line 771 of file WorldModel.cpp.

References agentObject, AgentObject::setViewAngle(), and ViewAngleT.

Referenced by updateAll().

bool WorldModel::setAgentViewQuality ViewQualityT    vq
 

This method sets the view quality of the agent.

Returns:
bool indicating whether update was successful.

Definition at line 789 of file WorldModel.cpp.

References agentObject, AgentObject::setViewQuality(), and ViewQualityT.

Referenced by updateAll().

bool WorldModel::setChangeViewCommand SoccerCommand    soc
 

Definition at line 1730 of file WorldModel.cpp.

References m_changeViewCommand.

bool WorldModel::setCheckBallStatus BallStatusT    bs
 

This method sets the status of the ball. The status of the ball corresponds to the server time returned by getTimeCheckBall. This method is only useful for the coach, since only he can sent a check_ball message.

Returns:
BallStatus status of the ball.

Definition at line 541 of file WorldModel.cpp.

References BallStatusT, and bsCheckBall.

Referenced by SenseHandler::analyzeCheckBall().

bool WorldModel::setCommunicationString char *    str
 

This method sets the string that we want communicate. It can be set during the creation of the action. When the ActHandler sends its actions, it sends this string to the server.

Returns:
communication string.

Definition at line 587 of file WorldModel.cpp.

References m_strCommunicate, and MAX_SAY_MSG.

Referenced by Player::mainLoop(), and ActHandler::sendCommands().

bool WorldModel::setFeature FeatureT    type,
Feature    feature
 

This method updates the feature 'type' with the information stored in 'feature'.

Parameters:
type  type of this feature, e.g., FEATURE_FASTEST_PLAYER_TO_BALL.
feature  information regarding this feature
Returns:
boolean indicating whether the update was successful.

Definition at line 2522 of file WorldModel.cpp.

References FeatureT, and m_features.

Referenced by createInterceptFeatures(), getFastestInSetTo(), BasicPlayer::interceptClose(), and predictCommandToInterceptBall().

bool WorldModel::setHeteroPlayerType ObjectT    o,
int    iPlayerType
 

This method sets the heterogeneous player type of the object that is passed as the first argument.

Parameters:
o  object type of which the heterogeneous player type should be set
iPlayer  new heterogeneous player type of this object.

Definition at line 1413 of file WorldModel.cpp.

References getAgentObjectType(), getObjectPtrFromType(), ObjectT, PlayerObject::setHeteroPlayerType(), and updateSSToHeteroPlayerType().

Referenced by SenseHandler::analyzeChangePlayerTypeMessage().

bool WorldModel::setIsKnownPlayer ObjectT    o,
bool    isKnownPlayer
 

This method sets the value of the specified object to a known player or not. A known player is a player of which the exact team name and player number are known. If the player number is not known, information about the object is stored at an empty position in the player array and the value of isKnownPlayer is set to 'false'.

Parameters:
o  object type of which known player information should be set
isKnownPlayer  new known player value
Returns:
boolean indicating whether update was successful

Definition at line 1393 of file WorldModel.cpp.

References getObjectPtrFromType(), isKnownPlayer(), ObjectT, and PlayerObject::setIsKnownPlayer().

Referenced by processUnsureHearInfo().

bool WorldModel::setNrOfCommands CommandT    c,
int    i
 

This method sets the number of commands c that were performed by the agent. This is supplied in the sense_body message and can be used to check whether an action is actually performed by the soccer server, since the corresponding counter should be one higher than the previous sense_body message. When this is the case the corresponding index of the PerformedCommands array is set to true.

Parameters:
c  CommandT of which the number of commands should be set.
i  number of commands that are performed of this command
Returns:
bool indicating whether update was performed.

Definition at line 500 of file WorldModel.cpp.

References CommandT, iCommandCounters, and performedCommands.

Referenced by SenseHandler::analyzeFullStateMessage(), and processLastSenseMessage().

bool WorldModel::setObjectFocus ObjectT    obj
 

This methods sets the object type of the object that is currently listened to. This information is gathered from a sense message. When this agent says a message, we will definitely hear it.

Definition at line 576 of file WorldModel.cpp.

References m_objFocus, and ObjectT.

Referenced by processLastSenseMessage().

bool WorldModel::setPlayerNumber int    i
 

This method sets the player number of the agent. This value is available in the conformation message sent by the soccerserver after the initialization.

Parameters:
i  new player number of the agent.
Returns:
bool indicating whether player number was set.

Definition at line 394 of file WorldModel.cpp.

References iPlayerNumber.

Referenced by SenseHandler::analyzeInitMessage().

bool WorldModel::setPlayMode PlayModeT    pm
 

This method sets the play mode of the agent in this worldmodel

Parameters:
pm  for the agent in this worldmodel
Returns:
bool indicating whether update was succesful.

Definition at line 448 of file WorldModel.cpp.

References getSide(), getTimeLastSenseMessage(), playMode, PlayModeT, PM_GOAL_KICK_LEFT, PM_GOAL_KICK_RIGHT, setTimeLastCatch(), SIDE_LEFT, and SIDE_RIGHT.

Referenced by SenseHandler::analyzeFullStateMessage(), SenseHandler::analyzeHearMessage(), SenseHandler::analyzeInitMessage(), and WorldModel().

bool WorldModel::setSide SideT    s
 

This method sets the side of the agent

Parameters:
s  (SIDE_LEFT or SIDE_RIGHT) for agent
Returns:
bool indicating whether update was succesful.

Definition at line 411 of file WorldModel.cpp.

References getSide(), m_iMultX, m_iMultY, SIDE_LEFT, sideSide, and SideT.

Referenced by SenseHandler::analyzeInitMessage(), and WorldModel().

bool WorldModel::setSidePenalty SideT    side
 

This method sets the side the penalty kick is taken.

Definition at line 1748 of file WorldModel.cpp.

References m_sidePenalty, and SideT.

Referenced by SenseHandler::analyzeHearMessage().

bool WorldModel::setSubstitutedOpp ObjectT    obj
 

This method inserts a substituted opponent player in the set of substituted opponent players. This can then be detected by the coach, who then can figure out to which new type this opponent player is changed.

Definition at line 1534 of file WorldModel.cpp.

References m_setSubstitutedOpp, and ObjectT.

Referenced by SenseHandler::analyzeChangePlayerTypeMessage().

bool WorldModel::setTeamName char *    str
 

This method sets the teamname of the agent. The maximum team name is MAX_TEAM_NAME_LENGTH as defined in Soccertypes.h.

Parameters:
str  teamname for the agent in this worldmodel
Returns:
bool indicating whether update was succesful.

Definition at line 430 of file WorldModel.cpp.

References strTeamName.

Referenced by BasicCoach::BasicCoach(), and Player::Player().

bool WorldModel::setTimeCheckBall Time    time
 

This method sets the time the ball was checked for the last time (coach only).

Parameters:
time  server time ball was checked.
Returns:
bool indicating whether update was succesfull.

Definition at line 522 of file WorldModel.cpp.

References timeCheckBall.

Referenced by SenseHandler::analyzeCheckBall().

void WorldModel::setTimeLastCatch Time    time
 

This method sets the time of the last catch cycle. This information is received by the SenseHandler when the referee has sent this message. After a catch, the goalie is not allowed to catch the ball for catch_ban_cycles (defined in ServerSettings).

Parameters:
iTime  time the ball was catched.

Definition at line 191 of file WorldModel.cpp.

References timeLastCatch.

Referenced by setPlayMode().

bool WorldModel::setTimeLastHearMessage Time    time
 

This method sets the time of the last hear message.

Parameters:
time  hear message has arrived
Returns:
true when update was succesful

Definition at line 376 of file WorldModel.cpp.

References timeLastHearMessage.

Referenced by processPerfectHearInfo(), and processPerfectHearInfoBall().

bool WorldModel::setTimeLastRefereeMessage Time    time
 

This method sets the time of the last received referee message. This information is received by the SenseHandler.

Parameters:
iTime  time the referee sent the last message.

Definition at line 208 of file WorldModel.cpp.

References timeLastRefMessage.

Referenced by SenseHandler::analyzeHearMessage().

bool WorldModel::setTimeLastSeeGlobalMessage Time    time
 

This method sets the time of the last see_global message.

Parameters:
time  see message has arrived
Returns:
true when update was succesful

Definition at line 271 of file WorldModel.cpp.

References setTimeLastSeeMessage(), and updateRelativeFromGlobal().

Referenced by SenseHandler::analyzeFullStateMessage(), and SenseHandler::analyzeSeeGlobalMessage().

bool WorldModel::setTimeLastSeeMessage Time    time
 

This method sets the time of the last see message. It also sends a condition signal to indicate that variable bNewInfo has changed. When main thread is stopped in waitForNewInformation, it is unblocked.

Parameters:
time  see message has arrived
Returns:
true when update was succesful

Definition at line 300 of file WorldModel.cpp.

References bNewInfo, cond_newInfo, ServerSettings::getSynchMode(), mutex_newInfo, SS, and timeLastRecvSeeMessage.

Referenced by SenseHandler::analyzeSeeMessage(), and setTimeLastSeeGlobalMessage().

bool WorldModel::setTimeLastSeen ObjectT    o,
Time    time
 

This method sets the time the object 'o' has last been seen.

Parameters:
o  object of which the time should be changed
time  new time for this object
Returns:
bool indicating whether update was successful.

Definition at line 1403 of file WorldModel.cpp.

References getObjectPtrFromType(), ObjectT, and Object::setTimeLastSeen().

Referenced by removeGhosts().

bool WorldModel::setTimeLastSenseMessage Time    time
 

This method sets the time of the last sense message. It also send a condition signal to indicate that variable bNewInfo has changed. When main thread is stopped in waitForNewInformation, it is unblocked.

Parameters:
time  sense message has arrived
Returns:
true when update was succesful

Definition at line 345 of file WorldModel.cpp.

References bNewInfo, cond_newInfo, ServerSettings::getSynchMode(), mutex_newInfo, SS, and timeLastRecvSenseMessage.

Referenced by SenseHandler::analyzeFullStateMessage(), and SenseHandler::analyzeSenseMessage().

void WorldModel::show ObjectT    o,
ostream &    os = cout
 

This method prints the information about the Object o to the output stream os.

Parameters:
o  object of which information should be printed
os  output stream to which information is printed.

Definition at line 2096 of file WorldModel.cpp.

References getObjectPtrFromType(), getTeamName(), SoccerTypes::isPlayer(), SoccerTypes::isTeammate(), ObjectT, Object::show(), and PlayerObject::show().

void WorldModel::show ObjectSetT    set,
ostream &    os = cout
 

This method prints all the objects and information contained in the object set 'set' to specified outputstream.

Parameters:
os  output stream to which output is written (default cout).

Definition at line 2071 of file WorldModel.cpp.

References iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, ObjectSetT, ObjectT, and show().

void WorldModel::show ostream &    os = cout
 

This method prints all the objects and information of the agent to the specified outputstream. Only the information of the objects that are seen recently are printed.

Parameters:
os  output stream to which output is written (default cout).

Definition at line 2037 of file WorldModel.cpp.

References agentObject, Ball, CMD_DASH, CMD_KICK, CMD_SAY, CMD_TURN, CMD_TURNNECK, DEFAULT_OPPONENT_NAME, getCurrentTime(), getNrOfCommands(), SoccerTypes::getPlayModeStr(), getSide(), SoccerTypes::getSideStr(), getTeamName(), Time::getTime(), Object::getTimeLastSeen(), isConfidenceGood(), MAX_OPPONENTS, MAX_TEAMMATES, Opponents, playMode, AgentObject::show(), PlayerObject::show(), BallObject::show(), and Teammates.

Referenced by Player::executeStringCommand(), mapUnknownPlayers(), show(), updateAfterSeeMessage(), and updateAll().

void WorldModel::showQueuedCommands ostream &    os = cout
 

This method prints the queued commands - commands that are sent by the ActHandler to the server - to the specified output stream.

Parameters:
os  output stream to which information is printed (default cout)

Definition at line 2084 of file WorldModel.cpp.

References CMD_ILLEGAL, CMD_MAX_COMMANDS, SoccerCommand::commandType, queuedCommands, and SoccerCommand::show().

Referenced by Player::executeStringCommand().

bool WorldModel::storePlayerMessage int    iPlayer,
char *    strMsg,
int    iCycle
 

This method stores a message communicated by an other player in the world model. It is not processed yet. This is done by the updateAll method.

Parameters:
iPlayer  player who communicated
strMsg  string that was communicated
iDiff  difference between cycles message was communicated and current time
Returns:
bool indicating whether all values were stored successfully.

Definition at line 300 of file WorldModelUpdate.cpp.

References getCurrentTime(), m_iCycleInMsg, m_iMessageSender, m_strPlayerMsg, and m_timePlayerMsg.

Referenced by SenseHandler::analyzePlayerMessage().

int WorldModel::subtractOneFromGoalDiff  
 

This method subtracts one from the goal difference. Call this method when you're team has conceided a goal

Returns:
new goal difference

Definition at line 477 of file WorldModel.cpp.

References iGoalDiff.

Referenced by SenseHandler::analyzeHearMessage().

bool WorldModel::updateAfterSeeMessage   [private]
 

This method is called to update the WorldModel after a see message. The update methods for the agent, all teammates, all opponents and the ball are called. But only when the last see message of these objects equals the time of the last received see message.

Returns:
bool to indicate whether update succeeded.

Definition at line 987 of file WorldModelUpdate.cpp.

References getAgentObjectType(), getCurrentTime(), PlayerSettings::getPlayerConfThr(), Time::getTime(), getTimeLastSeeMessage(), getTimeLastSeen(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), mapUnknownPlayers(), OBJECT_BALL, OBJECT_ILLEGAL, OBJECT_SET_PLAYERS, ObjectT, processLastSeeMessage(), PS, removeGhosts(), show(), updateAgentObjectAfterSee(), updateDynamicObjectAfterSee(), and updateObjectRelativeFromGlobal().

Referenced by updateAll().

bool WorldModel::updateAfterSenseMessage  
 

This method is called to update the WorldModel after a sense message. The current information for the agent, all teammates, all opponents and the ball are calculated using the associated methods. This is done by updating the objects till the time of the information matches the current time of the sense message. After all global positions are determined, the relative information is updated using the new global information using the method determineRelativeFromGlobal().

Returns:
bool to indicate whether update succeeded.

Definition at line 1179 of file WorldModelUpdate.cpp.

References Ball, getAgentObjectType(), getCurrentTime(), SoccerTypes::getIndex(), getObjectPtrFromType(), PlayerSettings::getPlayerConfThr(), getStrategicPosition(), getTimeGlobalPosition(), getTimeLastSenseMessage(), VecPosition::getX(), VecPosition::getY(), isBeforeKickOff(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_ILLEGAL, OBJECT_SET_PLAYERS, OBJECT_SET_TEAMMATES, ObjectT, processLastSenseMessage(), PS, Object::setGlobalPosition(), Object::setGlobalPositionLastSee(), DynamicObject::setGlobalVelocity(), Object::setTimeLastSeen(), updateAgentAndBallAfterSense(), updateDynamicObjectForNextCycle(), and updateObjectRelativeFromGlobal().

Referenced by SenseHandler::analyzeMessage(), and updateAll().

bool WorldModel::updateAgentAndBallAfterSense   [private]
 

This method updates the agent and ball information after a sense message. This is done using the current known information and the action that is performed in the last server cycle as indicated by the attribute 'PerformedCommands'

Returns:
bool to indicate whether update succeeded.

Definition at line 1239 of file WorldModelUpdate.cpp.

References agentObject, AngDeg, CMD_DASH, CMD_KICK, CMD_MAX_COMMANDS, CMD_MOVE, CMD_TACKLE, CMD_TURN, CMD_TURNNECK, SoccerCommand::commandType, EPSILON, getAgentGlobalBodyAngle(), getAgentGlobalNeckAngle(), getAgentGlobalPosition(), getAgentGlobalVelocity(), getAgentObjectType(), getAgentStamina(), getBallPos(), ServerSettings::getBallSize(), getClosestInSetTo(), getCurrentTime(), VecPosition::getDistanceTo(), VecPosition::getMagnitude(), ServerSettings::getMaximalKickDist(), ServerSettings::getPlayerDecay(), ServerSettings::getPlayerSize(), AgentObject::getSpeedRelToNeck(), Time::getTime(), ServerSettings::getVisibleDistance(), VecPosition::getX(), VecPosition::getY(), initParticlesAgent(), m_bPerformedKick, m_bWasCollision, m_timeLastCollision, OBJECT_BALL, OBJECT_SET_PLAYERS, performedCommands, predictStateAfterCommand(), predictStateAfterDash(), queuedCommands, VecPosition::rotate(), AgentObject::setGlobalNeckAngle(), Object::setGlobalPosition(), DynamicObject::setGlobalVelocity(), VecPosition::setMagnitude(), VecPosition::setVecPosition(), sign(), SS, SoccerCommand::time, updateBallAfterKick(), updateBallForCollision(), updateDynamicObjectForNextCycle(), updateParticlesAgent(), and Time::updateTime().

Referenced by updateAfterSenseMessage().

bool WorldModel::updateAgentObjectAfterSee   [private]
 

This method updates an agent after a see message. The global position and the global neck angle are calculated using the visual information using the method calculateStateAgent.

Returns:
bool to indicate whether update succeeded.

Definition at line 1037 of file WorldModelUpdate.cpp.

References agentObject, AngDeg, calculateStateAgent(), Object::getGlobalPosition(), getTimeLastSeeMessage(), AgentObject::setGlobalNeckAngle(), Object::setGlobalPosition(), Object::setGlobalPositionLastSee(), DynamicObject::setGlobalVelocity(), AgentObject::setPositionDifference(), and Object::setTimeLastSeen().

Referenced by updateAfterSeeMessage().

bool WorldModel::updateAll  
 

This is called to update the WorldModel. It determines the the last message (see or sense) and updates the worlmodel accordingly. When see information is received ("perfect" information) all objects are updated with this received information. After sense message the information of the object is calculated for the new cycle using the last visual information.

Returns:
bool to indicate whether update succeeded.

Definition at line 638 of file WorldModelUpdate.cpp.

References agentObject, drawCoordinationGraph(), getAgentObjectType(), getChangeViewCommand(), getCurrentCycle(), getCurrentTime(), Timing::getElapsedTime(), getFastestInSetTo(), PlayerSettings::getFractionWaitSeeEnd(), getGlobalPosition(), getNrInSetInRectangle(), getOffsideX(), getPlayerNumber(), getRelativeDistance(), Object::getTimeGlobalPosition(), getTimeLastRecvSeeMessage(), getTimeLastRecvSenseMessage(), getTimeLastSeeMessage(), getTimeLastSenseMessage(), ServerSettings::getVisibleDistance(), iNrHoles, iNrOpponentsSeen, iNrTeammatesSeen, isFullStateOn(), SoccerCommand::isIllegal(), isLastMessageSee(), isQueuedActionPerformed(), isTimeStopped(), logCircle(), logLine(), logObjectInformation(), m_timePlayerMsg, OBJECT_BALL, OBJECT_SET_OPPONENTS, OBJECT_SET_PLAYERS, OBJECT_SET_TEAMMATES, OBJECT_SET_TEAMMATES_NO_GOALIE, ObjectT, PITCH_WIDTH, predictPosAfterNrCycles(), processPlayerMessage(), PS, Timing::restartTime(), setAgentViewAngle(), setAgentViewQuality(), PlayerSettings::setFractionWaitSeeEnd(), show(), SS, strLastSeeMessage, strLastSenseMessage, timeLastRecvSeeMessage, timeLastRecvSenseMessage, timeLastSeeMessage, timeLastSenseMessage, updateAfterSeeMessage(), updateAfterSenseMessage(), updateRelativeFromGlobal(), SoccerCommand::va, and SoccerCommand::vq.

Referenced by Player::mainLoop().

bool WorldModel::updateBallAfterKick SoccerCommand    soc [private]
 

This methods updates the ball after a kick command. First it is checked whether the ball is indeed in the kickable range. If this is the case the accelaration of the ball is calculated and added to the current velocity. With this information the new global position of the ball is set.

Parameters:
soc  performed kick command
Returns:
bool indicating whether update was succesful

Definition at line 1424 of file WorldModelUpdate.cpp.

References Ball, getCurrentTime(), ServerSettings::getMaximalKickDist(), getRelativeDistance(), OBJECT_BALL, predictBallInfoAfterCommand(), Object::setGlobalPosition(), DynamicObject::setGlobalVelocity(), SS, and updateDynamicObjectForNextCycle().

Referenced by updateAgentAndBallAfterSense().

bool WorldModel::updateBallForCollision VecPosition    posAgent [private]
 

This method checks updates the ball information when it overlaps with a player. If this is the case the player and the ball are moved to a position where they do not overlap any more. Both velocities are multiplied with 0.1

Returns:
true when collision occured, false otherwise

Definition at line 1541 of file WorldModelUpdate.cpp.

References AngDeg, Ball, getCurrentTime(), getGlobalPosition(), getGlobalVelocity(), VecPosition::getX(), VecPosition::getY(), OBJECT_BALL, POLAR, Object::setGlobalPosition(), and DynamicObject::setGlobalVelocity().

Referenced by updateAgentAndBallAfterSense().

bool WorldModel::updateDynamicObjectAfterSee ObjectT    o [private]
 

This method updates a dynamic object after a see message. The global position and the velocity are calculated using the visual information. For the ball the method 'calculateStateBall' is called, for players the method 'calculateStatePlayer' is called.

Parameters:
o  object that should be updated after a see message

Definition at line 1064 of file WorldModelUpdate.cpp.

References AngDeg, Ball, calculateStateBall(), calculateStatePlayer(), getAgentGlobalNeckAngle(), getObjectPtrFromType(), PlayerObject::getRelativeBodyAngle(), PlayerObject::getRelativeNeckAngle(), getTimeLastSeeMessage(), PlayerObject::getTimeRelativeAngles(), SoccerTypes::isKnownPlayer(), VecPosition::normalizeAngle(), OBJECT_BALL, ObjectT, PlayerObject::setGlobalBodyAngle(), PlayerObject::setGlobalBodyAngleLastSee(), PlayerObject::setGlobalNeckAngle(), Object::setGlobalPosition(), Object::setGlobalPositionLastSee(), DynamicObject::setGlobalVelocity(), and DynamicObject::setGlobalVelocityLastSee().

Referenced by updateAfterSeeMessage().

bool WorldModel::updateDynamicObjectForNextCycle ObjectT    obj,
int    iCycles
[private]
 

This methods updates a dynamic object for 'iCycles' cycle. This is done by updating the global position with the velocity vector. After this the velocity vector is decreased with the associated decay.

Parameters:
obj  object that should be updated
iCycles  denotes for how many cycles dynamic object should be updated
Returns:
bool indicating whether update was succesful

Definition at line 1457 of file WorldModelUpdate.cpp.

References AngDeg, ServerSettings::getBallDecay(), getBallPos(), getClosestInSetTo(), getCurrentTime(), VecPosition::getDistanceTo(), getFastestInSetTo(), getGlobalPosition(), getGlobalVelocity(), getMaximalKickDist(), getObjectPtrFromType(), getOppGoalieType(), ServerSettings::getPlayerDecay(), getPlayMode(), VecPosition::getX(), VecPosition::getY(), SoccerTypes::isBall(), isDeadBallThem(), isDeadBallUs(), SoccerTypes::isOpponent(), SoccerTypes::isTeammate(), OBJECT_BALL, OBJECT_ILLEGAL, OBJECT_SET_OPPONENTS, OBJECT_TEAMMATE_1, ObjectT, PENALTY_X, PM_PLAY_ON, POLAR, Object::setGlobalPosition(), DynamicObject::setGlobalVelocity(), VecPosition::setVecPosition(), and SS.

Referenced by updateAfterSenseMessage(), updateAgentAndBallAfterSense(), and updateBallAfterKick().

bool WorldModel::updateObjectRelativeFromGlobal ObjectT    o [private]
 

This method updates the relative information for one object using the global information of this object and the global information of the agent.

Parameters:
o  object information that should be updated.
Returns:
bool indicating whether the update was succesfull.

Definition at line 1592 of file WorldModelUpdate.cpp.

References getAgentGlobalNeckAngle(), getAgentGlobalPosition(), Object::getGlobalPosition(), getObjectPtrFromType(), Object::getTimeGlobalPosition(), VecPosition::globalToRelative(), ObjectT, and Object::setRelativePosition().

Referenced by processPerfectHearInfo(), processPerfectHearInfoBall(), removeGhosts(), updateAfterSeeMessage(), updateAfterSenseMessage(), and updateRelativeFromGlobal().

void WorldModel::updateParticlesAgent VecPosition    vel,
bool    bAfterSense
[private]
 

This method updates all the particles that represent the global position of the agent.The velocity 'vel' is added to each particle to move to the next location. When the last boolean argument is true, the velocity is simple added. If this value equals true the previously added velocity is subtracted before the specified velocity 'vel' is added. This for instance occurs when a better velocity estimate (after a see message) is determined with which the particles should be updated.

Parameters:
velocity  that should be added to each particle
bAfterSense  bool denoting whether this update is done after sense or see. When true last added velocity is first subtracted.

Definition at line 1792 of file WorldModelUpdate.cpp.

References VecPosition::getX(), VecPosition::getY(), iNrParticlesAgent, particlesPosAgent, VecPosition::setX(), and VecPosition::setY().

Referenced by calculateStateAgent(), and updateAgentAndBallAfterSense().

void WorldModel::updateParticlesBall VecPosition    posArray[],
VecPosition    velArray[],
int    iLength,
double    dPower,
AngDeg    ang
[private]
 

This method updates all particles that represent the global position and global velocity of the ball to the next cycle. This is done using the same formula as the soccer server.

Parameters:
posArray  array that contains the position particles
velArray  array that contains the velocity particles
iLength  number of particles that have to be checked.
dPower  power with which the ball is accelerated.
ang  angle (relative to body) to which the ball is accelerated.

Definition at line 2967 of file WorldModelUpdate.cpp.

References AngDeg, EPSILON, getActualKickPowerRate(), getAgentGlobalBodyAngle(), ServerSettings::getBallDecay(), ServerSettings::getBallRand(), ServerSettings::getBallSpeedMax(), VecPosition::getMagnitude(), VecPosition::normalizeAngle(), POLAR, VecPosition::setMagnitude(), and SS.

bool WorldModel::updateRelativeFromGlobal   [private]
 

This method uses the global position of the agent and the global position of all objects to update their relative information. When the new global position of the objects is updated after a sense message, their relative information is not up to date.

Returns:
bool indicating whether update was succesful

Definition at line 1563 of file WorldModelUpdate.cpp.

References getAgentObjectType(), PlayerSettings::getPlayerConfThr(), isConfidenceGood(), iterateObjectDone(), iterateObjectNext(), iterateObjectStart(), OBJECT_BALL, OBJECT_ILLEGAL, OBJECT_SET_PLAYERS, ObjectT, PS, and updateObjectRelativeFromGlobal().

Referenced by setTimeLastSeeGlobalMessage(), and updateAll().

bool WorldModel::updateSSToHeteroPlayerType int    iIndex
 

This method updates the ServerSettings of this agent using the player type information of the heterogeneous player at index 'iIndex'. This method is usually called when the player type of the agent is changed by the coach. It updates its parameters, such that all calculations to determine the next action are based on the correct parameters.

Parameters:
iIndex  index of the new player type
Returns:
bool indicating whether update was succesfull.

Definition at line 2615 of file WorldModelUpdate.cpp.

References pt, ServerSettings::setDashPowerRate(), ServerSettings::setEffortMax(), ServerSettings::setEffortMin(), ServerSettings::setExtraStamina(), ServerSettings::setInertiaMoment(), ServerSettings::setKickableMargin(), ServerSettings::setKickRand(), ServerSettings::setPlayerDecay(), ServerSettings::setPlayerSize(), ServerSettings::setPlayerSpeedMax(), ServerSettings::setStaminaIncMax(), and SS.

Referenced by setHeteroPlayerType().

bool WorldModel::waitForNewInformation  
 

This method blocks till new information has arrived. Information is either a sense_body message or a see message. If there isn't received information from the server for longer than 3 seconds, server is assumed dead and false is returned.

Returns:
true when new info has arrived, false if server is dead

Definition at line 2119 of file WorldModel.cpp.

References bNewInfo, cond_newInfo, PlayerSettings::getServerTimeOut(), mutex_newInfo, and PS.

Referenced by Player::mainLoop(), and BasicCoach::mainLoopNormal().


Member Data Documentation

AgentObject WorldModel::agentObject [private]
 

information of the agent itself

Definition at line 152 of file WorldModel.h.

Referenced by calculateStateAgent(), calculateStateAgent2(), calculateStateAgent3(), calculateStateBall(), calculateStatePlayer(), getAgentArmExpires(), getAgentArmMovable(), getAgentArmPosition(), getAgentBodyAngleRelToNeck(), getAgentEffort(), getAgentGlobalBodyAngle(), getAgentGlobalNeckAngle(), getAgentGlobalPosition(), getAgentGlobalVelocity(), getAgentObjectType(), getAgentSpeed(), getAgentStamina(), getAgentViewAngle(), getAgentViewQuality(), getObjectPtrFromType(), getTackleExpires(), processNewAgentInfo(), removeGhosts(), resetTimeObjects(), setAgentObjectType(), setAgentViewAngle(), setAgentViewQuality(), show(), updateAgentAndBallAfterSense(), updateAgentObjectAfterSee(), updateAll(), and WorldModel().

BallObject WorldModel::Ball [private]
 

information of the ball

Definition at line 151 of file WorldModel.h.

Referenced by calculateStateBall(), checkParticlesBall(), getBallDirection(), getBallSpeed(), getObjectPtrFromType(), initParticlesBall(), processCatchedBall(), processPerfectHearInfoBall(), removeGhosts(), resetTimeObjects(), show(), updateAfterSenseMessage(), updateBallAfterKick(), updateBallForCollision(), updateDynamicObjectAfterSee(), and WorldModel().

bool WorldModel::bNewInfo [private]
 

indicates new info from server

Definition at line 134 of file WorldModel.h.

Referenced by processRecvThink(), setTimeLastSeeMessage(), setTimeLastSenseMessage(), waitForNewInformation(), and WorldModel().

BallStatusT WorldModel::bsCheckBall [private]
 

state of the ball

Definition at line 194 of file WorldModel.h.

Referenced by getCheckBallStatus(), setCheckBallStatus(), and WorldModel().

pthread_cond_t WorldModel::cond_newInfo [private]
 

cond variable for bNewInfo

Definition at line 202 of file WorldModel.h.

Referenced by processRecvThink(), setTimeLastSeeMessage(), setTimeLastSenseMessage(), waitForNewInformation(), and WorldModel().

double WorldModel::dTotalVarPos [private]
 

Definition at line 177 of file WorldModel.h.

Referenced by WorldModel().

double WorldModel::dTotalVarVel [private]
 

particles to store ball velocity

Definition at line 176 of file WorldModel.h.

Referenced by WorldModel().

FixedObject WorldModel::Flags[MAX_FLAGS] [private]
 

all flag information

Definition at line 161 of file WorldModel.h.

Referenced by getObjectPtrFromType(), processNewObjectInfo(), resetTimeObjects(), and WorldModel().

Formations* WorldModel::formations [private]
 

Reference to formation used

Definition at line 124 of file WorldModel.h.

Referenced by getClosestPlayerInFormationTo(), getPlayerType(), getStrategicPosition(), and WorldModel().

int WorldModel::iCommandCounters[CMD_MAX_COMMANDS] [private]
 

counters for all performed commands

Definition at line 186 of file WorldModel.h.

Referenced by getNrOfCommands(), setNrOfCommands(), and WorldModel().

int WorldModel::iGoalDiff [private]
 

goal difference

Definition at line 145 of file WorldModel.h.

Referenced by addOneToGoalDiff(), getGoalDiff(), subtractOneFromGoalDiff(), and WorldModel().

int WorldModel::iNrHoles
 

nr of holes recorded

Definition at line 241 of file WorldModel.h.

Referenced by Player::mainLoop(), updateAll(), and WorldModel().

int WorldModel::iNrOpponentsSeen
 

total nr of opponents seen

Definition at line 242 of file WorldModel.h.

Referenced by Player::mainLoop(), updateAll(), and WorldModel().

const int WorldModel::iNrParticlesAgent = 100 [static, private]
 

nr of particles used to store agent position

Definition at line 166 of file WorldModel.h.

Referenced by checkParticlesAgent(), initParticlesAgent(), resampleParticlesAgent(), and updateParticlesAgent().

const int WorldModel::iNrParticlesBall = 100 [static, private]
 

Definition at line 168 of file WorldModel.h.

int WorldModel::iNrTeammatesSeen
 

total nr of teammates seen

Definition at line 243 of file WorldModel.h.

Referenced by Player::mainLoop(), updateAll(), and WorldModel().

int WorldModel::iNrUnknownPlayers [private]
 

number of unknown players

Definition at line 158 of file WorldModel.h.

Referenced by mapUnknownPlayers(), processNewObjectInfo(), and WorldModel().

int WorldModel::iPlayerNumber [private]
 

player number in soccerserver

Definition at line 140 of file WorldModel.h.

Referenced by getPlayerNumber(), and setPlayerNumber().

FixedObject WorldModel::Lines[MAX_LINES] [private]
 

all line information

Definition at line 162 of file WorldModel.h.

Referenced by getObjectPtrFromType(), processNewObjectInfo(), resetTimeObjects(), and WorldModel().

bool WorldModel::m_bPerformedKick [private]
 

Indicates whether ball was kicked

Definition at line 224 of file WorldModel.h.

Referenced by calculateStateBall(), isFeatureRelevant(), and updateAgentAndBallAfterSense().

bool WorldModel::m_bRecvThink [private]
 

think received in sync. mode

Definition at line 204 of file WorldModel.h.

Referenced by getRecvThink(), processRecvThink(), and WorldModel().

bool WorldModel::m_bWasCollision
 

Indicates whether it is collision

Definition at line 237 of file WorldModel.h.

Referenced by calculateStateBall(), and updateAgentAndBallAfterSense().

SoccerCommand WorldModel::m_changeViewCommand [private]
 

last sent change_view command

Definition at line 230 of file WorldModel.h.

Referenced by getChangeViewCommand(), and setChangeViewCommand().

char WorldModel::m_colorPlayers[11][8]
 

color information with which each player should draw its relevant info

Definition at line 876 of file WorldModel.h.

Referenced by logCircle(), logCoordInfo(), logLine(), and WorldModel().

double WorldModel::m_dCommOffsideX [private]
 

communicated offside line

Definition at line 217 of file WorldModel.h.

Referenced by getOffsideX(), and processPlayerMessage().

Feature WorldModel::m_features[MAX_FEATURES] [private]
 

features applied to cur. cycle.

Definition at line 221 of file WorldModel.h.

Referenced by getFeature(), isFeatureRelevant(), setFeature(), and WorldModel().

int WorldModel::m_iCycleInMsg [private]
 

cycle contained in message

Definition at line 208 of file WorldModel.h.

Referenced by processPlayerMessage(), and storePlayerMessage().

int WorldModel::m_iMessageSender [private]
 

player who send message

Definition at line 210 of file WorldModel.h.

Referenced by storePlayerMessage().

int WorldModel::m_iMultX
 

This variable denotes with which value the x coordinates of the draw information should be multiplied in order to convert the coordinates to the coordinate system of the monitor

Definition at line 878 of file WorldModel.h.

Referenced by logCircle(), logCoordInfo(), logDrawBallInfo(), logDrawInfo(), logLine(), and setSide().

int WorldModel::m_iMultY
 

This variable denotes with which value the y coordinates of the draw information should be multiplied in order to convert the coordinates to the coordinate system of the monitor

Definition at line 883 of file WorldModel.h.

Referenced by logCircle(), logCoordInfo(), logDrawBallInfo(), logDrawInfo(), logLine(), and setSide().

ObjectT WorldModel::m_objFocus [private]
 

object to which is focused.

Definition at line 214 of file WorldModel.h.

Referenced by getObjectFocus(), and setObjectFocus().

set<ObjectT> WorldModel::m_setSubstitutedOpp [private]
 

Set of substituted opp players.

Definition at line 227 of file WorldModel.h.

Referenced by getSubstitutedOpp(), and setSubstitutedOpp().

SideT WorldModel::m_sidePenalty [private]
 

Definition at line 233 of file WorldModel.h.

Referenced by getSidePenalty(), setSidePenalty(), and WorldModel().

char WorldModel::m_strCommunicate[MAX_SAY_MSG] [private]
 

string for communicating

Definition at line 211 of file WorldModel.h.

Referenced by getCommunicationString(), and setCommunicationString().

char WorldModel::m_strPlayerMsg[MAX_MSG] [private]
 

message communicated by player

Definition at line 207 of file WorldModel.h.

Referenced by processPlayerMessage(), and storePlayerMessage().

Time WorldModel::m_timeCommOffsideX [private]
 

time Communicated offside line

Definition at line 218 of file WorldModel.h.

Referenced by getOffsideX(), and processPlayerMessage().

Time WorldModel::m_timeLastCollision
 

Last collision time

Definition at line 238 of file WorldModel.h.

Referenced by calculateStateBall(), and updateAgentAndBallAfterSense().

Time WorldModel::m_timePlayerMsg [private]
 

time corresponding to player msg

Definition at line 209 of file WorldModel.h.

Referenced by storePlayerMessage(), and updateAll().

pthread_mutex_t WorldModel::mutex_newInfo [private]
 

mutex to protect bNewInfo

Definition at line 201 of file WorldModel.h.

Referenced by processRecvThink(), setTimeLastSeeMessage(), setTimeLastSenseMessage(), waitForNewInformation(), WorldModel(), and ~WorldModel().

PlayerObject WorldModel::Opponents[MAX_OPPONENTS] [private]
 

information of all opponents

Definition at line 154 of file WorldModel.h.

Referenced by getLastOpponentDefender(), getObjectPtrFromType(), getOppGoalieType(), mapUnknownPlayers(), resetTimeObjects(), show(), and WorldModel().

VecPosition WorldModel::particlesPosAgent[iNrParticlesAgent] [private]
 

particles to store agent position

Definition at line 170 of file WorldModel.h.

Referenced by calculateStateAgent(), checkParticlesAgent(), initParticlesAgent(), resampleParticlesAgent(), and updateParticlesAgent().

VecPosition WorldModel::particlesPosBall[iNrParticlesBall] [private]
 

Definition at line 172 of file WorldModel.h.

VecPosition WorldModel::particlesVelBall[iNrParticlesBall] [private]
 

particles to store ball position

Definition at line 174 of file WorldModel.h.

bool WorldModel::performedCommands[CMD_MAX_COMMANDS] [private]
 

commands performed in last cycle, index is CommandT

Definition at line 183 of file WorldModel.h.

Referenced by isQueuedActionPerformed(), setNrOfCommands(), updateAgentAndBallAfterSense(), and WorldModel().

PlayModeT WorldModel::playMode [private]
 

current play mode in the game

Definition at line 144 of file WorldModel.h.

Referenced by getPlayMode(), setPlayMode(), and show().

PlayerSettings* WorldModel::PS [private]
 

Reference to all client params

Definition at line 122 of file WorldModel.h.

Referenced by createInterceptFeatures(), getClosestInSetTo(), getDirectionOfWidestAngle(), getFastestInSetTo(), getFirstEmptySpotInSet(), getFurthestInSetTo(), getNrInSetInCircle(), getNrInSetInCone(), getNrInSetInRectangle(), getSecondClosestInSetTo(), getStrategicPosition(), isConfidenceGood(), isConfidenceVeryGood(), iterateObjectNext(), logCoordInfo(), logDrawInfo(), logObjectInformation(), mapUnknownPlayers(), predictCommandToInterceptBall(), predictCommandTurnTowards(), predictNrCyclesToObject(), processNewObjectInfo(), processUnsureHearInfo(), updateAfterSeeMessage(), updateAfterSenseMessage(), updateAll(), updateRelativeFromGlobal(), waitForNewInformation(), and WorldModel().

HeteroPlayerSettings WorldModel::pt[MAX_HETERO_PLAYERS] [private]
 

info hetero player types

Definition at line 123 of file WorldModel.h.

Referenced by getEffectiveMaxSpeed(), getInfoHeteroPlayer(), processNewHeteroPlayer(), and updateSSToHeteroPlayerType().

SoccerCommand WorldModel::queuedCommands[CMD_MAX_COMMANDS] [private]
 

all performed commands, set by ActHandler

Definition at line 181 of file WorldModel.h.

Referenced by isQueuedActionPerformed(), processQueuedCommands(), showQueuedCommands(), updateAgentAndBallAfterSense(), and WorldModel().

SideT WorldModel::sideSide [private]
 

side where the agent started

Definition at line 141 of file WorldModel.h.

Referenced by getRelAngleOpponentGoal(), getSide(), processCatchedBall(), and setSide().

ServerSettings* WorldModel::SS [private]
 

Reference to all server params

Definition at line 121 of file WorldModel.h.

Referenced by calculateStateAgent(), calculateStateAgent2(), calculateStateBall(), calculateStatePlayer(), checkParticlesAgent(), createInterceptFeatures(), getActualKickPowerRate(), getAgentTiredNess(), getAngleForTurn(), getEffectiveMaxSpeed(), getEndSpeedFromFirstSpeed(), getFastestInSetTo(), getFirstSpeedFromDist(), getFirstSpeedFromEndSpeed(), getGlobalPosition(), getKickSpeedToTravel(), getMaxTraveledDistance(), getOppGoalieType(), getOwnGoalieType(), getPosOpponentGoal(), getPosOwnGoal(), getPowerForDash(), getProbTackleSucceeds(), getTackleExpires(), initParticlesAgent(), isBallCatchable(), isBallHeadingToGoal(), isBallKickable(), isBeforeGoal(), isCollisionAfterCommand(), isFullStateOn(), logCircle(), logCoordInfo(), logDrawBallInfo(), logDrawInfo(), logLine(), mapUnknownPlayers(), predictBallInfoAfterCommand(), predictFinalAgentPos(), predictNrCyclesForDistance(), predictNrCyclesToObject(), predictPosAfterNrCycles(), predictStaminaAfterDash(), predictStateAfterDash(), processNewHeteroPlayer(), processNewObjectInfo(), processPlayerMessage(), processRecvThink(), removeGhosts(), setTimeLastSeeMessage(), setTimeLastSenseMessage(), updateAgentAndBallAfterSense(), updateAll(), updateBallAfterKick(), updateDynamicObjectForNextCycle(), updateParticlesBall(), updateSSToHeteroPlayerType(), and WorldModel().

char WorldModel::strLastHearMessage[MAX_MSG]
 

Last hear message

Definition at line 248 of file WorldModel.h.

Referenced by SenseHandler::analyzeHearMessage().

char WorldModel::strLastSeeMessage[MAX_MSG]
 

Last see message

Definition at line 246 of file WorldModel.h.

Referenced by SenseHandler::analyzeFullStateMessage(), SenseHandler::analyzeSeeGlobalMessage(), SenseHandler::analyzeSeeMessage(), BasicPlayer::defendGoalLine(), processLastSeeMessage(), and updateAll().

char WorldModel::strLastSenseMessage[MAX_MSG]
 

Last sense_body message

Definition at line 247 of file WorldModel.h.

Referenced by SenseHandler::analyzeSenseMessage(), processLastSenseMessage(), and updateAll().

char WorldModel::strTeamName[MAX_TEAM_NAME_LENGTH] [private]
 

Team name

Definition at line 139 of file WorldModel.h.

Referenced by getTeamName(), setTeamName(), and WorldModel().

PlayerObject WorldModel::Teammates[MAX_TEAMMATES] [private]
 

information of all teammates

Definition at line 153 of file WorldModel.h.

Referenced by getObjectPtrFromType(), getOwnGoalieType(), mapUnknownPlayers(), resetTimeObjects(), show(), and WorldModel().

Time WorldModel::timeCheckBall [private]
 

time bsCheckBall applies to

Definition at line 193 of file WorldModel.h.

Referenced by getTimeCheckBall(), and setTimeCheckBall().

Time WorldModel::timeLastCatch [private]
 

time of last catch by goalie

Definition at line 135 of file WorldModel.h.

Referenced by getTimeSinceLastCatch(), processCatchedBall(), and setTimeLastCatch().

Time WorldModel::timeLastHearMessage [private]
 

server time of last hear msg

Definition at line 133 of file WorldModel.h.

Referenced by getTimeLastHearMessage(), and setTimeLastHearMessage().

Time WorldModel::timeLastRecvSeeMessage [private]
 

server time received see msg

Definition at line 130 of file WorldModel.h.

Referenced by getTimeLastRecvSeeMessage(), setTimeLastSeeMessage(), and updateAll().

Time WorldModel::timeLastRecvSenseMessage [private]
 

server time received sense msg

Definition at line 132 of file WorldModel.h.

Referenced by getTimeLastRecvSenseMessage(), setTimeLastSenseMessage(), and updateAll().

Time WorldModel::timeLastRefMessage [private]
 

time of last referee message

Definition at line 136 of file WorldModel.h.

Referenced by getTimeLastRefereeMessage(), and setTimeLastRefereeMessage().

Time WorldModel::timeLastSeeMessage [private]
 

server time of last see msg

Definition at line 129 of file WorldModel.h.

Referenced by getTimeLastSeeMessage(), and updateAll().

Time WorldModel::timeLastSenseMessage [private]
 

server time of last sense msg

Definition at line 131 of file WorldModel.h.

Referenced by getTimeLastSenseMessage(), getTimeSinceLastCatch(), updateAll(), and WorldModel().

PlayerObject WorldModel::UnknownPlayers[MAX_TEAMMATES+MAX_OPPONENTS] [private]
 

info unknown players are stored here til mapped to known player

Definition at line 156 of file WorldModel.h.

Referenced by mapUnknownPlayers(), processNewObjectInfo(), and WorldModel().


The documentation for this class was generated from the following files:
Generated on Fri Nov 7 11:46:11 2003 for UvA Trilearn 2003 Base Code by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001