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 
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
112 
113  // Reflected entity list, tracks entities published by remote simulations
115 
116  // Container for fleet (all vehicles published by this simulation)
117  // This shows how to use the general parallel execution container.
119 
120  // Container of published objects.
121  // This shows how to publish objects in parallel, simpler than DtParallelExecutionContainer.
123 };

Document ID: Generated on Thu Feb 22 04:26:36 EST 2018 from SVN revision 186468
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)