VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
humanMoveAlongController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
18 
19 class DtCgf;
21 class DtSimMessage;
24 class DtVectorOutputPort;
25 class DtAnalogOutputPort;
26 
39 {
40 private:
47  const DtHumanMoveAlongController& orig);
48 public:
52  DtSimulationServices* simManager, DtComponentDescriptor* desc=0,
53  DtReaderWriterRegistry *parentRegistry=0);
54 
56  virtual ~DtHumanMoveAlongController() override;
57 
59  virtual bool init() override;
60 
63  virtual const char* type() const override;
64 
69  virtual void preFirstTickInit() override;
70 
78  virtual void tick() override;
79 
80  static void moveAlongCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
81 
82  virtual DtSimTaskStatePtr currentTaskState() const override;
83 
87  virtual void processRouteChanged(const DtSimObject* obj);
88 
90  virtual void registerTaskMsgCallbacks() override;
91 
99  virtual bool setupRoute(bool routeHasChanged, bool resetVertex);
100 
107  virtual bool setupDestination();
108 
114  virtual void stop();
115 
117  static DtSimComponent* creator(const DtString& name, DtLocalObject* owner,
118  DtSimulationServices* simManager, DtComponentDescriptor* desc=0,
119  DtReaderWriterRegistry* parentRegistry=0);
120 
126  virtual bool createPSR();
127 
128 protected:
129  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
130 
132  static DtReaderWriter* provideNextRoutePointIndex(void* c);
133 
135  virtual DtHumanMoveAlongPSR* getPSR(){return myProcessState;}
136 
138  virtual bool setDestination(const DtVector& localLocation);
139  virtual void createMoveToPoint(const DtVector& localLocation);
140 
142  virtual bool sendMoveToSubtask();
143 
146  virtual void clearTask() override;
147 
151  virtual bool getCurrentRouteSegment(DtVector& routeSegmentStart,
152  DtVector& routeSegmentEnd) const;
153 
155  virtual void cleanupMoveToPoint();
156 
157  static void taskCompleteReportCallback(DtSimMessage* msg, void* usr);
158  virtual void processTaskCompleteReport(DtSimMessage* msg);
159 
160  virtual bool passedDestination();
161  virtual void setupDestinationVector();
162 
163  virtual bool atDestination() const;
164  virtual double distanceToDestination() const;
165 
166  virtual double atDistance() const;
167 
168  virtual bool createPorts() override;
169 
170  virtual void processEstimatedTotCalculation();
171 
172 protected:
173 
175 
179 
181 
184 
186 
189 
196 
203 
210 
212  const double DtEstimatedTotCalcInterval = 5.0;
213 
220 
226 };
227 
bool myEstimatedTotCalcEnabled
enabled flag for the tot calculations
Definition: humanMoveAlongController.h:215
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
double myRouteWaitTimeout
Definition: humanMoveAlongController.h:224
virtual DtHumanMoveAlongPSR * getPSR()
Gets the process state repository for purposes of providing attributes.
Definition: humanMoveAlongController.h:135
Description: This repository holds all information that is common to all the forms of humans within t...
Definition: humanStateRepository.h:33
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
virtual void registerTaskMsgCallbacks()
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:22
Definition: readerWriter.h:85
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
std::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
bool myOverrideSpeed
Definition: humanMoveAlongController.h:187
DtVector myWorldDestination
Definition: humanMoveAlongController.h:182
double myOverrideSpeedValue
Definition: humanMoveAlongController.h:188
DtHumanMoveAlongControllerDescriptor; descriptor for the DtHumanMoveAlongController component...
Definition: humanMoveAlongControllerDescriptor.h:18
virtual bool init() override
Calls setRadio()
DtPlatformLocalObjectFacade myPlatformLocalObjectFacade
Definition: humanMoveAlongController.h:225
bool myWaitingRoute
Definition: humanMoveAlongController.h:222
Instances of DtAnalogOutputPort are input ports through which data producers can send real numbers...
Definition: analogIOPort.h:45
void registerDtHumanMoveAlongController(DtCgf *cgf)
Registers component and associated classes with the factories. Call after DtVrfApp::init() ...
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
double myMissingTimeStart
Definition: humanMoveAlongController.h:223
File: simMsg.h.
Definition: simMessage.h:35
DtVector myLocalDestination
Definition: humanMoveAlongController.h:183
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtHumanStateRepository * myHumanStateRepository
Definition: humanMoveAlongController.h:174
DtVectorOutputPort * myCurrentVertexLocationOutputPort
Output Port Name: current-vertex-location Output Port Description: Specifies the current vertex locat...
Definition: humanMoveAlongController.h:209
virtual DtSimTaskStatePtr currentTaskState() const
double myEstimatedTotValue
the tot value
Definition: humanMoveAlongController.h:217
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
DtAnalogOutputPort * myEtaForLastVertexOutputPort
Output Port Name: eta-for-last-vertex Output Port Description: Specifies the eta for the last vertex ...
Definition: humanMoveAlongController.h:202
double myEstimatedTotLastCalcTime
used for tot calculation intervals
Definition: humanMoveAlongController.h:219
DtHumanMoveAlongController is a controller that models movement along a route for an individual human...
Definition: humanMoveAlongController.h:38
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
class DtHumanMoveAlongPSR:
Definition: humanMoveAlongPSR.h:27
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:80
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtVectorOutputPort * myLastVertexLocationOutputPort
Output Port Name: last-vertex-location Output Port Description: Specifies the last vertex location of...
Definition: humanMoveAlongController.h:195
The top level class of a VR-Forces Simulation Engine, representing a Computer Generated Forces instan...
Definition: cgf.h:156
bool myWarnedOnce
Definition: humanMoveAlongController.h:221
DtHumanMoveAlongControllerDescriptor * myHumanMoveAlongControllerDescriptor
Definition: humanMoveAlongController.h:180
A DtTaskMsg is a DtRadioMsg with a pointer to a task. The type of the taskMsg is just the type of the...
Definition: taskMessage.h:21
DtHumanMoveAlongPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: humanMoveAlongController.h:178
A locally simulated VRF object.
Definition: localObject.h:98
DtVector myDestinationVector
Definition: humanMoveAlongController.h:185

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)