VR-Link API Documentation for DIS
 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) 2014 VT MAK
3  ** All rights reserved.
4  *******************************************************************************/
5 
6 #pragma once
7 
10 #include <vl/publisherContainer.h>
12 #include "vehicleSim.h"
13 
14 class DtF18Initializer;
16 class DtExerciseConn;
17 
49 
53 {
54 public:
55 
56  // User parallel execution, or serial execution
57  enum mode { PARALLEL=1, SERIAL=2 };
58 
61 
63  virtual ~DtMultiVehicleFed();
64 
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
114 
115  // Reflected entity list, tracks entities published by remote simulations
117 
118  // Container for fleet (all vehicles published by this simulation)
119  // This shows how to use the general parallel execution container.
121 
122  // Container of published objects.
123  // This shows how to publish objects in parallel, simpler than DtParallelExecutionContainer.
125 };
void sleep(double deltaTime)
DtVehicleSim * vehicleFactory(int num, int appNumOffset, const DtF18Initializer *initializer, DtObjectPublisherContainer &pubContainer)
Instances of DtExerciseConn are used to provide an application&#39;s interface or connection to the netwo...
Definition: exerciseConnDIS.h:61
void drainInput(double tMaxRealElapsed)
mode executionMode() const
Part of the F18 example.
Definition: f18/vehicleSim.h:25
DtF18Initializer derives from DtVrlApplicationInitializer and describes how command line/MTL paramete...
Definition: f18Init.h:29
DtDetonationPdu is used to represent the impact or detonation of a munition.
Definition: detonationPdu.h:42
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:124
DtExerciseConn * myExConn
Definition: multiVehicleFed.h:113
mode
Definition: multiVehicleFed.h:57
multiVehicleFed.h
Definition: multiVehicleFed.h:52
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.
Instances of this class provide a protocol independent interface to a list of reflected entities in a...
Definition: reflectedEntityListDIS.h:31
DtParallelExecutionContainer< DtVehicleSim > mySimulatedVehicles
Definition: multiVehicleFed.h:120
Definition: multiVehicleFed.h:57
void setExecutionMode(mode theMode)
Contains the DtParallelExecutionContainer class declarations.
DtClock * myClock
Definition: multiVehicleFed.h:110
Definition: multiVehicleFed.h:57
DtTime mySimTime
Definition: multiVehicleFed.h:109
void initializeExConn(DtTime theTimeOutInterval, DtF18Initializer *initializer)
mode myMode
Definition: multiVehicleFed.h:108
This file provides protocol independence for Detonation Interactions.
DtExerciseConn * exerciseConn()
Definition: multiVehicleFed.h:65
DtReflectedEntityList * rel
Definition: multiVehicleFed.h:116
void initializeFleet(int appNumOffset, int theNumVehicles, const DtF18Initializer *initializer)

Document ID: Generated on Tue Feb 2 21:02:17 EST 2021 from SVN revision 223668
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)