#include <world_model.h>
Public 型 | |
enum | { DIR_CONF_DIVS = 72 } |
Public メソッド | |
WorldModel () | |
initialize member variables | |
~WorldModel () | |
delete dynamic allocated memory | |
const InterceptTable * | interceptTable () const |
get intercept table | |
const PenaltyKickState * | penaltyKickState () const |
get penalty kick state | |
const AudioMemory & | audioMemory () 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 ¤t) |
update by sense_body. | |
void | updateAfterSee (const VisualSensor &see, const BodySensor &sense, const ActionEffector &act, const GameTime ¤t) |
update by see info | |
void | updateAfterFullstate (const FullstateSensor &fullstate, const ActionEffector &act, const GameTime ¤t) |
update by fullstate info | |
void | updateGameMode (const GameMode &game_mode, const GameTime ¤t) |
update current playmode | |
void | setViewMode (const ViewWidth &w, const ViewQuality &q) |
update self view move | |
void | updateJustBeforeDecision (const ActionEffector &act, const GameTime ¤t) |
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 GameTime & | time () const |
get last updated time (== current game time) | |
const GameTime & | seeTime () const |
get last time updated by see | |
const GameTime & | fullstateTime () const |
get last time updated by fullstate | |
const GameTime & | lastSetPlayStartTime () 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 GameMode & | gameMode () const |
get current playmode info | |
const SelfObject & | self () const |
get self info | |
const BallObject & | ball () 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 AbstractPlayerObject * | teammate (const int unum) const |
get number specified teammate player object pointer | |
const AbstractPlayerObject * | opponent (const int unum) const |
get number specified opponent player object pointer | |
const PlayerObject * | getFirstPlayer (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 PlayerObject * | getTeammateNearestToSelf (const int count_thr) const |
get teammate nearest to self with confidence count check | |
const PlayerObject * | getOpponentNearestToSelf (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 PlayerObject * | getTeammateNearestToBall (const int count_thr) const |
get teammate nearest to with with confidence count check | |
const PlayerObject * | getOpponentNearestToBall (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 PlayerType * | teammatePlayerType (const int unum) const |
get player type of the specified teammate | |
int | opponentHeteroID (const int unum) const |
get player type Id of opponent | |
const PlayerType * | opponentPlayerType (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 PlayerObject * | getOpponentGoalie () const |
get opponent goalie pointer | |
const PlayerObject * | getTeammateNearestTo (const Vector2D &point, const int count_thr, double *dist_to_point) const |
get teammate pointer nearest to point | |
const PlayerObject * | getTeammateNearestTo (const PlayerObject *p, const int count_thr, double *dist_to_point) const |
get teammate pointer nearest to the specified player | |
const PlayerObject * | getOpponentNearestTo (const Vector2D &point, const int count_thr, double *dist_to_point) const |
get opponent pointer nearest to point | |
const PlayerObject * | getOpponentNearestTo (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 ®ion, 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 ®ion, 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 ®ion, 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 ®ion, 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 |
const InterceptTable * rcsc::WorldModel::interceptTable | ( | ) | const |
get intercept table
const PenaltyKickState * rcsc::WorldModel::penaltyKickState | ( | ) | const |
get penalty kick state
const AudioMemory& rcsc::WorldModel::audioMemory | ( | ) | const [inline] |
get audio memory
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 |
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 |
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 |
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 |
update current playmode
game_mode | playmode info | |
current | current game time |
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 |
void rcsc::WorldModel::setCommandEffect | ( | const ActionEffector & | act | ) |
internal update using internal info and stored command info.
act | ActionEffector object |
const std::string& rcsc::WorldModel::teamName | ( | ) | const [inline] |
get our teamname
SideID rcsc::WorldModel::ourSide | ( | ) | const [inline] |
get our team side Id
const std::string& rcsc::WorldModel::opponentTeamName | ( | ) | const [inline] |
get opponent teamname
SideID rcsc::WorldModel::theirSide | ( | ) | const [inline] |
get opponent team side Id
bool rcsc::WorldModel::isOurLeft | ( | ) | const [inline] |
check if our team is left or not
bool rcsc::WorldModel::isOurRight | ( | ) | const [inline] |
check if our team is right or not
const GameTime& rcsc::WorldModel::time | ( | ) | const [inline] |
get last updated time (== current game time)
const GameTime& rcsc::WorldModel::seeTime | ( | ) | const [inline] |
get last time updated by see
const GameTime& rcsc::WorldModel::fullstateTime | ( | ) | const [inline] |
get last time updated by fullstate
const GameTime& rcsc::WorldModel::lastSetPlayStartTime | ( | ) | const [inline] |
get last time updated by fullstate get last setplay type playmode start time
const long& rcsc::WorldModel::setplayCount | ( | ) | const [inline] |
get cycle count that setplay type playmode is keeped
const GameMode& rcsc::WorldModel::gameMode | ( | ) | const [inline] |
const SelfObject& rcsc::WorldModel::self | ( | ) | const [inline] |
const BallObject& rcsc::WorldModel::ball | ( | ) | const [inline] |
const BallRecord& rcsc::WorldModel::ballRecord | ( | ) | const [inline] |
const PlayerCont& rcsc::WorldModel::teammates | ( | ) | const [inline] |
const PlayerCont& rcsc::WorldModel::opponents | ( | ) | const [inline] |
const PlayerCont& rcsc::WorldModel::unknownPlayers | ( | ) | const [inline] |
const PlayerPtrCont& rcsc::WorldModel::teammatesFromSelf | ( | ) | const [inline] |
get teammates sorted by distance from self
const PlayerPtrCont& rcsc::WorldModel::opponentsFromSelf | ( | ) | const [inline] |
get opponents sorted by distance from self
const PlayerPtrCont& rcsc::WorldModel::teammatesFromBall | ( | ) | const [inline] |
get teammates sorted by distance from ball
const PlayerPtrCont& rcsc::WorldModel::opponentsFromBall | ( | ) | const [inline] |
get opponents sorted by distance from ball
int rcsc::WorldModel::opponentGoalieUnum | ( | ) | const [inline] |
get the uniform number of opponent goalie
const AbstractPlayerCont& rcsc::WorldModel::allPlayers | ( | ) | const [inline] |
const AbstractPlayerCont& rcsc::WorldModel::allTeammates | ( | ) | const [inline] |
get all teammates including self.
const AbstractPlayerCont& rcsc::WorldModel::allOpponents | ( | ) | const [inline] |
get all opponents including self.
const AbstractPlayerObject* rcsc::WorldModel::teammate | ( | const int | unum | ) | const [inline] |
get number specified teammate player object pointer
unum | wanted player's uniform number |
const AbstractPlayerObject* rcsc::WorldModel::opponent | ( | const int | unum | ) | const [inline] |
get number specified opponent player object pointer
unum | wanted player's uniform number |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
const double& rcsc::WorldModel::offsideLineX | ( | ) | const [inline] |
get estimated offside line x coordinate
int rcsc::WorldModel::offsideLineCount | ( | ) | const [inline] |
get the accuracy count for the offside line
const double& rcsc::WorldModel::defenseLineX | ( | ) | const [inline] |
get estimated defside line(offside line for opponent) x coordinate
bool rcsc::WorldModel::existKickableTeammate | ( | ) | const [inline] |
check if exist kickable teammate
bool rcsc::WorldModel::existKickableOpponent | ( | ) | const [inline] |
check if exist kickable opponent
int rcsc::WorldModel::teammateHeteroID | ( | const int | unum | ) | const [inline] |
get player type Id of teammate
unum | target teammate uniform number |
const PlayerType * rcsc::WorldModel::teammatePlayerType | ( | const int | unum | ) | const |
get player type of the specified teammate
unum | target teammate uniform number |
int rcsc::WorldModel::opponentHeteroID | ( | const int | unum | ) | const [inline] |
get player type Id of opponent
unum | target teammate uniform number |
const PlayerType * rcsc::WorldModel::opponentPlayerType | ( | const int | unum | ) | const |
get player type of the specified opponent
unum | target opponent uniform number |
int rcsc::WorldModel::dirCount | ( | const AngleDeg & | angle | ) | const [inline] |
get direction confidence count
angle | target direction |
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 |
const ViewAreaCont& rcsc::WorldModel::viewAreaCont | ( | ) | const [inline] |
get view area history 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 |
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. |
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
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 |
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 |
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 |
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 |
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. |
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. |
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. |
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. |