クラス rcsc::WorldModel

player's internal field status [詳細]

#include <world_model.h>

すべてのメンバ一覧

Public 型

enum  { DIR_CONF_DIVS = 72 }

Public メソッド

 WorldModel ()
 initialize member variables
 ~WorldModel ()
 delete dynamic allocated memory
const InterceptTableinterceptTable () const
 get intercept table
const PenaltyKickStatepenaltyKickState () const
 get penalty kick state
const AudioMemoryaudioMemory () const
 get audio memory
bool initTeamInfo (const std::string &teamname, const SideID ourside, const int my_unum, const bool my_goalie)
 init team info
void setAudioMemory (boost::shared_ptr< AudioMemory > memory)
 set new audio memory
void setTeammatePlayerType (const int unum, const int id)
 set teammate player type
void setOpponentPlayerType (const int unum, const int id)
 set opponent player type
void updateAfterSense (const BodySensor &sense, const ActionEffector &act, const GameTime &current)
 update by sense_body.
void updateAfterSee (const VisualSensor &see, const BodySensor &sense, const ActionEffector &act, const GameTime &current)
 update by see info
void updateAfterFullstate (const FullstateSensor &fullstate, const ActionEffector &act, const GameTime &current)
 update by fullstate info
void updateGameMode (const GameMode &game_mode, const GameTime &current)
 update current playmode
void setViewMode (const ViewWidth &w, const ViewQuality &q)
 update self view move
void updateJustBeforeDecision (const ActionEffector &act, const GameTime &current)
 internal update for action decision
void setCommandEffect (const ActionEffector &act)
 internal update using internal info and stored command info.
const std::string & teamName () const
 get our teamname
SideID ourSide () const
 get our team side Id
const std::string & opponentTeamName () const
 get opponent teamname
SideID theirSide () const
 get opponent team side Id
bool isOurLeft () const
 check if our team is left or not
bool isOurRight () const
 check if our team is right or not
const GameTimetime () const
 get last updated time (== current game time)
const GameTimeseeTime () const
 get last time updated by see
const GameTimefullstateTime () const
 get last time updated by fullstate
const GameTimelastSetPlayStartTime () const
 get last time updated by fullstate get last setplay type playmode start time
const long & setplayCount () const
 get cycle count that setplay type playmode is keeped
const GameModegameMode () const
 get current playmode info
const SelfObjectself () const
 get self info
const BallObjectball () const
 get ball info
const BallRecord & ballRecord () const
 get ball record container
const PlayerCont & teammates () const
 get teammate info
const PlayerCont & opponents () const
 get opponent info
const PlayerCont & unknownPlayers () const
 get unknown player info
const PlayerPtrCont & teammatesFromSelf () const
 get teammates sorted by distance from self
const PlayerPtrCont & opponentsFromSelf () const
 get opponents sorted by distance from self
const PlayerPtrCont & teammatesFromBall () const
 get teammates sorted by distance from ball
const PlayerPtrCont & opponentsFromBall () const
 get opponents sorted by distance from ball
int opponentGoalieUnum () const
 get the uniform number of opponent goalie
const AbstractPlayerCont & allPlayers () const
 get all players including self.
const AbstractPlayerCont & allTeammates () const
 get all teammates including self.
const AbstractPlayerCont & allOpponents () const
 get all opponents including self.
const AbstractPlayerObjectteammate (const int unum) const
 get number specified teammate player object pointer
const AbstractPlayerObjectopponent (const int unum) const
 get number specified opponent player object pointer
const PlayerObjectgetFirstPlayer (PlayerPtrCont::const_iterator first, PlayerPtrCont::const_iterator last, const int count_thr) const
 get fist PlayerObject in [first, last] that satisfies confidence count threshold
const PlayerObjectgetTeammateNearestToSelf (const int count_thr) const
 get teammate nearest to self with confidence count check
const PlayerObjectgetOpponentNearestToSelf (const int count_thr) const
 get opponent nearest to self with accuracy count check
double getDistTeammateNearestToSelf (const int count_thr) const
 get the distance to teammate nearest to self wtth accuracy count
double getDistOpponentNearestToSelf (const int count_thr) const
 get the distance to opponent nearest to self wtth accuracy count
const PlayerObjectgetTeammateNearestToBall (const int count_thr) const
 get teammate nearest to with with confidence count check
const PlayerObjectgetOpponentNearestToBall (const int count_thr) const
 get opponent nearest to ball with confidence count check
double getDistTeammateNearestToBall (const int count_thr) const
 get the distance to teammate nearest to ball wtth accuracy count
double getDistOpponentNearestToBall (const int count_thr) const
 get the distance to opponent nearest to ball wtth accuracy count
const double & offsideLineX () const
 get estimated offside line x coordinate
int offsideLineCount () const
 get the accuracy count for the offside line
const double & defenseLineX () const
 get estimated defside line(offside line for opponent) x coordinate
bool existKickableTeammate () const
 check if exist kickable teammate
bool existKickableOpponent () const
 check if exist kickable opponent
int teammateHeteroID (const int unum) const
 get player type Id of teammate
const PlayerTypeteammatePlayerType (const int unum) const
 get player type of the specified teammate
int opponentHeteroID (const int unum) const
 get player type Id of opponent
const PlayerTypeopponentPlayerType (const int unum) const
 get player type of the specified opponent
int dirCount (const AngleDeg &angle) const
 get direction confidence count
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
const ViewAreaCont & viewAreaCont () const
 get view area history container
int getPointCount (const Vector2D &point, const double &dir_thr) const
 get the point accuracy count
AbstractPlayerCont getPlayerCont (const PlayerPredicate *predicate) const
 get the new container of AbstractPlayer matched with the predicate.
void getPlayerCont (AbstractPlayerCont &cont, const PlayerPredicate *predicate) const
 get the new container of AbstractPlayer matched with the predicate.
const PlayerObjectgetOpponentGoalie () const
 get opponent goalie pointer
const PlayerObjectgetTeammateNearestTo (const Vector2D &point, const int count_thr, double *dist_to_point) const
 get teammate pointer nearest to point
const PlayerObjectgetTeammateNearestTo (const PlayerObject *p, const int count_thr, double *dist_to_point) const
 get teammate pointer nearest to the specified player
const PlayerObjectgetOpponentNearestTo (const Vector2D &point, const int count_thr, double *dist_to_point) const
 get opponent pointer nearest to point
const PlayerObjectgetOpponentNearestTo (const PlayerObject *p, const int count_thr, double *dist_to_point) const
 get teammate pointer nearest to the specified player
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.
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.
template<typename REGION>
int countTeammatesIn (const REGION &region, const int count_thr, const bool with_goalie) const
 count the number of teammate exist in the specified region
template<typename REGION>
int countOpponentsIn (const REGION &region, const int count_thr, const bool with_goalie) const
 count the number of opponent exist in the specified region

Static Public 変数

static const std::size_t MAX_RECORD
 maximum number of record
static const double DIR_STEP
 the angle steps for dir confidence


説明

player's internal field status


関数

const InterceptTable * rcsc::WorldModel::interceptTable (  )  const

get intercept table

戻り値:
const pointer to the intercept table instance

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

get penalty kick state

戻り値:
const pointer to the penalty kick state instance

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

get audio memory

戻り値:
const reference to the audio memory instance

bool rcsc::WorldModel::initTeamInfo ( const std::string &  teamname,
const SideID  ourside,
const int  my_unum,
const bool  my_goalie 
)

init team info

引数:
teamname our team name string
ourside our side ID
my_unum my uniform number
my_goalie true if I am goalie
戻り値:
true if successfully initialized, false otherwise
This method is called just after receive init reply

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

set new audio memory

引数:
memory pointer to the memory instance. This must be a dynamically allocated object.

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

set teammate player type

引数:
unum uniform number of changed teammate
id player type ID

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

set opponent player type

引数:
unum uniform number of changed opponent
id player type ID

void rcsc::WorldModel::updateAfterSense ( const BodySensor sense,
const ActionEffector act,
const GameTime current 
)

update by sense_body.

引数:
sense sense_body info
act action effector
current current game time
This method is called just after sense_body message receive

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

update by see info

引数:
see analyzed see info
sense analyzed sense_body info
act action effector
current current game time
This method is called just after see message receive

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

update by fullstate info

引数:
fullstate analyzed fullstate info
act action effector
current current game time
This method is called just after fullstate message receive

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

update current playmode

引数:
game_mode playmode info
current current game time
This method is called after heared referee message

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

update self view move

引数:
w new view width
q new view quality

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

internal update for action decision

引数:
act action effector
current current game time
This method is called just before action decision to update and adjust world model.

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

internal update using internal info and stored command info.

引数:
act ActionEffector object
called just before command send

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

get our teamname

戻り値:
const reference to the team name string

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

get our team side Id

戻り値:
side Id

const std::string& rcsc::WorldModel::opponentTeamName (  )  const [inline]

get opponent teamname

戻り値:
const reference to the team name string

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

get opponent team side Id

戻り値:
side Id

bool rcsc::WorldModel::isOurLeft (  )  const [inline]

check if our team is left or not

戻り値:
true if our team is left side

bool rcsc::WorldModel::isOurRight (  )  const [inline]

check if our team is right or not

戻り値:
true if our team is right side

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

get last updated time (== current game time)

戻り値:
const reference to the game time object

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

get last time updated by see

戻り値:
const reference to the game time object

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

get last time updated by fullstate

戻り値:
const reference to the game time object

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

get last time updated by fullstate get last setplay type playmode start time

戻り値:
const reference to the game time object

const long& rcsc::WorldModel::setplayCount (  )  const [inline]

get cycle count that setplay type playmode is keeped

戻り値:
counted long integer

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

get current playmode info

戻り値:
const reference to the GameMode object

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

get self info

戻り値:
const reference to the SelfObject

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

get ball info

戻り値:
const reference to the BallObject

const BallRecord& rcsc::WorldModel::ballRecord (  )  const [inline]

get ball record container

戻り値:
const reference to the BallObject

const PlayerCont& rcsc::WorldModel::teammates (  )  const [inline]

get teammate info

戻り値:
const reference to the PlayerObject container

const PlayerCont& rcsc::WorldModel::opponents (  )  const [inline]

get opponent info

戻り値:
const reference to the PlayerObject container

const PlayerCont& rcsc::WorldModel::unknownPlayers (  )  const [inline]

get unknown player info

戻り値:
const reference to the PlayerObject container

const PlayerPtrCont& rcsc::WorldModel::teammatesFromSelf (  )  const [inline]

get teammates sorted by distance from self

戻り値:
const reference to the PlayerObject pointer container

const PlayerPtrCont& rcsc::WorldModel::opponentsFromSelf (  )  const [inline]

get opponents sorted by distance from self

戻り値:
const reference to the PlayerObject pointer container

const PlayerPtrCont& rcsc::WorldModel::teammatesFromBall (  )  const [inline]

get teammates sorted by distance from ball

戻り値:
const reference to the PlayerObject pointer container

const PlayerPtrCont& rcsc::WorldModel::opponentsFromBall (  )  const [inline]

get opponents sorted by distance from ball

戻り値:
const reference to the PlayerObject pointer container

int rcsc::WorldModel::opponentGoalieUnum (  )  const [inline]

get the uniform number of opponent goalie

戻り値:
uniform number value or Unum_Unknown

const AbstractPlayerCont& rcsc::WorldModel::allPlayers (  )  const [inline]

get all players including self.

戻り値:
const rerefence to the AbstractPlayerObject pointer container..

const AbstractPlayerCont& rcsc::WorldModel::allTeammates (  )  const [inline]

get all teammates including self.

戻り値:
const rerefence to the AbstractPlayerObject pointer container..

const AbstractPlayerCont& rcsc::WorldModel::allOpponents (  )  const [inline]

get all opponents including self.

戻り値:
const rerefence to the AbstractPlayerObject pointer container..

const AbstractPlayerObject* rcsc::WorldModel::teammate ( const int  unum  )  const [inline]

get number specified teammate player object pointer

引数:
unum wanted player's uniform number
戻り値:
const pointer to the PlayerObject instance or NULL

const AbstractPlayerObject* rcsc::WorldModel::opponent ( const int  unum  )  const [inline]

get number specified opponent player object pointer

引数:
unum wanted player's uniform number
戻り値:
const pointer to the PlayerObject instance or NULL

const PlayerObject* rcsc::WorldModel::getFirstPlayer ( PlayerPtrCont::const_iterator  first,
PlayerPtrCont::const_iterator  last,
const int  count_thr 
) const [inline]

get fist PlayerObject in [first, last] that satisfies confidence count threshold

引数:
first first iterator of PlayerObject pointer container
last last iterator of PlayerObject pointer container
count_thr accuracy count threshold
戻り値:
if found, const pointer to the PlayerOjbect. else NULL

const PlayerObject* rcsc::WorldModel::getTeammateNearestToSelf ( const int  count_thr  )  const [inline]

get teammate nearest to self with confidence count check

引数:
count_thr accuracy count threshold
戻り値:
if found, const pointer to the PlayerOjbect. else NULL

const PlayerObject* rcsc::WorldModel::getOpponentNearestToSelf ( const int  count_thr  )  const [inline]

get opponent nearest to self with accuracy count check

引数:
count_thr accuracy count threshold
戻り値:
if found, const pointer to the PlayerOjbect. else NULL

double rcsc::WorldModel::getDistTeammateNearestToSelf ( const int  count_thr  )  const [inline]

get the distance to teammate nearest to self wtth accuracy count

引数:
count_thr accuracy count threshold
戻り値:
distance to the matched opponent. if not found, a big value is returned.

double rcsc::WorldModel::getDistOpponentNearestToSelf ( const int  count_thr  )  const [inline]

get the distance to opponent nearest to self wtth accuracy count

引数:
count_thr accuracy count threshold
戻り値:
distance to the matched opponent. if not found, a big value is returned.

const PlayerObject* rcsc::WorldModel::getTeammateNearestToBall ( const int  count_thr  )  const [inline]

get teammate nearest to with with confidence count check

引数:
count_thr accuracy count threshold
戻り値:
if found, const pointer to the PlayerOjbect. else NULL

const PlayerObject* rcsc::WorldModel::getOpponentNearestToBall ( const int  count_thr  )  const [inline]

get opponent nearest to ball with confidence count check

引数:
count_thr accuracy count threshold
戻り値:
if found, const pointer to the PlayerOjbect. else NULL

double rcsc::WorldModel::getDistTeammateNearestToBall ( const int  count_thr  )  const [inline]

get the distance to teammate nearest to ball wtth accuracy count

引数:
count_thr accuracy count threshold
戻り値:
distance to the matched opponent. if not found, a big value is returned.

double rcsc::WorldModel::getDistOpponentNearestToBall ( const int  count_thr  )  const [inline]

get the distance to opponent nearest to ball wtth accuracy count

引数:
count_thr accuracy count threshold
戻り値:
distance to the matched opponent. if not found, a big value is returned.

const double& rcsc::WorldModel::offsideLineX (  )  const [inline]

get estimated offside line x coordinate

戻り値:
real value

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

get the accuracy count for the offside line

戻り値:
accuracy count

const double& rcsc::WorldModel::defenseLineX (  )  const [inline]

get estimated defside line(offside line for opponent) x coordinate

戻り値:
real value

bool rcsc::WorldModel::existKickableTeammate (  )  const [inline]

check if exist kickable teammate

戻り値:
true if agent estimated that kickable teammate exists

bool rcsc::WorldModel::existKickableOpponent (  )  const [inline]

check if exist kickable opponent

戻り値:
true if agent estimated that kickable opponent exists

int rcsc::WorldModel::teammateHeteroID ( const int  unum  )  const [inline]

get player type Id of teammate

引数:
unum target teammate uniform number
戻り値:
player type Id. if unum is illegal, Default Id is returned.

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

get player type of the specified teammate

引数:
unum target teammate uniform number
戻り値:
const pointer to the player type object instance

int rcsc::WorldModel::opponentHeteroID ( const int  unum  )  const [inline]

get player type Id of opponent

引数:
unum target teammate uniform number
戻り値:
player type Id. if unum is illegal, Unknown is returned.

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

get player type of the specified opponent

引数:
unum target opponent uniform number
戻り値:
const pointer to the player type object instance

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

get direction confidence count

引数:
angle target direction
戻り値:
confidence count value

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

引数:
angle center of target angle range
width angle range
max_count pointer to variable of max accuracy count
sum_count pointer to variable of sum of accuracy count
ave_count pointer to variable of average accuracy count
戻り値:
steps in the range

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

get view area history container

戻り値:
const refrence to the view area container.

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

get the point accuracy count

引数:
point global cooridinate value of checked point
戻り値:
accuracy count. if player has not seen the point, returnthe big value (e.g. 1000).

AbstractPlayerCont rcsc::WorldModel::getPlayerCont ( const PlayerPredicate predicate  )  const

get the new container of AbstractPlayer matched with the predicate.

引数:
predicate predicate object for the player condition matching. This have to be a dynamically allocated object.
戻り値:
container of AbstractPlayer pointer.

void rcsc::WorldModel::getPlayerCont ( AbstractPlayerCont &  cont,
const PlayerPredicate predicate 
) const

get the new container of AbstractPlayer matched with the predicate.

引数:
cont reference to the result variable
predicate predicate object for the player condition matching. This have to be a dynamically allocated object.

const PlayerObject * rcsc::WorldModel::getOpponentGoalie (  )  const

get opponent goalie pointer

戻り値:
if found pointer to goalie object, othewise NULL

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

get teammate pointer nearest to point

引数:
point considered point
count_thr cinfidence count threshold
dist_to_point variable pointer to store the distance from retuned player to point
戻り値:
if found, pointer to player object, othewise NULL

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

引数:
p pointer to the player
count_thr accuracy count threshold
dist_to_point variable pointer to store the distance from retuned player to point
戻り値:
if found, pointer to player object, othewise NULL

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

get opponent pointer nearest to point

引数:
point considered point
count_thr accuracy count threshold
dist_to_point variable pointer to store the distance from retuned player to point
戻り値:
if found pointer to player object, othewise NULL

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

引数:
p pointer to the player
count_thr accuracy count threshold
dist_to_point variable pointer to store the distance from retuned player to point
戻り値:
if found, pointer to player object, othewise NULL

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.

引数:
region template parameter. region to be checked
count_thr confdence count threshold for players
with_goalie if true, goalie player is cheked.

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.

引数:
region template parameter. region to be checked
count_thr confdence count threshold for players
with_goalie if true, goalie player is cheked.
戻り値:
true if some opponent exist

template<typename REGION>
int 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

引数:
region template parameter. region to be checked
count_thr confdence count threshold for players
with_goalie if true, goalie player is cheked.
戻り値:
total count of teammate existed in the region

template<typename REGION>
int 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

引数:
region template parameter. region to be checked
count_thr confdence count threshold for players
with_goalie if true, goalie player is cheked.
戻り値:
total count of opponent existed in the region


このクラスの説明は次のファイルから生成されました:
librcscに対してThu May 1 15:41:28 2008に生成されました。  doxygen 1.5.0