VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
moveAlongWithActionsController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
16 
17 class DtString;
19 class DtTaskMessage;
21 class DtVectorInputPort;
23 
31 
32 class DtRouteAction;
34 
36 {
37 public:
38 
42  DtLocalObject* owner,
43  DtSimulationServices* simManager,
44  DtComponentDescriptor* desc = 0,
45  DtReaderWriterRegistry* parentRegistry = 0);
46 
48  virtual ~DtMoveAlongWithActionsController() override;
49 
51  virtual bool init() override;
52 
55  virtual const char* type() const override;
56 
58  virtual void tick() override;
59 
61  virtual void clearTask() override;
62 
64  static void setSpeedRequiredCallback(DtSimMessage * msg, void * usr);
65  virtual void processSetSpeedRequired(DtSimMessage* msg);
66 
70  static DtSimComponent * creator(const DtString& name,
71  DtLocalObject* owner,
72  DtSimulationServices* simManager,
73  DtComponentDescriptor* desc = 0,
74  DtReaderWriterRegistry* parentRegistry = 0);
75 
76 protected:
78  virtual void registerTaskMsgCallbacks() override;
79 
80  virtual bool createPorts() override;
81 
87  virtual bool createPSR();
88 
91  virtual void createTimeEstimator();
92 
95  static void taskCompleteReportCallback(DtSimMessage * msg, void * usr);
96  virtual void processTaskComplete(DtSimMessage * msg);
97 
99  static void moveAlongWithActionsTaskCallback(DtSimMessage* msg, void* usr);
100  virtual void processMoveAlongWithActionsTask(DtSimMessage* msg);
101 
104  static void deleteVrfObjectCallback(const DtLocalObject* msg, void * usr);
105  virtual void processDeleteVrfObjectCallback(const DtLocalObject* obj);
106 
109  virtual void processRouteChanged(const DtSimObject* obj);
110 
113  virtual void preFirstTickInit() override;
114 
116  virtual void executeCurrentAction();
117 
119  virtual void executeAction(DtRouteAction* routeAction);
120 
122  virtual void executeHold();
123 
126  virtual void executeTargetAction();
127 
129  virtual void updateCurrentAction();
130 
132  virtual void proceedToNextLeg(const DtVector& position);
133 
137  virtual bool passedPosition(const DtVector& position);
138 
141  virtual void traverseLegActions(bool stop = false);
142 
144  virtual void getActionLocalPosition(double routePosition, const DtVector& startPoint, const DtVector& endPoint, DtVector& localPosition);
145 
147  virtual bool passedHoldPosition();
148 
150  virtual bool passedTargetPosition();
151 
154  virtual void estimateTimeOnTarget();
155 
158  virtual void updateHoldAndTargetPointLocations();
159 
161  virtual double timeOnTargetWindow() const;
162 
164  virtual void updateTaskVisualizations() override;
165 
166 private:
167 
170 
173 
176 
177 protected:
178 
182 
189 
192 
194 
196 
198 
200 
201  double myMinSpeed;
202  double myMaxSpeed;
203 
207  std::vector<double> myEstVertexTimes;
208  std::vector<double> myLastTaskVisVertexTimes;
210 };
211 
UUID is a unique ID wrapper class.
Definition: uuid.h:59
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
Performs time estimates for move along route with actions tasks. Based on settings for the entity&#39;s s...
Definition: moveAlongRouteTimeEstimator.h:50
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
DtUUID myActionObj
Definition: moveAlongWithActionsController.h:197
double myMaxSpeed
Definition: moveAlongWithActionsController.h:202
double myHoldUntilTime
Definition: moveAlongWithActionsController.h:204
virtual void registerTaskMsgCallbacks()
double myEstTimeOnTarget
Definition: moveAlongWithActionsController.h:206
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
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: moveAlongWithActionsPSR.h:34
DtMoveAlongWithActionsPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: moveAlongWithActionsController.h:181
Definition: readerWriterRegistry.h:39
double myEstRequiredSpeed
Definition: moveAlongWithActionsController.h:205
std::vector< double > myLastTaskVisVertexTimes
Definition: moveAlongWithActionsController.h:208
Contains class declarations for DtVectorInputPort, DtVectorOutputPort, and DtVectorPortData.
Definition: vectorIOPort.h:27
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:443
virtual bool init() override
Calls setRadio()
std::vector< double > myEstVertexTimes
Definition: moveAlongWithActionsController.h:207
Definition: routeLegActionsEntry.h:29
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtVectorInputPort * myCurrentVertexLocationInputPort
Input Port Name: current-vertex-location Input Port Description: Specifies the current vertex locatio...
Definition: moveAlongWithActionsController.h:188
DtMovementLocalObjectFacade myMovementLocalObjectFacade
Definition: moveAlongWithActionsController.h:209
bool myEnableActions
Definition: moveAlongWithActionsController.h:195
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
Definition: moveAlongWithActionsController.h:35
DtVector myCurrentActionPosition
Definition: moveAlongWithActionsController.h:193
DtMoveAlongRouteTimeEstimator * myEstimator
Definition: moveAlongWithActionsController.h:199
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
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
Definition: routeAction.h:35
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
double myMinSpeed
Definition: moveAlongWithActionsController.h:201
DtVector myCurrentVertexLocation
current vertex position
Definition: moveAlongWithActionsController.h:191
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
A locally simulated VRF object.
Definition: localObject.h:98

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)