VR-Link API Documentation for DIS
Home
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
examples
parallel
multiVehicleFed.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2014 VT MAK
3
** All rights reserved.
4
*******************************************************************************/
5
6
#pragma once
7
8
#include <
vlutil/vlPerformanceStats.h
>
9
#include <
vl/parallelExecutionContainer.h
>
10
#include <
vl/publisherContainer.h
>
11
#include <
vl/detonationInteraction.h
>
12
#include "
vehicleSim.h
"
13
14
class
DtF18Initializer
;
15
class
DtReflectedEntityList
;
16
class
DtExerciseConn
;
17
49
52
class
DtMultiVehicleFed
53
{
54
public
:
55
56
// User parallel execution, or serial execution
57
enum
mode
{
PARALLEL
=1,
SERIAL
=2 };
58
60
DtMultiVehicleFed
();
61
63
virtual
~DtMultiVehicleFed
();
64
65
// Set up and initialize for an exercise
66
void
initializeExConn
(
DtTime
theTimeOutInterval,
DtF18Initializer
*initializer);
67
68
// initialize the fleet
69
void
initializeFleet
(
int
appNumOffset,
int
theNumVehicles,
const
DtF18Initializer
*initializer);
70
71
// Process inputs up to maximum elapsed real time
72
void
drainInput
(
double
tMaxRealElapsed);
73
74
// Simulate all vehicles
75
void
simulate
();
76
77
// Publish all vehicle outputs
78
void
publish
();
79
80
// Sleep until real time catches up to simulated time
81
void
sleep
(
double
deltaTime);
82
83
// Dismantle the fleet
84
void
dismantleFleet
();
85
86
// Dismantle an exercise
87
void
dismantleExConn
();
88
89
// Execution mode
90
void
setExecutionMode
(
mode
theMode);
91
mode
executionMode
()
const
;
92
93
protected
:
94
95
// Factory to create and initialize a single fleet vehicle.
96
DtVehicleSim
*
vehicleFactory
(
int
num,
int
appNumOffset,
97
const
DtF18Initializer
*initializer,
DtObjectPublisherContainer
& pubContainer);
98
99
// Detonation callback handler
100
static
void
theDetonationCb
(
DtDetonationInteraction
*theDetonation,
void
*theUserData);
101
102
// Process detonation over all vehicles in parallel
103
void
processDetonation
(
const
DtDetonationInteraction
*theDetonation);
104
105
private
:
106
mode
myMode
;
// Whether to execute in parallel or serial
107
DtTime
mySimTime
;
// Simulated time
108
DtClock
*
myClock
;
// Exercise clock
109
110
// Exercise connection for this simulation
111
DtExerciseConn
*
myExConn
;
112
113
// Reflected entity list, tracks entities published by remote simulations
114
DtReflectedEntityList
*
rel
;
115
116
// Container for fleet (all vehicles published by this simulation)
117
// This shows how to use the general parallel execution container.
118
DtParallelExecutionContainer<DtVehicleSim>
mySimulatedVehicles
;
119
120
// Container of published objects.
121
// This shows how to publish objects in parallel, simpler than DtParallelExecutionContainer.
122
DtObjectPublisherContainer
myPublishedObjects
;
123
};
Document ID: Generated on Wed Jan 7 13:31:29 EST 2015 from SVN revision 149162
Copyright © 2005-2014 VT MÄK. All Rights Reserved (
www.mak.com
)