basic trainer agent class
More...
#include <trainer_agent.h>
|
virtual bool | initImpl (CmdLineParser &cmd_parser) |
| analyze command line options More...
|
|
virtual bool | handleStart () |
| handle start event More...
|
|
virtual void | handleMessage () |
| handle server message event More...
|
|
virtual void | handleTimeout (const int timeout_count, const int waited_msec) |
| handle timeout event More...
|
|
virtual void | handleExit () |
| handle exit event More...
|
|
virtual void | actionImpl ()=0 |
| pure virtual method. register decision. More...
|
|
virtual void | handleInitMessage () |
| this method is called just after analyzing init message. Do NOT call this method by yourself.
|
|
virtual void | handleServerParam () |
| this method is called just after analyzing server_param message. Do NOT call this method by yourself.
|
|
virtual void | handlePlayerParam () |
| this method is called just after analyzing player_param message. Do NOT call this method by yourself.
|
|
virtual void | handlePlayerType () |
| this method is called just after analyzing player_type message. Do NOT call this method by yourself.
|
|
virtual bool | initImpl (CmdLineParser &cmd_parser)=0 |
| init interval status using command line options More...
|
|
virtual bool | handleStart ()=0 |
| (pure virtual) handle start event More...
|
|
virtual bool | handleStartOffline () |
| (virtual) handle start event in offline client mode. More...
|
|
virtual void | handleMessage ()=0 |
| (pure virtual) handle server messege More...
|
|
virtual void | handleMessageOffline () |
| (virtual) handle offline client log message in offline client mode. More...
|
|
virtual void | handleTimeout (const int timeout_count, const int waited_msec)=0 |
| (pure virtual) handle timeout event More...
|
|
virtual void | handleExit ()=0 |
| (pure virtual) handle exit event More...
|
|
basic trainer agent class
◆ actionImpl()
virtual void rcsc::TrainerAgent::actionImpl |
( |
| ) |
|
|
protectedpure virtual |
pure virtual method. register decision.
This method is used to set trainer's action. This method is called from action(). So, do NOT call this method by yourself.
◆ config()
get configuration set
- Returns
- const reference to the configuration class object
◆ createConsoleClient()
virtual std::shared_ptr< AbstractClient > rcsc::TrainerAgent::createConsoleClient |
( |
| ) |
|
|
virtual |
create a client object (online or offline) according to the command line option.
- Returns
- client object pointer.
Implements rcsc::SoccerAgent.
◆ doChangeMode()
bool rcsc::TrainerAgent::doChangeMode |
( |
const PlayMode |
mode | ) |
|
send playmode change command
- Parameters
-
- Returns
- true if command is generated and sent
◆ doChangePlayerType()
bool rcsc::TrainerAgent::doChangePlayerType |
( |
const std::string & |
teamname, |
|
|
const int |
unum, |
|
|
const int |
type |
|
) |
| |
send change_player_type command
- Parameters
-
teamname | target player's team name |
unum | target player's uniform number |
type | new player type Id |
- Returns
- true if command is generated and sent
◆ doCheckBall()
bool rcsc::TrainerAgent::doCheckBall |
( |
| ) |
|
send check_ball command
- Returns
- true if command is generated and sent
◆ doEar()
bool rcsc::TrainerAgent::doEar |
( |
bool |
on | ) |
|
send ear command
on if true, send (ear on), else (ear off)
- Returns
- true if command is generated and sent
◆ doEye()
bool rcsc::TrainerAgent::doEye |
( |
bool |
on | ) |
|
send eye command
on if true, send (eye on), else (eye off)
- Returns
- true if command is generated and sent
◆ doKickOff()
bool rcsc::TrainerAgent::doKickOff |
( |
| ) |
|
send start command to kickoff the game
- Returns
- true if command is generated and sent
◆ doLook()
bool rcsc::TrainerAgent::doLook |
( |
| ) |
|
send look command
- Returns
- true if command is generated and sent
◆ doMoveBall()
bool rcsc::TrainerAgent::doMoveBall |
( |
const Vector2D & |
pos, |
|
|
const Vector2D & |
vel |
|
) |
| |
send ball move command
- Parameters
-
pos | new position |
vel | new velocity |
- Returns
- true if command is generated and sent
◆ doMovePlayer() [1/2]
bool rcsc::TrainerAgent::doMovePlayer |
( |
const std::string & |
teamname, |
|
|
const int |
unum, |
|
|
const Vector2D & |
pos |
|
) |
| |
send player move command
- Parameters
-
teamname | target player's team name |
unum | target player's uniform number |
pos | new position |
- Returns
- true if command is generated and sent
◆ doMovePlayer() [2/2]
bool rcsc::TrainerAgent::doMovePlayer |
( |
const std::string & |
teamname, |
|
|
const int |
unum, |
|
|
const Vector2D & |
pos, |
|
|
const AngleDeg & |
angle |
|
) |
| |
send player move command
- Parameters
-
teamname | target player's team name |
unum | target player's uniform number |
pos | new position |
angle | new body angle |
- Returns
- true if command is generated and sent
◆ doRecover()
bool rcsc::TrainerAgent::doRecover |
( |
| ) |
|
send recover command
- Returns
- true if command is generated and sent
◆ doSay()
bool rcsc::TrainerAgent::doSay |
( |
const std::string & |
msg | ) |
|
send say command (coach language)
- Returns
- true if command is generated and sent
◆ doTeamNames()
bool rcsc::TrainerAgent::doTeamNames |
( |
| ) |
|
send team_name command
- Returns
- true if command is generated and sent
◆ handleExit()
virtual void rcsc::TrainerAgent::handleExit |
( |
| ) |
|
|
protectedvirtual |
◆ handleMessage()
virtual void rcsc::TrainerAgent::handleMessage |
( |
| ) |
|
|
protectedvirtual |
handle server message event
Do NOT call this method by yourself!
Implements rcsc::SoccerAgent.
◆ handleStart()
virtual bool rcsc::TrainerAgent::handleStart |
( |
| ) |
|
|
protectedvirtual |
handle start event
- Returns
- status of start procedure.
This method is called on the top of BasicClient::run() method. The concrete agent must connect to the server and send init command. Do NOT call this method by yourself!
Implements rcsc::SoccerAgent.
◆ handleTimeout()
virtual void rcsc::TrainerAgent::handleTimeout |
( |
const int |
timeout_count, |
|
|
const int |
waited_msec |
|
) |
| |
|
protectedvirtual |
handle timeout event
- Parameters
-
timeout_count | count of timeout without sensory message. |
waited_msec | elapsed milli seconds sinc last sensory message. |
This method is called when select() timeout occurs Do NOT call this method by yourself!
Implements rcsc::SoccerAgent.
◆ initImpl()
virtual bool rcsc::TrainerAgent::initImpl |
( |
CmdLineParser & |
cmd_parser | ) |
|
|
protectedvirtual |
analyze command line options
- Parameters
-
cmd_parser | command line parser object |
- Returns
- only if "help" option is given, false is returned.
This method is called from SoccerAgent::init( argc, argv ) SoccerAgent::init(argc,argv) should be called in main(). Do NOT call this method by yourself!
Implements rcsc::SoccerAgent.
◆ visualSensor()
get the analyzed visual info
- Returns
- const reference to the visual sensor instance
◆ world()
get field status
- Returns
- const reference to the worldmodel instance
The documentation for this class was generated from the following file: