VR-Link API Documentation for HLA 4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
multiVehicleFed.h
Go to the documentation of this file.
1 /*******************************************************************************
2  ** Copyright (c) 1992-2025 MAK Technologies, Inc
3  ** All rights reserved.
4  *******************************************************************************/
5 
6 #pragma once
11 #include "vehicleSim.h"
12 
13 class DtF18Initializer;
15 class DtExerciseConn;
16 
48 
52 {
53 public:
54 
55  // User parallel execution, or serial execution
56  enum mode { PARALLEL=1, SERIAL=2 };
57 
60 
62  virtual ~DtMultiVehicleFed();
63 
65 
66  // Set up and initialize for an exercise
67  void initializeExConn(DtTime theTimeOutInterval, DtF18Initializer *initializer);
68 
69  // initialize the fleet
70  void initializeFleet(int appNumOffset, int theNumVehicles, const DtF18Initializer *initializer);
71 
72  // Process inputs up to maximum elapsed real time
73  void drainInput(double tMaxRealElapsed);
74 
75  // Set/get the simulation time
77  void setSimTime(double time);
78  double simTime() const;
80 
81  // Get the number of remote entities
82  int numberRemoteEntities() const;
83 
84  // Simulate all vehicles
85  void simulate();
86 
87  // Publish all vehicle outputs
88  void publish();
89 
90  // Sleep until real time catches up to simulated time
91  double sleep(double deltaTime);
92 
93  // Dismantle the fleet
94  void dismantleFleet();
95 
96  // Dismantle an exercise
97  void dismantleExConn();
98 
99  // Execution mode
100  void setExecutionMode(mode theMode);
101  mode executionMode() const;
102 
103 protected:
104 
105  // Factory to create and initialize a single fleet vehicle.
106  DtVehicleSim *vehicleFactory(int num, int appNumOffset,
107  const DtF18Initializer *initializer, DtObjectPublisherContainer& pubContainer);
108 
109  DtString& getVehicleName(int num, const DtString& baseName, DtString& name);
110 
111  // Detonation callback handler
112  static void theDetonationCb(DtDetonationInteraction *theDetonation, void *theUserData);
113 
114  // Process detonation over all vehicles in parallel
115  void processDetonation(const DtDetonationInteraction *theDetonation);
116 
117 private:
118  mode myMode; // Whether to execute in parallel or serial
119  DtTime mySimTime; // Simulated time
120  DtClock *myClock; // Exercise clock
121 
122  // Exercise connection for this simulation
124 
125  // Reflected entity list, tracks entities published by remote simulations
127 
128  // Container for fleet (all vehicles published by this simulation)
129  // This shows how to use the general parallel execution container.
131 
132  // Container of published objects.
133  // This shows how to publish objects in parallel, simpler than DtParallelExecutionContainer.
135 };
DtReflectedEntityList * myRel
Definition: multiVehicleFed.h:126
DtVehicleSim * vehicleFactory(int num, int appNumOffset, const DtF18Initializer *initializer, DtObjectPublisherContainer &pubContainer)
Instances of DtDetonationInteraction are used to communicate information associated with the impact o...
Definition: detonationInteractionHLA.h:37
Instances of DtExerciseConn are used to provide an application's interface or connection to the netwo...
Definition: exerciseConnHLA.h:61
void drainInput(double tMaxRealElapsed)
mode executionMode() const
Part of the F18 example.
Definition: f18/vehicleSim.h:31
DtF18Initializer derives from DtVrlApplicationInitializer and describes how command line/configuratio...
Definition: f18Init.h:30
void setSimTime(double time)
Used to set and maintain time in a simulation.
Definition: vlTime.h:25
void processDetonation(const DtDetonationInteraction *theDetonation)
virtual ~DtMultiVehicleFed()
Pure Virtual destructor.
DtObjectPublisherContainer myPublishedObjects
Definition: multiVehicleFed.h:134
DtExerciseConn * myExConn
Definition: multiVehicleFed.h:123
mode
Definition: multiVehicleFed.h:56
multiVehicleFed.h
Definition: multiVehicleFed.h:51
Contains DtTimedSection, DtTimeStatistic, and DtPerformanceStats classes.
static void theDetonationCb(DtDetonationInteraction *theDetonation, void *theUserData)
DtObjectPublisherContainer is an ObjectPublisher container which will execute a method on all contain...
Definition: publisherContainer.h:43
DtMultiVehicleFed()
Constructor.
DtString & getVehicleName(int num, const DtString &baseName, DtString &name)
Instances of DtReflectedEntityList are used to manage remote entities from the network.
Definition: reflectedEntityListHLA.h:38
int numberRemoteEntities() const
DtParallelExecutionContainer< DtVehicleSim > mySimulatedVehicles
Definition: multiVehicleFed.h:130
Definition: multiVehicleFed.h:56
void setExecutionMode(mode theMode)
Contains the DtParallelExecutionContainer class declarations.
DtClock * myClock
Definition: multiVehicleFed.h:120
Definition: multiVehicleFed.h:56
double simTime() const
DtTime mySimTime
Definition: multiVehicleFed.h:119
void initializeExConn(DtTime theTimeOutInterval, DtF18Initializer *initializer)
Instances of DtString are used to represent strings.
Definition: vlString.h:36
mode myMode
Definition: multiVehicleFed.h:118
This file provides protocol independence for Detonation Interactions.
DtExerciseConn * exerciseConn()
Definition: multiVehicleFed.h:64
double sleep(double deltaTime)
void initializeFleet(int appNumOffset, int theNumVehicles, const DtF18Initializer *initializer)

Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)