12#ifndef WSFCOVERAGECOVERAGE_HPP
13#define WSFCOVERAGECOVERAGE_HPP
21#include "UtCalendar.hpp"
22#include "UtCallback.hpp"
23#include "UtCloneablePtr.hpp"
34#include "wsf_coverage_export.h"
60 : mScenario(aScenario)
62 mStartEpoch.SetDate(1900, 1, 1);
63 mEndEpoch.SetDate(1900, 1, 1);
77 void Finalize(
double aSimTime,
const UtCalendar& aSimStartEpoch);
126 double GetEndTime()
const {
return mCoverageInterval.GetEnd(); }
159 bool IsPlatformOfType(
const std::string& aPlatformName,
const std::string& aPlatformType)
const;
163 bool IsPlatformDeviceOfType(
const std::string& aPlatformName,
164 const std::string& aDeviceName,
165 const std::string& aDeviceType)
const;
176 void AddIntervalStartToData(
const GridAsset& aGridAsset,
const FreeAsset& aFreeAsset,
double aSimTime);
177 void AddIntervalEndToData(
const GridAsset& aGridAsset,
const FreeAsset& aFreeAsset,
double aSimTime);
219 virtual bool AreNullDevicesAllowed(
bool aGridAssetNull,
220 bool aAllGridAssetsNull,
222 bool aAllFreeAssetsNull)
const = 0;
233 virtual bool VerifyDeviceP(
const WsfPlatform& aPlatform,
const std::string& aDeviceName)
const = 0;
246 virtual bool VerifyDeviceAndType(
const WsfPlatform& aPlatform,
247 const std::string& aDeviceName,
248 const std::string& aDeviceType)
const = 0;
260 bool NullDeviceCheck();
261 bool InitializeCoverageInterval(
const WsfSimulation& aSimulation);
262 bool InitializeMeasures();
263 bool AssureFilterFileUniqueness()
const;
264 bool VerifyDevice(
const WsfPlatform& aPlatform,
const std::string& aDeviceName)
const;
269 void StartInterval(
double aSimTime);
270 void CloseAllOpenIntervals(
double aSimTime);
273 void WriteOverlayData()
const;
280 std::string mGridName{};
281 AssetSpecification mAssetSpecification{};
282 std::map<std::string, ut::CloneablePtr<Measure>> mMeasures{};
285 UtCalendar mStartEpoch{};
286 UtCalendar mEndEpoch{};
287 AccessInterval mCoverageInterval{};
290 std::string mOutputDir{};
291 ut::CloneablePtr<RawDataOutput> mRawData{
nullptr};
292 std::string mOverlayOutputFileName{};
295 const Grid* mGridPtr{
nullptr};
296 std::string mGridAssetCategory{};
297 std::string mFreeAssetCategory{};
300 AccessIntervalStartCallback mIntervalStart{};
301 AccessIntervalEndCallback mIntervalEnd{};
302 AccessIntervalCompleteCallback mIntervalComplete{};
305 std::map<GridAsset, std::map<FreeAsset, AccessInterval>> mData{};
308 std::vector<IntervalConstraint> mConstraints{};
310 bool mFinalized{
false};
WsfObject()
This is the constructor for the WsfObject class.
Definition WsfObject.cpp:88
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfCoverageAccessInterval.hpp:28
bool IsGridAsset(const WsfPlatform *aPlatformPtr) const
Return if the given aPlatformPtr is a grid asset for this coverage.
Definition WsfCoverage.hpp:153
bool IsAsset(const WsfPlatform *aPlatformPtr) const
Return if the given aPlatformPtr is either a grid or free asset for this coverage.
Definition WsfCoverage.hpp:141
bool IsEndEpochDefined() const
Has the end epoch been given a value?
Definition WsfCoverage.hpp:138
AccessIntervalCompleteCallback & AccessIntervalComplete()
Definition WsfCoverage.hpp:102
void Finalize(double aSimTime, const UtCalendar &aSimStartEpoch)
Definition WsfCoverage.cpp:254
Coverage(const Coverage &aOther)=default
AccessIntervalEndCallback & AccessIntervalEnd()
Definition WsfCoverage.hpp:95
const std::string & GetFreeAssetCategory() const
Return the category assigned to free asset platform for this coverage.
Definition WsfCoverage.hpp:183
UtCallbackHolder mCallbacks
Definition WsfCoverage.hpp:190
bool IsFreeAsset(const WsfPlatform *aPlatformPtr) const
Return if the given aPlatformPtr is a free asset for this coverage.
Definition WsfCoverage.hpp:147
bool IsStartEpochDefined() const
Has the start epoch been given a value?
Definition WsfCoverage.hpp:132
bool InCoverageInterval(double aSimTime) const
Does the given simulation time fall inside this object's coverage interval?
Definition WsfCoverage.hpp:120
void PendingStart(WsfSimulation &aSimulation)
Definition WsfCoverage.cpp:209
Coverage * Clone() const override=0
bool ResolveAssets(WsfSimulation &aSimulation)
Definition WsfCoverage.cpp:162
double GetEndTime() const
Return the simulation time of the end of the coverage interval.
Definition WsfCoverage.hpp:126
std::set< FreeAsset > mFreeAssets
Free assets for this coverage.
Definition WsfCoverage.hpp:186
UtCallbackListN< void(const GridAsset &, const FreeAsset &, double)> AccessIntervalEndCallback
Definition WsfCoverage.hpp:81
const std::string & GetOutputDir() const
Definition WsfCoverage.hpp:117
double GetStartTime() const
Return the simulation time of the start of the coverage interval.
Definition WsfCoverage.hpp:123
bool ProcessInput(UtInput &aInput) override
Definition WsfCoverage.cpp:37
const Grid * GetGrid() const
Definition WsfCoverage.hpp:111
const std::string & GetGridAssetCategory() const
Return the category assigned to grid asset platforms for this coverage.
Definition WsfCoverage.hpp:180
Coverage(const WsfScenario &aScenario)
Definition WsfCoverage.hpp:59
~Coverage() override=default
UtCallbackListN< void(const GridAsset &, const FreeAsset &, const AccessInterval &)> AccessIntervalCompleteCallback
Definition WsfCoverage.hpp:82
void SetGrid(const Grid *aGridPtr)
Definition WsfCoverage.hpp:174
const UtCalendar & GetStartEpoch() const
Return the date and time of the start of the coverage interval.
Definition WsfCoverage.hpp:129
UtCallbackListN< void(const GridAsset &, const FreeAsset &, double)> AccessIntervalStartCallback
Definition WsfCoverage.hpp:80
bool Initialize(WsfSimulation &aSimulation)
Definition WsfCoverage.cpp:133
AccessIntervalStartCallback & AccessIntervalStart()
Definition WsfCoverage.hpp:90
void CategorizePlatforms(const WsfSimulation &aSimulation)
Definition WsfCoverage.cpp:203
const UtCalendar & GetEndEpoch() const
Return the date and time of the end of the coverage interval.
Definition WsfCoverage.hpp:135
Definition WsfCoverageAsset.hpp:81
Definition WsfCoverageAsset.hpp:37
The Grid object defines the region over which coverage can be computed.
Definition WsfCoverageGrid.hpp:38
Definition WsfCoverage.cpp:35
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
A record read in from the input file.
Definition WsfCoverageAssetSpecification.hpp:53