VR-Link API Documentation for HLA 1.3
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
DtExerciseConn
*
exerciseConn
() {
return
myExConn
; }
66
67
// Set up and initialize for an exercise
68
void
initializeExConn
(
DtTime
theTimeOutInterval,
DtF18Initializer
*initializer);
69
70
// initialize the fleet
71
void
initializeFleet
(
int
appNumOffset,
int
theNumVehicles,
const
DtF18Initializer
*initializer);
72
73
// Process inputs up to maximum elapsed real time
74
void
drainInput
(
double
tMaxRealElapsed);
75
76
// Simulate all vehicles
77
void
simulate
();
78
79
// Publish all vehicle outputs
80
void
publish
();
81
82
// Sleep until real time catches up to simulated time
83
void
sleep
(
double
deltaTime);
84
85
// Dismantle the fleet
86
void
dismantleFleet
();
87
88
// Dismantle an exercise
89
void
dismantleExConn
();
90
91
// Execution mode
92
void
setExecutionMode
(
mode
theMode);
93
mode
executionMode
()
const
;
94
95
protected
:
96
97
// Factory to create and initialize a single fleet vehicle.
98
DtVehicleSim
*
vehicleFactory
(
int
num,
int
appNumOffset,
99
const
DtF18Initializer
*initializer,
DtObjectPublisherContainer
& pubContainer);
100
101
// Detonation callback handler
102
static
void
theDetonationCb
(
DtDetonationInteraction
*theDetonation,
void
*theUserData);
103
104
// Process detonation over all vehicles in parallel
105
void
processDetonation
(
const
DtDetonationInteraction
*theDetonation);
106
107
private
:
108
mode
myMode
;
// Whether to execute in parallel or serial
109
DtTime
mySimTime
;
// Simulated time
110
DtClock
*
myClock
;
// Exercise clock
111
112
// Exercise connection for this simulation
113
DtExerciseConn
*
myExConn
;
114
115
// Reflected entity list, tracks entities published by remote simulations
116
DtReflectedEntityList
*
rel
;
117
118
// Container for fleet (all vehicles published by this simulation)
119
// This shows how to use the general parallel execution container.
120
DtParallelExecutionContainer<DtVehicleSim>
mySimulatedVehicles
;
121
122
// Container of published objects.
123
// This shows how to publish objects in parallel, simpler than DtParallelExecutionContainer.
124
DtObjectPublisherContainer
myPublishedObjects
;
125
};
Document ID: Generated on Mon Jun 22 21:18:40 EDT 2020 from SVN revision 213785
Copyright © 2005-2018 MAK Technologies. All Rights Reserved (
www.mak.com
)