![]() |
VR-Link API Documentation for HLA 1.3
|
Collaboration diagram for DtMultiVehicleFed:Public Types | |
| enum | mode { PARALLEL =1, SERIAL =2 } |
Public Member Functions | |
| DtMultiVehicleFed () | |
| Constructor. More... | |
| virtual | ~DtMultiVehicleFed () |
| Pure Virtual destructor. More... | |
| DtExerciseConn * | exerciseConn () |
| void | initializeExConn (DtTime theTimeOutInterval, DtF18Initializer *initializer) |
| void | initializeFleet (int appNumOffset, int theNumVehicles, const DtF18Initializer *initializer) |
| void | drainInput (double tMaxRealElapsed) |
| int | numberRemoteEntities () const |
| void | simulate () |
| void | publish () |
| double | sleep (double deltaTime) |
| void | dismantleFleet () |
| void | dismantleExConn () |
| void | setExecutionMode (mode theMode) |
| mode | executionMode () const |
| void | setSimTime (double time) |
| double | simTime () const |
Protected Member Functions | |
| DtVehicleSim * | vehicleFactory (int num, int appNumOffset, const DtF18Initializer *initializer, DtObjectPublisherContainer &pubContainer) |
| DtString & | getVehicleName (int num, const DtString &baseName, DtString &name) |
| void | processDetonation (const DtDetonationInteraction *theDetonation) |
Static Protected Member Functions | |
| static void | theDetonationCb (DtDetonationInteraction *theDetonation, void *theUserData) |
This example describes two ways to exploit parallel execution.
1.The general purpose DtParallelExecutionContainer<> which executes a member method on all objects in the container in parallel, and waits for all to complete. Because the specified method will be called from multiple threads, that method must be carefully designed, for example it should be careful when writing or reading variables used by other threads (or avoid this completely if possible).
CAUTION - the containers themselves are NOT thread safe, and you MUST NOT MODIFY the contents of these containers WHILE THEY'RE EXECUTING a method in parallel. Instead, use a thread safe collection to hold the modifications (e.g. concurrent_vector from the Intel Thread Building Blocks, already included with VR Link), then copy that collection into a DtParallelExecutionContainer or DtPublisherContainer.
These two containers may be used at the discretion of the application designer as needed, in any combination. This example could be written with a single DtParallelExecutionContainer<DtVehicleSim>.
This example may be switched between parallel and serial execution for comparison or debugging using setExecutionMode().A DtMultiVehicleFed object corresponds to a single simulation with one or more simulated vehicles.
| DtMultiVehicleFed::DtMultiVehicleFed | ( | ) |
Constructor.
|
virtual |
Pure Virtual destructor.
| void DtMultiVehicleFed::dismantleExConn | ( | ) |
| void DtMultiVehicleFed::dismantleFleet | ( | ) |
| void DtMultiVehicleFed::drainInput | ( | double | tMaxRealElapsed | ) |
| mode DtMultiVehicleFed::executionMode | ( | ) | const |
|
inline |
References myExConn.
|
protected |
| void DtMultiVehicleFed::initializeExConn | ( | DtTime | theTimeOutInterval, |
| DtF18Initializer * | initializer | ||
| ) |
| void DtMultiVehicleFed::initializeFleet | ( | int | appNumOffset, |
| int | theNumVehicles, | ||
| const DtF18Initializer * | initializer | ||
| ) |
| int DtMultiVehicleFed::numberRemoteEntities | ( | ) | const |
|
protected |
| void DtMultiVehicleFed::publish | ( | ) |
| void DtMultiVehicleFed::setExecutionMode | ( | mode | theMode | ) |
| void DtMultiVehicleFed::setSimTime | ( | double | time | ) |
| double DtMultiVehicleFed::simTime | ( | ) | const |
| void DtMultiVehicleFed::simulate | ( | ) |
|
staticprotected |
|
protected |
|
private |
|
private |
Referenced by exerciseConn().
|
private |
|
private |
|
private |
|
private |
|
private |