ActionScheduler Class Reference

This component is responsible for execution of registered actions in specific time. More...

#include <ActionScheduler.h>


Public Member Functions

 ActionScheduler (WorldModel *wm, ServerSettings *ss, PlayerSettings *ps)
 Basic constructor of action scheduler.
virtual ~ActionScheduler ()
 Performs cleanup of action queue.
void dispatchAction (int cycle)
 Executes actions that are scheduled to specific cycle.
void scheduleAction (int cycle, void(*action_callback)(WorldModel *, ServerSettings *, PlayerSettings *, void *, int), void(*cleanup_callback)(void *, int), void *params, int params_size)

Protected Member Functions

void doDispatchAction (struct scheduled_action *action)
 Internal action dispatching mechanism.

Private Attributes

WorldModelWM
ServerSettingsSS
PlayerSettingsPS
queue< struct scheduled_actionscheduled_actions


Detailed Description

This component is responsible for execution of registered actions in specific time.

Reason for creation of this component is need reinforced learning. Reinforced learning need feedback on perfomed action. In robocup environment action effect can't be evaluated ad once. This component is used for later evaluation of state space and update of method that is used to choose actions from action space.

Definition at line 52 of file ActionScheduler.h.


Constructor & Destructor Documentation

ActionScheduler::ActionScheduler ( WorldModel wm,
ServerSettings ss,
PlayerSettings ps 
)

Basic constructor of action scheduler.

Definition at line 10 of file ActionScheduler.cpp.

References LOG_INFO, LOG_PRINT, PS, SS, and WM.

ActionScheduler::~ActionScheduler (  )  [virtual]

Performs cleanup of action queue.

All parameters that are asociated with action function are cleaned up using cleanup handler

Definition at line 25 of file ActionScheduler.cpp.

References LOG_INFO, LOG_PRINT, and scheduled_actions.


Member Function Documentation

void ActionScheduler::doDispatchAction ( struct scheduled_action action  )  [protected]

Internal action dispatching mechanism.

Definition at line 70 of file ActionScheduler.cpp.

References scheduled_action::action_callback, scheduled_action::cleanup_callback, scheduled_action::params, scheduled_action::params_size, PS, SS, and WM.

Referenced by dispatchAction().

void ActionScheduler::dispatchAction ( int  cycle  ) 

Executes actions that are scheduled to specific cycle.

When actions for this cycle are executed, they are discarted.

Parameters:
cycle Indicates cycle where actions needs to be performed

Definition at line 45 of file ActionScheduler.cpp.

References doDispatchAction(), LOG_DEBUG, LOG_PRINTP, and scheduled_actions.

Referenced by SenseHandler::setTimeSignal(), testCleanupAction(), and testScheduleAction().

void ActionScheduler::scheduleAction ( int  cycle,
void(*)(WorldModel *, ServerSettings *, PlayerSettings *, void *, int)  action_callback,
void(*)(void *, int)  cleanup_callback,
void *  params,
int  params_size 
)

Referenced by test1(), testCleanupAction(), and testScheduleAction().


Field Documentation

WorldModel* ActionScheduler::WM [private]

Worldmodel containing all data of the match

Definition at line 54 of file ActionScheduler.h.

Referenced by ActionScheduler(), and doDispatchAction().

ServerSettings* ActionScheduler::SS [private]

ServerSettings with all server settings

Definition at line 55 of file ActionScheduler.h.

Referenced by ActionScheduler(), and doDispatchAction().

PlayerSettings* ActionScheduler::PS [private]

PlayerSettings with all client settings

Definition at line 56 of file ActionScheduler.h.

Referenced by ActionScheduler(), and doDispatchAction().

queue<struct scheduled_action> ActionScheduler::scheduled_actions [private]

Definition at line 58 of file ActionScheduler.h.

Referenced by dispatchAction(), and ~ActionScheduler().


The documentation for this class was generated from the following files:
Generated on Thu Apr 26 22:45:30 2007 for GangOfSix(GOS)-RoboCupTeamProject by  doxygen 1.5.1-p1