LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Public Member Functions | Static Public Attributes | List of all members
rcsc::WorldModel Class Reference

player's internal field status More...

#include <world_model.h>

Public Types

enum  { DIR_CONF_DIVS = 72 }
 

Public Member Functions

 WorldModel ()
 initialize member variables
 
 ~WorldModel ()
 delete dynamically allocated memory
 
bool init (const std::string &team_name, const SideID our_side, const int unum, const bool goalie, const double client_version)
 initialize by team information More...
 
bool isValid () const
 get this world mode is valid or not More...
 
void setValid (bool is_valid)
 set this world mode is valid or not More...
 
double clientVersion () const
 get the client version. More...
 
const InterceptTableinterceptTable () const
 get intercept table More...
 
const PenaltyKickStatepenaltyKickState () const
 get penalty kick state More...
 
const AudioMemoryaudioMemory () const
 get audio memory More...
 
void setAudioMemory (std::shared_ptr< AudioMemory > memory)
 set new audio memory More...
 
void setLocalization (std::shared_ptr< Localization > localization)
 set new localization method More...
 
void setServerParam ()
 set server param. this method have to be called only once just after server_param message received.
 
void setOurGoalieUnum (const int unum)
 set our goalie's uniform number using strategic information or coach message. More...
 
void setTheirGoalieUnum (const int unum)
 set their goalie's uniform number using coach message. More...
 
void setOurPlayerType (const int unum, const int id)
 set teammate player type & reset card status More...
 
void setTheirPlayerType (const int unum, const int id)
 set opponent player type & reset card status More...
 
void setCard (const SideID side, const int unum, const Card card)
 set yellow card information More...
 
void setPenaltyKickTakerOrder (const std::vector< int > &unum_set)
 set current penalty kick taker. More...
 
void updateAfterSenseBody (const BodySensor &sense_body, const ActionEffector &act, const GameTime &current)
 update by sense_body. More...
 
void updateAfterSee (const VisualSensor &see, const BodySensor &sense_body, const ActionEffector &act, const GameTime &current)
 update by see info More...
 
void updateAfterFullstate (const FullstateSensor &fullstate, const ActionEffector &act, const GameTime &current)
 update by fullstate info More...
 
void updateGameMode (const GameMode &game_mode, const GameTime &current)
 update current playmode More...
 
void setTrainingTime (const GameTime &t)
 set training start/end time More...
 
void setViewMode (const ViewWidth &w, const ViewQuality &q)
 update self view move More...
 
void updateJustBeforeDecision (const ActionEffector &act, const GameTime &current)
 internal update for action decision More...
 
void updateJustAfterDecision (const ActionEffector &act)
 update using internal by command effects. This method is called just before command sending. More...
 
void updatePlayer (const PlayerObject *player, const SideID side, const int unum, const bool goalie)
 set player's side/unum/goalie information More...
 
const std::string & teamName () const
 get our teamname More...
 
const std::string & ourTeamName () const
 
SideID ourSide () const
 get our team side Id More...
 
const std::string & theirTeamName () const
 get their teamname More...
 
SideID theirSide () const
 get opponent team side Id More...
 
const GameTimetime () const
 get last updated time (== current game time) More...
 
const GameTimesenseBodyTime () const
 get last time updated by sense_body More...
 
const GameTimeseeTime () const
 get last time updated by see More...
 
const GameTimefullstateTime () const
 get last time updated by fullstate More...
 
const GameTimedecisionTime () const
 get the time value when the last action performed
 
const TimeStampseeTimeStamp () const
 get the time stamp when see received
 
const TimeStampdecisionTimeStamp () const
 get the time stamp when action performed
 
const GameTimelastSetPlayStartTime () const
 get last setplay type playmode start time More...
 
int getSetPlayCount () const
 get cycle count that setplay type playmode is keeped More...
 
const GameModegameMode () const
 get current playmode info More...
 
const GameTimetrainingTime () const
 get training start/end time More...
 
const SelfObjectself () const
 get self info More...
 
const BallObjectball () const
 get the current ball info More...
 
const BallObjectprevBall () const
 get the previous ball info More...
 
const PlayerObject::Contteammates () const
 get teammates. the order is undefined. More...
 
const PlayerObject::Contopponents () const
 get opponents(include unknown players). the order is undefined More...
 
const PlayerObject::ContteammatesFromSelf () const
 get teammates sorted by distance from self More...
 
const PlayerObject::ContopponentsFromSelf () const
 get opponents sorted by distance from self (includes unknown players) More...
 
const PlayerObject::ContteammatesFromBall () const
 get teammates sorted by distance from ball More...
 
const PlayerObject::ContopponentsFromBall () const
 get opponents sorted by distance from ball (includes unknown players) More...
 
int ourGoalieUnum () const
 get the uniform number of teammate goalie More...
 
