Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SimulationTaskSupervisor Class Reference

#include <simulationtasksupervisor.h>

Collaboration diagram for SimulationTaskSupervisor:

Public Member Functions

virtual void createSimTask ()
 Creates one SimulationTask with taskId=SimulationTaskHandle.simTaskList.size(). More...
 
virtual void createSimTasks (int taskCount)
 Same as createSimTask, but create more than one task at once. More...
 
virtual void runSimTasks (int *argc, char **argv)
 Runs all generated SimulationTasks. More...
 
virtual void setSimTaskNameSuffix (std::string name)
 Sets a suffix to be appended to the window name to identify your simTask. More...
 

Static Public Member Functions

static SimulationTaskSupervisorgetInstance ()
 Returns the singleton instance of this class. More...
 
static void destroyInstance ()
 Destroys the singleton instance of this class. More...
 
static void setSimTaskHandle (SimulationTaskHandle &_simTaskHandle)
 
static void setTaskedSimCreator (TaskedSimulationCreator &_taskedSimCreator)
 
static void setNumberThreads (int numberThreads)
 Sets the number of total threads running at one time. More...
 
static void setNumberThreadsPerCore (int numberThreadsPerCore)
 Sets the number of threads created per core. More...
 

Protected Member Functions

 SimulationTaskSupervisor ()
 
virtual ~SimulationTaskSupervisor ()
 

Static Protected Attributes

static SimulationTaskSupervisorsingletonInstance = 0
 
static SimulationTaskHandlesimTaskHandle = 0
 
static TaskedSimulationCreatortaskedSimCreator = 0
 
static std::vector
< SimulationTask * > 
simTaskList
 
static int * argc = 0
 
static char ** argv = 0
 
static osg::ArgumentParser * parser = 0
 
static LpzRobotsViewer * viewer
 
static std::string nameSuffix = "(tasked)"
 

Constructor & Destructor Documentation

SimulationTaskSupervisor ( )
inlineprotected
virtual ~SimulationTaskSupervisor ( )
inlineprotectedvirtual

Member Function Documentation

virtual void createSimTask ( )
inlinevirtual

Creates one SimulationTask with taskId=SimulationTaskHandle.simTaskList.size().

Parameters
argccount of arguments in argv
argvarray of arguments, given to Simulation when the tasks starts
virtual void createSimTasks ( int  taskCount)
inlinevirtual

Same as createSimTask, but create more than one task at once.

taskIds assigned in ascending order.

Parameters
taskCountnumber of tasks to create
argccount of arguments in argv
argvarray of arguments, given to Simulation when the tasks starts
static void destroyInstance ( )
inlinestatic

Destroys the singleton instance of this class.

static SimulationTaskSupervisor* getInstance ( )
inlinestatic

Returns the singleton instance of this class.

There is no way to instantiate yourself this class.

Parameters
simTaskHandleThe global SimulationTaskHandle were you can put in your needed data. This handle is shared by all parallel running simulations.
Returns
the singleton instance of this class
void runSimTasks ( int *  argc,
char **  argv 
)
virtual

Runs all generated SimulationTasks.

void setNumberThreads ( int  numberThreads)
static

Sets the number of total threads running at one time.

Parameters
numberThreads
void setNumberThreadsPerCore ( int  numberThreadsPerCore)
static

Sets the number of threads created per core.

The default value is 1. So if your machine has e.g. 4 cores, 4 threads are created. If you have much code which must be synchronized, it may be useful to increase the number of threads per core, 2 is a good value.

Parameters
numberThreadsPerCore
static void setSimTaskHandle ( SimulationTaskHandle _simTaskHandle)
inlinestatic
void setSimTaskNameSuffix ( std::string  name)
virtual

Sets a suffix to be appended to the window name to identify your simTask.

static void setTaskedSimCreator ( TaskedSimulationCreator _taskedSimCreator)
inlinestatic

Member Data Documentation

int * argc = 0
staticprotected
char ** argv = 0
staticprotected
std::string nameSuffix = "(tasked)"
staticprotected
osg::ArgumentParser * parser = 0
staticprotected
SimulationTaskHandle * simTaskHandle = 0
staticprotected
std::vector< SimulationTask * > simTaskList
staticprotected
SimulationTaskSupervisor * singletonInstance = 0
staticprotected
TaskedSimulationCreator * taskedSimCreator = 0
staticprotected
LpzRobotsViewer* viewer
staticprotected

The documentation for this class was generated from the following files: