Robot Simulator of the Robotics Group for Self-Organization of Control: SimulationTaskSupervisor Class Reference

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages
- Examples

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# SimulationTaskSupervisor Class Reference

`#include <simulationtasksupervisor.h>`

Collaboration diagram for SimulationTaskSupervisor:

[legend]
List of all members.

## Public Member Functions
virtual void | createSimTask ()
| Creates one SimulationTask with taskId=SimulationTaskHandle.simTaskList.size().
virtual void | createSimTasks (int taskCount)
| Same as createSimTask, but create more than one task at once.
virtual void | runSimTasks (int *argc, char **argv)
| Runs all generated SimulationTasks.
virtual void | setSimTaskNameSuffix (std::string name)
| Sets a suffix to be appended to the window name to identify your simTask.
## Static Public Member Functions
static SimulationTaskSupervisor * | getInstance ()
| Returns the singleton instance of this class.
static void | destroyInstance ()
| Destroys the singleton instance of this class.
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.
static void | setNumberThreadsPerCore (int numberThreadsPerCore)
| Sets the number of threads created per core.
## Protected Member Functions
| SimulationTaskSupervisor ()
virtual | ~SimulationTaskSupervisor ()
## Static Protected Attributes
static SimulationTaskSupervisor * | singletonInstance = 0
static SimulationTaskHandle * | simTaskHandle = 0
static TaskedSimulationCreator * | taskedSimCreator = 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 | ( |  | ) | `[inline, protected]`

virtual ~SimulationTaskSupervisor | ( |  | ) | `[inline, protected, virtual]`

## Member Function Documentation

virtual void createSimTask | ( |  | ) | `[inline, virtual]`

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

Parameters:

  | argc | count of arguments in argv
  | argv | array of arguments, given to Simulation when the tasks starts

virtual void createSimTasks | ( | int | taskCount | ) | `[inline, virtual]`

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

taskIds assigned in ascending order.

Parameters:

  | taskCount | number of tasks to create
  | argc | count of arguments in argv
  | argv | array of arguments, given to Simulation when the tasks starts

static void destroyInstance | ( |  | ) | `[inline, static]`

Destroys the singleton instance of this class.

static SimulationTaskSupervisor* getInstance | ( |  | ) | `[inline, static]`

Returns the singleton instance of this class.

There is no way to instantiate yourself this class.

Parameters:

  | simTaskHandle | The 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 | ) | `[inline, static]`

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 | ) | `[inline, static]`

## Member Data Documentation

int * argc = 0`[static, protected]`

char ** argv = 0`[static, protected]`

std::string nameSuffix = "(tasked)"`[static, protected]`

osg::ArgumentParser * parser = 0`[static, protected]`

SimulationTaskHandle * simTaskHandle = 0`[static, protected]`

std::vector< SimulationTask * > simTaskList`[static, protected]`

SimulationTaskSupervisor * singletonInstance = 0`[static, protected]`

TaskedSimulationCreator * taskedSimCreator = 0`[static, protected]`

LpzRobotsViewer* viewer`[static, protected]`

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

- simulationtasksupervisor.h
- simulationtasksupervisor.cpp