int theirGoalieUnum () const
 get the uniform number of opponent goalie More...
 
const AbstractPlayerObject::ContallPlayers () const
 get all players includes self. More...
 
const AbstractPlayerObject::ContourPlayers () const
 get all teammate players includes self. More...
 
const AbstractPlayerObject::ConttheirPlayers () const
 get all opponent players (includes unknown players) More...
 
const AbstractPlayerObjectourPlayer (const int unum) const
 get a teammate (or self) specified by uniform number More...
 
const AbstractPlayerObjecttheirPlayer (const int unum) const
 get an opponent specified by uniform number More...
 
double ourRecovery (const int unum) const
 get (heard) recovery value of the specified player More...
 
double ourStaminaCapacity (const int unum) const
 get (heard) stamina capacity value of the specified player More...
 
const PlayerObjectgetTeammateNearestToSelf (const int count_thr, const bool with_goalie=true) const
 get teammate nearest to self with confidence count check More...
 
const PlayerObjectgetOpponentNearestToSelf (const int count_thr, const bool with_goalie=true) const
 get opponent nearest to self with accuracy count check More...
 
double getDistTeammateNearestToSelf (const int count_thr, const bool with_goalie=true) const
 get the distance from teammate nearest to self wtth accuracy count More...
 
double getDistOpponentNearestToSelf (const int count_thr, const bool with_goalie=true) const
 get the distance from opponent nearest to self wtth accuracy count More...
 
const PlayerObjectgetTeammateNearestToBall (const int count_thr, const bool with_goalie=true) const
 get teammate nearest to with with confidence count check More...
 
const PlayerObjectgetOpponentNearestToBall (const int count_thr, const bool with_goalie=true) const
 get opponent nearest to ball with confidence count check More...
 
double getDistTeammateNearestToBall (const int count_thr, const bool with_goalie) const
 get the distance to teammate nearest to ball wtth accuracy count More...
 
double getDistOpponentNearestToBall (const int count_thr, const bool with_goalie=true) const
 get the distance to opponent nearest to ball wtth accuracy count More...
 
double offsideLineX () const
 get estimated offside line x coordinate More...
 
double prevOffsideLineX () const
 get estimated offside line x coordinate More...
 
int offsideLineCount () const
 get the accuracy count for the offside line More...
 
double ourOffenseLineX () const
 our offense line (consider ball pos) More...
 
double ourDefenseLineX () const
 get our defense line (consider ball pos)(offside line for opponent) More...
 
double theirOffenseLineX () const
 get their offense line (consider ball pos) More...
 
double theirDefenseLineX () const
 get their defense line x value (consider ball pos) More...
 
double ourOffensePlayerLineX () const
 get our offense player line (not consder ball pos) More...
 
double ourDefensePlayerLineX () const
 get our defense player line (not consder ball pos) More...
 
double theirOffensePlayerLineX () const
 get their offense player line (not consder ball pos) More...
 
double theirDefensePlayerLineX () const
 get estimated their offense line x value More...
 
const PlayerObjectkickableTeammate () const
 get the estimated kickable teammate if exist. More...
 
const PlayerObjectkickableOpponent () const
 get the estimated kickable opponent if exist. More...
 
const PlayerObjectmaybeKickableTeammate () const
 get the estimated kickable teammate (maybe kickable). More...
 
const PlayerObjectmaybeKickableOpponent () const
 get the estimated kickable opponent (maybe kickable). More...
 
SideID lastKickerSide () const
 get the estimated last kicker's side More...
 
int lastKickerUnum () const
 get the estimated last kicker's uniform number More...
 
int ourPlayerTypeId (const int unum) const
 get player type Id of teammate More...
 
const PlayerTypeourPlayerType (const int unum) const
 get player type of the specified teammate More...
 
int theirPlayerTypeId (const int unum) const
 get player type Id of opponent More...
 
const PlayerTypetheirPlayerType (const int unum) const
 get player type of the specified opponent More...
 
Card ourCard (const int unum) const
 get teammate's yellow card status More...
 
Card theirCard (const int unum) const
 get opponent's yellow card status More...
 
int dirCount (const AngleDeg &angle) const
 get direction confidence count More...
 
int dirRangeCount (const AngleDeg &angle, const double &width, int *max_count, int *sum_count, int *ave_count) const
 get max count, sum of count and average count of angle range More...
 
const ViewAreaContviewAreaCont () const
 get view area history container More...
 
const ViewGridMapviewGridMap () const
 get field grid map that holds observation accuracy count More...
 
int getPointCount (const Vector2D &point, const double &dir_thr) const
 get the specific point accuracy count More...
 
AbstractPlayerObject::Cont getPlayers (const PlayerPredicate *predicate) const
 get the new container of AbstractPlayer matched with the predicate. More...
 
AbstractPlayerObject::Cont getPlayers (std::shared_ptr< const PlayerPredicate > predicate) const
 get the new container of AbstractPlayer matched with the predicate. More...
 
void getPlayers (AbstractPlayerObject::Cont &result, const PlayerPredicate *predicate) const
 get the new container of AbstractPlayer matched with the predicate. More...
 
void getPlayers (AbstractPlayerObject::Cont &result, std::shared_ptr< const PlayerPredicate > predicate) const
 get the new container of AbstractPlayer matched with the predicate. More...
 
size_t countPlayer (const PlayerPredicate *predicate) const
 get the number of players that satisfy an input predicate. More...
 
size_t countPlayer (std::shared_ptr< const PlayerPredicate > predicate) const
 get the number of players that satisfy an input predicate. More...
 
const AbstractPlayerObjectgetOurGoalie () const
 get a goalie teammate (include self) More...
 
const AbstractPlayerObjectgetTheirGoalie () const
 
double getDistTeammateNearestTo (const Vector2D &point, const int count_thr) const
 get the distance from input point to the nearest teammate More...
 
double getDistOpponentNearestTo (const Vector2D &point, const int count_thr) const
 get the distance from input point to the nearest opponent More...
 
const PlayerObjectgetTeammateNearestTo (const Vector2D &point, const int count_thr, double *dist_to_point) const
 get teammate pointer nearest to point More...
 
const PlayerObjectgetTeammateNearestTo (const PlayerObject *p, const int count_thr, double *dist_to_point) const
 get teammate pointer nearest to the specified player More...
 
const PlayerObjectgetOpponentNearestTo (const Vector2D &point, const int count_thr, double *dist_to_point) const
 get opponent pointer nearest to point More...
 
const PlayerObjectgetOpponentNearestTo (const PlayerObject *p, const int count_thr, double *dist_to_point) const
 get teammate pointer nearest to the specified player More...
 
template<typename REGION >
bool existTeammateIn (const REGION &region, const int count_thr, const bool with_goalie) const
 template utility. check if teammate exist in the specified region. More...
 
template<typename REGION >
bool existOpponentIn (const REGION &region, const int count_thr, const bool with_goalie) const
 template utility. check if opponent exist in the specified region. More...
 
template<typename REGION >
size_t countTeammatesIn (const REGION &region, const int count_thr, const bool with_goalie) const
 count the number of teammate exist in the specified region More...
 
template<typename REGION >
size_t countOpponentsIn (const REGION &region, const int count_thr, const bool with_goalie) const
 count the number of opponent exist in the specified region More...
 

Static Public Attributes

static const double DIST_TOO_FAR
 long distance
 
static const std::size_t MAX_RECORD
 max record size
 
static const double DIR_STEP
 the angle steps for dir confidence
 

Detailed Description

player's internal field status

Member Function Documentation

◆ allPlayers()

const AbstractPlayerObject::Cont & rcsc::WorldModel::allPlayers ( ) const
inline

get all players includes self.

Returns
const rerefence to the AbstractPlayerObject pointer container.

◆ audioMemory()

const AudioMemory & rcsc::WorldModel::audioMemory ( ) const
inline

get audio memory

Returns
const reference to the audio memory instance

◆ ball()

const BallObject & rcsc::WorldModel::ball ( ) const
inline

get the current ball info

Returns
const reference to the BallObject

◆ clientVersion()

double rcsc::WorldModel::clientVersion ( ) const
inline

get the client version.

Returns
the version numver

◆ countOpponentsIn()

template<typename REGION >
size_t rcsc::WorldModel::countOpponentsIn ( const REGION &  region,
const int  count_thr,
const bool  with_goalie 
) const
inline

count the number of opponent exist in the specified region

Parameters
regiontemplate parameter. region to be checked
count_thrconfdence count threshold for players
with_goalieif true, goalie player is cheked.
Returns
total count of opponent existed in the region

◆ countPlayer() [1/2]

size_t rcsc::WorldModel::countPlayer ( const PlayerPredicate predicate) const

get the number of players that satisfy an input predicate.

Parameters
predicatepredicate predicate object for the player condition matching. This have to be a dynamically allocated object.
Returns
number of players.

◆ countPlayer() [2/2]

size_t rcsc::WorldModel::countPlayer ( std::shared_ptr< const PlayerPredicate predicate) const

get the number of players that satisfy an input predicate.

Parameters
predicatepredicate predicate object for the player condition matching.
Returns
number of players.

◆ countTeammatesIn()

template<typename REGION >
size_t rcsc::WorldModel::countTeammatesIn ( const REGION &  region,
const int  count_thr,
const bool  with_goalie 
) const
inline

count the number of teammate exist in the specified region

Parameters
regiontemplate parameter. region to be checked
count_thrconfdence count threshold for players
with_goalieif true, goalie player is cheked.
Returns
total count of teammate existed in the region

◆ dirCount()

int rcsc::WorldModel::dirCount ( const AngleDeg angle) const
inline

get direction confidence count

Parameters
angletarget direction
Returns
confidence count value

◆ dirRangeCount()

int rcsc::WorldModel::dirRangeCount ( const AngleDeg angle,
const double &  width,
int *  max_count,
int *  sum_count,
int *  ave_count 
) const

get max count, sum of count and average count of angle range

Parameters
anglecenter of target angle range
widthangle range
max_countpointer to variable of max accuracy count
sum_countpointer to variable of sum of accuracy count
ave_countpointer to variable of average accuracy count
Returns
steps in the range

◆ existOpponentIn()

template<typename REGION >
bool rcsc::WorldModel::existOpponentIn ( const REGION &  region,
const int  count_thr,
const bool  with_goalie 
) const
inline

template utility. check if opponent exist in the specified region.

Parameters
regiontemplate parameter. region to be checked
count_thrconfdence count threshold for players
with_goalieif true, goalie player is cheked.
Returns
true if some opponent exist

◆ existTeammateIn()

template<typename REGION >
bool rcsc::WorldModel::existTeammateIn ( const REGION &  region,
const int  count_thr,
const bool  with_goalie 
) const
inline

template utility. check if teammate exist in the specified region.

Parameters
regiontemplate parameter. region to be checked
count_thrconfdence count threshold for players
with_goalieif true, goalie player is cheked.

◆ fullstateTime()

const GameTime & rcsc::WorldModel::fullstateTime ( ) const
inline

get last time updated by fullstate

Returns
const reference to the game time object

◆ gameMode()

const GameMode & rcsc::WorldModel::gameMode ( ) const
inline

get current playmode info

Returns
const reference to the GameMode object

◆ getDistOpponentNearestTo()

double rcsc::WorldModel::getDistOpponentNearestTo ( const Vector2D point,
const int  count_thr 
) const
inline

get the distance from input point to the nearest opponent

Parameters
count_thraccuracy count threshold
with_goalieinclude goalie if true
Returns
distance to the matched opponent. if not found, a big value is returned.

◆ getDistOpponentNearestToBall()

double rcsc::WorldModel::getDistOpponentNearestToBall ( const int  count_thr,
const bool  with_goalie = true 
) const
inline

get the distance to opponent nearest to ball wtth accuracy count

Parameters
count_thraccuracy count threshold
with_goalieinclude goalie if true
Returns
distance to the matched opponent. if not found, a big value is returned.

◆ getDistOpponentNearestToSelf()

double rcsc::WorldModel::getDistOpponentNearestToSelf ( const int  count_thr,
const bool  with_goalie = true 
) const
inline

get the distance from opponent nearest to self wtth accuracy count

Parameters
count_thraccuracy count threshold
with_goalieinclude goalie if true
Returns
distance to the matched opponent. if not found, a big value is returned.

◆ getDistTeammateNearestTo()

double rcsc::WorldModel::getDistTeammateNearestTo ( const Vector2D point,
const int  count_thr 
) const
inline

get the distance from input point to the nearest teammate

Parameters
count_thraccuracy count threshold
with_goalieinclude goalie if true
Returns
distance to the matched opponent. if not found, a big value is returned.

◆ getDistTeammateNearestToBall()

double rcsc::WorldModel::getDistTeammateNearestToBall ( const int  count_thr,
const bool  with_goalie 
) const
inline

get the distance to teammate nearest to ball wtth accuracy count

Parameters
count_thraccuracy count threshold
with_goalieinclude goalie if true
Returns
distance to the matched opponent. if not found, a big value is returned.

◆ getDistTeammateNearestToSelf()

double rcsc::WorldModel::getDistTeammateNearestToSelf ( const int  count_thr,
const bool  with_goalie = true 
) const
inline

get the distance from teammate nearest to self wtth accuracy count

Parameters
count_thraccuracy count threshold
with_goalieinclude goalie if true
Returns
distance to the matched opponent. if not found, a big value is returned.

◆ getOpponentNearestTo() [1/2]

const PlayerObject * rcsc::WorldModel::getOpponentNearestTo ( const PlayerObject p,
const int  count_thr,
double *  dist_to_point 
) const
inline

get teammate pointer nearest to the specified player

Parameters
ppointer to the player
count_thraccuracy count threshold
dist_to_pointvariable pointer to store the distance from retuned player to point
Returns
if found, pointer to player object, othewise NULL

◆ getOpponentNearestTo() [2/2]

const PlayerObject * rcsc::WorldModel::getOpponentNearestTo ( const Vector2D point,
const int  count_thr,
double *  dist_to_point 
) const
inline

get opponent pointer nearest to point

Parameters
pointconsidered point
count_thraccuracy count threshold
dist_to_pointvariable pointer to store the distance from retuned player to point
Returns
if found pointer to player object, othewise NULL

◆ getOpponentNearestToBall()

const PlayerObject * rcsc::WorldModel::getOpponentNearestToBall ( const int  count_thr,
const bool  with_goalie = true 
) const
inline

get opponent nearest to ball with confidence count check

Parameters
count_thraccuracy count threshold
with_goalieinclude goalie if true
Returns
if found, const pointer to the PlayerOjbect. else NULL

◆ getOpponentNearestToSelf()

const PlayerObject * rcsc::WorldModel::getOpponentNearestToSelf ( const int  count_thr,
const bool  with_goalie = true 
) const
inline

get opponent nearest to self with accuracy count check

Parameters
count_thraccuracy count threshold
with_goalieinclude goalie if true
Returns
if found, const pointer to the PlayerOjbect. else NULL

◆ getOurGoalie()

const AbstractPlayerObject * rcsc::WorldModel::getOurGoalie ( ) const

get a goalie teammate (include self)

Returns
if found pointer to goalie object, otherwise NULL

◆ getPlayers() [1/4]

void rcsc::WorldModel::getPlayers ( AbstractPlayerObject::Cont result,
const PlayerPredicate predicate 
) const

get the new container of AbstractPlayer matched with the predicate.

Parameters
resultreference to the result variable
predicatepredicate object for the player condition matching. This have to be a dynamically allocated object.

◆ getPlayers() [2/4]

void rcsc::WorldModel::getPlayers ( AbstractPlayerObject::Cont result,
std::shared_ptr< const PlayerPredicate predicate 
) const

get the new container of AbstractPlayer matched with the predicate.

Parameters
contreference to the result variable
predicatepredicate object for the player condition matching.

◆ getPlayers() [3/4]

AbstractPlayerObject::Cont rcsc::WorldModel::getPlayers ( const PlayerPredicate predicate) const

get the new container of AbstractPlayer matched with the predicate.

Parameters
predicatepredicate object for the player condition matching. This have to be a dynamically allocated object.
Returns
container of AbstractPlayer pointer.

◆ getPlayers() [4/4]

AbstractPlayerObject::Cont rcsc::WorldModel::getPlayers ( std::shared_ptr< const PlayerPredicate predicate) const

get the new container of AbstractPlayer matched with the predicate.

Parameters
predicatepredicate object for the player condition matching.
Returns
container of AbstractPlayer pointer.

◆ getPointCount()

int rcsc::WorldModel::getPointCount ( const Vector2D point,
const double &  dir_thr 
) const

get the specific point accuracy count

Parameters
pointglobal cooridinate value of checked point
dir_thrdirection threshold for view area
Returns
accuracy count. if player has not seen the point, returnthe big value (e.g. 1000).

◆ getSetPlayCount()

int rcsc::WorldModel::getSetPlayCount ( ) const
inline

get cycle count that setplay type playmode is keeped

Returns
counted long integer

◆ getTeammateNearestTo() [1/2]

const PlayerObject * rcsc::WorldModel::getTeammateNearestTo ( const PlayerObject p,
const int  count_thr,
double *  dist_to_point 
) const
inline

get teammate pointer nearest to the specified player

Parameters
ppointer to the player
count_thraccuracy count threshold
dist_to_pointvariable pointer to store the distance from retuned player to point
Returns
if found, pointer to player object, othewise NULL

◆ getTeammateNearestTo() [2/2]

const PlayerObject * rcsc::WorldModel::getTeammateNearestTo ( const Vector2D point,
const int  count_thr,
double *  dist_to_point 
) const
inline

get teammate pointer nearest to point

Parameters
pointconsidered point
count_thrconfidence count threshold
dist_to_pointvariable pointer to store the distance from retuned player to point
Returns
if found, pointer to player object, othewise NULL

◆ getTeammateNearestToBall()

const PlayerObject * rcsc::WorldModel::getTeammateNearestToBall ( const int  count_thr,
const bool  with_goalie = true 
) const
inline

get teammate nearest to with with confidence count check

Parameters
count_thraccuracy count threshold
with_goalieinclude goalie if true
Returns
if found, const pointer to the PlayerOjbect. else NULL

◆ getTeammateNearestToSelf()

const PlayerObject * rcsc::WorldModel::getTeammateNearestToSelf ( const int  count_thr,
const bool  with_goalie = true 
) const
inline

get teammate nearest to self with confidence count check

Parameters
count_thraccuracy count threshold
with_goalieinclude goalie if true
Returns
if found, const pointer to the PlayerOjbect. else NULL

◆ getTheirGoalie()

const AbstractPlayerObject * rcsc::WorldModel::getTheirGoalie ( ) const

\get opponent goalie pointer

Returns
if found pointer to goalie object, otherwise NULL

◆ init()

bool rcsc::WorldModel::init ( const std::string &  team_name,
const SideID  our_side,
const int  unum,
const bool  goalie,
const double  client_version 
)

initialize by team information

Parameters
team_nameour team name string
our_sideour side ID
unummy uniform number
goalietrue if I am goalie
client_versionthe client protocol version
Returns
true if successfully initialized, false otherwise

This method is called just after receive init reply

◆ interceptTable()

const InterceptTable & rcsc::WorldModel::interceptTable ( ) const
inline

get intercept table

Returns
const pointer to the intercept table instance

◆ isValid()

bool rcsc::WorldModel::isValid ( ) const

get this world mode is valid or not

Returns
true if this world model is valid

◆ kickableOpponent()

const PlayerObject * rcsc::WorldModel::kickableOpponent ( ) const
inline

get the estimated kickable opponent if exist.

Returns
player object pointer

◆ kickableTeammate()

const PlayerObject * rcsc::WorldModel::kickableTeammate ( ) const
inline

get the estimated kickable teammate if exist.

Returns
player object pointer

◆ lastKickerSide()

SideID rcsc::WorldModel::lastKickerSide ( ) const
inline

get the estimated last kicker's side

Returns
side id

◆ lastKickerUnum()

int rcsc::WorldModel::lastKickerUnum ( ) const
inline

get the estimated last kicker's uniform number

Returns
uniform number

◆ lastSetPlayStartTime()

const GameTime & rcsc::WorldModel::lastSetPlayStartTime ( ) const
inline

get last setplay type playmode start time

Returns
const reference to the game time object

◆ maybeKickableOpponent()

const PlayerObject * rcsc::WorldModel::maybeKickableOpponent ( ) const
inline

get the estimated kickable opponent (maybe kickable).

Returns
player object pointer

◆ maybeKickableTeammate()

const PlayerObject * rcsc::WorldModel::maybeKickableTeammate ( ) const
inline

get the estimated kickable teammate (maybe kickable).

Returns
player object pointer

◆ offsideLineCount()

int rcsc::WorldModel::offsideLineCount ( ) const
inline

get the accuracy count for the offside line

Returns
accuracy count

◆ offsideLineX()

double rcsc::WorldModel::offsideLineX ( ) const
inline

get estimated offside line x coordinate

Returns
offside line

◆ opponents()

const PlayerObject::Cont & rcsc::WorldModel::opponents ( ) const
inline

get opponents(include unknown players). the order is undefined

Returns
const reference to the PlayerObject container

◆ opponentsFromBall()

const PlayerObject::Cont & rcsc::WorldModel::opponentsFromBall ( ) const
inline

get opponents sorted by distance from ball (includes unknown players)

Returns
const reference to the PlayerObject pointer container

◆ opponentsFromSelf()

const PlayerObject::Cont & rcsc::WorldModel::opponentsFromSelf ( ) const
inline

get opponents sorted by distance from self (includes unknown players)

Returns
const reference to the PlayerObject pointer container

◆ ourCard()

Card rcsc::WorldModel::ourCard ( const int  unum) const
inline

get teammate's yellow card status

Parameters
unumuniform number
Returns
yellow card status

◆ ourDefenseLineX()

double rcsc::WorldModel::ourDefenseLineX ( ) const
inline

get our defense line (consider ball pos)(offside line for opponent)

Returns
our defense line x

◆ ourDefensePlayerLineX()

double rcsc::WorldModel::ourDefensePlayerLineX ( ) const
inline

get our defense player line (not consder ball pos)

Returns
our defense player line x

◆ ourGoalieUnum()

int rcsc::WorldModel::ourGoalieUnum ( ) const
inline

get the uniform number of teammate goalie

Returns
uniform number value or Unum_Unknown

◆ ourOffenseLineX()

double rcsc::WorldModel::ourOffenseLineX ( ) const
inline

our offense line (consider ball pos)

Returns
our offense line x

◆ ourOffensePlayerLineX()

double rcsc::WorldModel::ourOffensePlayerLineX ( ) const
inline

get our offense player line (not consder ball pos)

Returns
our offense player line x

◆ ourPlayer()

const AbstractPlayerObject * rcsc::WorldModel::ourPlayer ( const int  unum) const
inline

get a teammate (or self) specified by uniform number

Parameters
unumwanted player's uniform number
Returns
const pointer to the AbstractPlayerObject instance or NULL

◆ ourPlayers()

const AbstractPlayerObject::Cont & rcsc::WorldModel::ourPlayers ( ) const
inline

get all teammate players includes self.

Returns
const rerefence to the AbstractPlayerObject pointer container.

◆ ourPlayerType()

const PlayerType * rcsc::WorldModel::ourPlayerType ( const int  unum) const

get player type of the specified teammate

Parameters
unumtarget teammate uniform number
Returns
const pointer to the player type object instance

◆ ourPlayerTypeId()

int rcsc::WorldModel::ourPlayerTypeId ( const int  unum) const
inline

get player type Id of teammate

Parameters
unumtarget teammate uniform number
Returns
player type Id. if unum is illegal, Default Id is returned.

◆ ourRecovery()

double rcsc::WorldModel::ourRecovery ( const int  unum) const
inline

get (heard) recovery value of the specified player

Returns
recovery value

◆ ourSide()

SideID rcsc::WorldModel::ourSide ( ) const
inline

get our team side Id

Returns
side Id

◆ ourStaminaCapacity()

double rcsc::WorldModel::ourStaminaCapacity ( const int  unum) const
inline

get (heard) stamina capacity value of the specified player

Returns
recovery value

◆ penaltyKickState()

const PenaltyKickState * rcsc::WorldModel::penaltyKickState ( ) const

get penalty kick state

Returns
const pointer to the penalty kick state instance

◆ prevBall()

const BallObject & rcsc::WorldModel::prevBall ( ) const
inline

get the previous ball info

Returns
const reference to the BallObject

◆ prevOffsideLineX()

double rcsc::WorldModel::prevOffsideLineX ( ) const
inline

get estimated offside line x coordinate

Returns
offside line

◆ seeTime()

const GameTime & rcsc::WorldModel::seeTime ( ) const
inline

get last time updated by see

Returns
const reference to the game time object

◆ self()

const SelfObject & rcsc::WorldModel::self ( ) const
inline

get self info

Returns
const reference to the SelfObject

◆ senseBodyTime()

const GameTime & rcsc::WorldModel::senseBodyTime ( ) const
inline

get last time updated by sense_body

Returns
const reference to the game time object

◆ setAudioMemory()

void rcsc::WorldModel::setAudioMemory ( std::shared_ptr< AudioMemory memory)

set new audio memory

Parameters
memorypointer to the memory instance. This must be a dynamically allocated object.

◆ setCard()

void rcsc::WorldModel::setCard ( const SideID  side,
const int  unum,
const Card  card 
)

set yellow card information

Parameters
sidepunished player's side
unumpunished player's unum
cardcard type

◆ setLocalization()

void rcsc::WorldModel::setLocalization ( std::shared_ptr< Localization localization)

set new localization method

Parameters
localizationpointer to the localization instance.

◆ setOurGoalieUnum()

void rcsc::WorldModel::setOurGoalieUnum ( const int  unum)

set our goalie's uniform number using strategic information or coach message.

Parameters
unumuniform number

◆ setOurPlayerType()

void rcsc::WorldModel::setOurPlayerType ( const int  unum,
const int  id 
)

set teammate player type & reset card status

Parameters
unumuniform number of changed teammate
idplayer type ID

◆ setPenaltyKickTakerOrder()

void rcsc::WorldModel::setPenaltyKickTakerOrder ( const std::vector< int > &  unum_set)

set current penalty kick taker.

Parameters
orderorder number [0,10]
unumkick taker's uniform number

◆ setTheirGoalieUnum()

void rcsc::WorldModel::setTheirGoalieUnum ( const int  unum)

set their goalie's uniform number using coach message.

Parameters
unumuniform number

◆ setTheirPlayerType()

void rcsc::WorldModel::setTheirPlayerType ( const int  unum,
const int  id 
)

set opponent player type & reset card status

Parameters
unumuniform number of changed opponent
idplayer type ID

◆ setTrainingTime()

void rcsc::WorldModel::setTrainingTime ( const GameTime t)
inline

set training start/end time

Parameters
tgame time

◆ setValid()

void rcsc::WorldModel::setValid ( bool  is_valid)

set this world mode is valid or not

Parameters
is_validvalue to be set

◆ setViewMode()

void rcsc::WorldModel::setViewMode ( const ViewWidth w,
const ViewQuality q 
)
inline

update self view move

Parameters
wnew view width
qnew view quality

◆ teammates()

const PlayerObject::Cont & rcsc::WorldModel::teammates ( ) const
inline

get teammates. the order is undefined.

Returns
const reference to the PlayerObject pointer container

◆ teammatesFromBall()

const PlayerObject::Cont & rcsc::WorldModel::teammatesFromBall ( ) const
inline

get teammates sorted by distance from ball

Returns
const reference to the PlayerObject pointer container

◆ teammatesFromSelf()

const PlayerObject::Cont & rcsc::WorldModel::teammatesFromSelf ( ) const
inline

get teammates sorted by distance from self

Returns
const reference to the PlayerObject pointer container

◆ teamName()

const std::string & rcsc::WorldModel::teamName ( ) const
inline

get our teamname

Returns
const reference to the team name string

◆ theirCard()

Card rcsc::WorldModel::theirCard ( const int  unum) const
inline

get opponent's yellow card status

Parameters
unumuniform number
Returns
yellow card status

◆ theirDefenseLineX()

double rcsc::WorldModel::theirDefenseLineX ( ) const
inline

get their defense line x value (consider ball pos)

Returns
their offense line x

◆ theirDefensePlayerLineX()

double rcsc::WorldModel::theirDefensePlayerLineX ( ) const
inline

get estimated their offense line x value

Returns
their offense line x

◆ theirGoalieUnum()

int rcsc::WorldModel::theirGoalieUnum ( ) const
inline

get the uniform number of opponent goalie

Returns
uniform number value or Unum_Unknown

◆ theirOffenseLineX()

double rcsc::WorldModel::theirOffenseLineX ( ) const
inline

get their offense line (consider ball pos)

Returns
their offense line x

◆ theirOffensePlayerLineX()

double rcsc::WorldModel::theirOffensePlayerLineX ( ) const
inline

get their offense player line (not consder ball pos)

Returns
our defense player line x

◆ theirPlayer()

const AbstractPlayerObject * rcsc::WorldModel::theirPlayer ( const int  unum) const
inline

get an opponent specified by uniform number

Parameters
unumwanted player's uniform number
Returns
const pointer to the AbstractPlayerObject instance or NULL

◆ theirPlayers()

const AbstractPlayerObject::Cont & rcsc::WorldModel::theirPlayers ( ) const
inline

get all opponent players (includes unknown players)

Returns
const rerefence to the AbstractPlayerObject pointer container.

◆ theirPlayerType()

const PlayerType * rcsc::WorldModel::theirPlayerType ( const int  unum) const

get player type of the specified opponent

Parameters
unumtarget opponent uniform number
Returns
const pointer to the player type object instance

◆ theirPlayerTypeId()

int rcsc::WorldModel::theirPlayerTypeId ( const int  unum) const
inline

get player type Id of opponent

Parameters
unumtarget teammate uniform number
Returns
player type Id. if unum is illegal, Unknown is returned.

◆ theirSide()

SideID rcsc::WorldModel::theirSide ( ) const
inline

get opponent team side Id

Returns
side Id

◆ theirTeamName()

const std::string & rcsc::WorldModel::theirTeamName ( ) const
inline

get their teamname

Returns
const reference to the team name string

◆ time()

const GameTime & rcsc::WorldModel::time ( ) const
inline

get last updated time (== current game time)

Returns
const reference to the game time object

◆ trainingTime()

const GameTime & rcsc::WorldModel::trainingTime ( ) const
inline

get training start/end time

Returns
game time object

◆ updateAfterFullstate()

void rcsc::WorldModel::updateAfterFullstate ( const FullstateSensor fullstate,
const ActionEffector act,
const GameTime current 
)

update by fullstate info

Parameters
fullstateanalyzed fullstate info
actaction effector
currentcurrent game time

This method is called just after fullstate message receive

◆ updateAfterSee()

void rcsc::WorldModel::updateAfterSee ( const VisualSensor see,
const BodySensor sense_body,
const ActionEffector act,
const GameTime current 
)

update by see info

Parameters
seeanalyzed see info
sense_bodyanalyzed sense_body info
actaction effector
currentcurrent game time

This method is called just after see message receive

◆ updateAfterSenseBody()

void rcsc::WorldModel::updateAfterSenseBody ( const BodySensor sense_body,
const ActionEffector act,
const GameTime current 
)

update by sense_body.

Parameters
sense_bodyanalyzed sense_body info
actaction effector
currentcurrent game time

This method is called just after sense_body message receive

◆ updateGameMode()

void rcsc::WorldModel::updateGameMode ( const GameMode game_mode,
const GameTime current 
)

update current playmode

Parameters
game_modeplaymode info
currentcurrent game time

This method is called after heared referee message

◆ updateJustAfterDecision()

void rcsc::WorldModel::updateJustAfterDecision ( const ActionEffector act)

update using internal by command effects. This method is called just before command sending.

Parameters
actActionEffector object.

◆ updateJustBeforeDecision()

void rcsc::WorldModel::updateJustBeforeDecision ( const ActionEffector act,
const GameTime current 
)

internal update for action decision

Parameters
actaction effector
currentcurrent game time

This method is called just before action decision to update and adjust world model.

◆ updatePlayer()

void rcsc::WorldModel::updatePlayer ( const PlayerObject player,
const SideID  side,
const int  unum,
const bool  goalie 
)

set player's side/unum/goalie information

Parameters
playerplayer object pointer
unumnew uniform number
goaliegoalie flag

◆ viewAreaCont()

const ViewAreaCont & rcsc::WorldModel::viewAreaCont ( ) const
inline

get view area history container

Returns
const refrence to the view area container.

◆ viewGridMap()

const ViewGridMap & rcsc::WorldModel::viewGridMap ( ) const
inline

get field grid map that holds observation accuracy count

Returns
const reference to the ViewGridMap instance

The documentation for this class was generated from the following file: