#include <BasicCoach.h>
Collaboration diagram for BasicCoach:
Public Methods | |
BasicCoach (ActHandler *a, WorldModel *wm, ServerSettings *ss, char *strTeamName, double dVersion, bool isTrainer) | |
virtual | ~BasicCoach () |
virtual void | mainLoopNormal () |
void | substitutePlayer (int iPlayer, int iPlayerType) |
void | handleStdin () |
void | showStringCommands (ostream &out) |
bool | executeStringCommand (char *str) |
Protected Attributes | |
ActHandler * | ACT |
WorldModel * | WM |
ServerSettings * | SS |
HeteroPlayerSettings | m_player_types [MAX_HETERO_PLAYERS] |
bool | bContLoop |
Definition at line 63 of file BasicCoach.h.
|
This is the constructor for the BasicCoach class and contains the arguments that are used to initialize a coach.
Definition at line 67 of file BasicCoach.cpp. References ACT, bContLoop, MAX_MSG, ActHandler::sendMessage(), WorldModel::setTeamName(), SS, and WM. |
|
Definition at line 87 of file BasicCoach.cpp. |
|
This method executes the command that is entered by the user. For the possible command look at the method showStringCommands.
Definition at line 225 of file BasicCoach.cpp. References ACT, bContLoop, Parse::parseFirstDouble(), Parse::parseFirstInt(), and ActHandler::sendMessage(). Referenced by handleStdin(). |
|
This method listens for input from the keyboard and when it receives this input it converts this input to the associated action. See showStringCommands for the possible options. This method is used together with the SenseHandler class that sends an alarm to indicate that a new command can be sent. This conflicts with the method in this method that listens for the user input (fgets) on Linux systems (on Solaris this isn't a problem). The only known method is to use the flag SA_RESTART with this alarm function, but that does not seem to work under Linux. If each time the alarm is sent, this gets function unblocks, it will cause major performance problems. This function should not be called when a whole match is played! Definition at line 193 of file BasicCoach.cpp. References executeStringCommand(), and MAX_MSG. Referenced by stdin_callback(). |
|
This method is the main loop of the coach. All sequence of actions are located in this method. Definition at line 93 of file BasicCoach.cpp. References ACT, bContLoop, WorldModel::getInfoHeteroPlayer(), WorldModel::getPlayMode(), ServerSettings::getSynchMode(), Time::getTime(), WorldModel::getTimeLastSeeGlobalMessage(), WorldModel::isConfidenceGood(), Logger::isInLogLevel(), Logger::log(), WorldModel::logObjectInformation(), m_player_types, MAX_HETERO_PLAYERS, OBJECT_ILLEGAL, OBJECT_TEAMMATE_11, PM_TIME_OVER, ActHandler::sendMessageDirect(), SS, substitutePlayer(), WorldModel::waitForNewInformation(), and WM. Referenced by main(). |
|
This method prints the possible commands that can be entered by the user. The whole name can be entered to perform the corresponding command, but normally only the first character is sufficient. This is indicated by putting brackets around the part of the command that is not needed.
Definition at line 214 of file BasicCoach.cpp. |
|
This method substitutes one player to the given player type and sends this command (using the ActHandler) to the soccer server. Definition at line 160 of file BasicCoach.cpp. References ACT, CMD_CHANGEPLAYER, SoccerCommand::makeCommand(), and ActHandler::sendCommandDirect(). Referenced by mainLoopNormal(). |
|
ActHandler to which commands can be sent Definition at line 66 of file BasicCoach.h. Referenced by BasicCoach(), executeStringCommand(), mainLoopNormal(), and substitutePlayer(). |
|
bool to indicate whether to stop or continue Definition at line 71 of file BasicCoach.h. Referenced by BasicCoach(), executeStringCommand(), and mainLoopNormal(). |
|
Definition at line 70 of file BasicCoach.h. Referenced by mainLoopNormal(). |
|
All parameters used by the server Definition at line 68 of file BasicCoach.h. Referenced by BasicCoach(), and mainLoopNormal(). |
|
WorldModel that contains information of world Definition at line 67 of file BasicCoach.h. Referenced by BasicCoach(), and mainLoopNormal(). |