WSF
WsfFrameStepSimulation.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFFRAMESTEPSIMULATION_HPP
13#define WSFFRAMESTEPSIMULATION_HPP
14
15#include "wsf_export.h"
16
17#include "UtCallback.hpp"
19#include "WsfSimulation.hpp"
20#include "WsfThreadPool.hpp"
28
30{
31public:
32 WsfFrameStepSimulation(WsfScenario& aScenario, unsigned int aRunNumber);
33 ~WsfFrameStepSimulation() override = default;
34
35 void AddEvent(std::unique_ptr<WsfEvent> aEventPtr) override;
36
37 double AdvanceTime() override;
38
39 double AdvanceTime(double aSimTime) override;
40
41 bool AddPlatform(WsfPlatform* aPlatformPtr) override;
42
43 bool AddPlatform(double aSimTime, WsfPlatform* aPlatformPtr) override;
44
45 void DeletePlatform(double aSimTime, WsfPlatform* aPlatformPtr, bool aDeleteMemory = true) override;
46
47 void Initialize() override;
48
49 void Start() override;
50
51 void Complete(double aSimTime) override;
52
53 void SetRealtime(double aSimTime, bool aIsRealTime) override;
54
55 void WaitForAdvanceTime() override;
56
57 double GetFrameTime() const;
58
59 UtCallbackListN<void(double)> AdvanceFrameObjects;
60
61protected:
62 virtual double AdvanceFrame();
63
64 void CreateClock() override;
65
66
67 bool TurnPartOffP(double aSimTime, WsfPlatformPart* aPartPtr) override;
68
69 bool TurnPartOnP(double aSimTime, WsfPlatformPart* aPartPtr) override;
70
83
90
91 std::vector<WsfPlatform*> mPlatforms;
92 std::vector<wsf::comm::Comm*> mComms;
93 std::vector<WsfProcessor*> mProcessors;
94 std::vector<WsfSensor*> mSensors;
95};
96
97#endif
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Reads inputs specific to frame-stepped simulations.
Definition WsfSimulationInput.hpp:194
std::vector< WsfPlatform * > mPlatforms
Definition WsfFrameStepSimulation.hpp:91
double mWorstFrameOverTime
Definition WsfFrameStepSimulation.hpp:89
std::vector< WsfProcessor * > mProcessors
Definition WsfFrameStepSimulation.hpp:93
std::vector< wsf::comm::Comm * > mComms
Definition WsfFrameStepSimulation.hpp:92
double mTotalFrameOverTime
Definition WsfFrameStepSimulation.hpp:86
double mTotalFrameOverCount
Definition WsfFrameStepSimulation.hpp:87
double mTotalFrameUnderTime
Definition WsfFrameStepSimulation.hpp:84
virtual double AdvanceFrame()
Definition WsfFrameStepSimulation.cpp:111
double mSkippedFrameCount
Definition WsfFrameStepSimulation.hpp:88
std::vector< WsfSensor * > mSensors
Definition WsfFrameStepSimulation.hpp:94
const WsfFrameStepSimulationInput * mFrameStepInput
Definition WsfFrameStepSimulation.hpp:71
double mFrameCount
Definition WsfFrameStepSimulation.hpp:80
~WsfFrameStepSimulation() override=default
WsfFrameStepSimulation(WsfScenario &aScenario, unsigned int aRunNumber)
Definition WsfFrameStepSimulation.cpp:60
double mTimeUntilNextFrame
Definition WsfFrameStepSimulation.hpp:82
double mNextFrameTime
Definition WsfFrameStepSimulation.hpp:81
double GetFrameTime() const
Definition WsfFrameStepSimulation.cpp:593
UtCallbackListN< void(double)> AdvanceFrameObjects
Definition WsfFrameStepSimulation.hpp:59
double mTotalFrameUnderCount
Definition WsfFrameStepSimulation.hpp:85
Definition WsfPlatformPart.hpp:61
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
virtual double AdvanceTime()
Definition WsfSimulation.cpp:186
virtual bool AddPlatform(WsfPlatform *aPlatformPtr)
Definition WsfSimulation.cpp:275
virtual void Complete(double aSimTime)
Definition WsfSimulation.cpp:832
virtual void DeletePlatform(double aSimTime, WsfPlatform *aPlatformPtr, bool aDeleteMemory=true)
Definition WsfSimulation.cpp:410
virtual bool TurnPartOnP(double aSimTime, WsfPlatformPart *aPartPtr)
Definition WsfSimulation.cpp:1363
virtual void CreateClock()
Definition WsfSimulation.cpp:151
virtual void Initialize()
Definition WsfSimulation.cpp:537
virtual void SetRealtime(double aSimTime, bool aIsRealTime)
Instructs the simulation to run in a real-time mode.
Definition WsfSimulation.hpp:299
virtual bool TurnPartOffP(double aSimTime, WsfPlatformPart *aPartPtr)
Definition WsfSimulation.cpp:1347
virtual void Start()
Definition WsfSimulation.cpp:889
virtual void AddEvent(std::unique_ptr< WsfEvent > aEventPtr)
Definition WsfSimulation.cpp:162
virtual void WaitForAdvanceTime()
Definition WsfSimulation.cpp:1562
WsfSimulation(const WsfScenario &aScenario, unsigned int aRunNumber)
Definition WsfSimulation.cpp:94
Copyrights Multiple, All Rights Reserved