WSF
WsfCoverageIntervalConstraint.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 2021 Infoscitex, a DCS 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 WSFCOVERAGEINTERVALCONSTRAINT_HPP
13#define WSFCOVERAGEINTERVALCONSTRAINT_HPP
14
15#include <string>
16#include <vector>
17
18#include "UtCloneablePtr.hpp"
19class UtInput;
20
21#include "wsf_coverage_export.h"
22
24
25namespace wsf
26{
27namespace coverage
28{
29
30class AccessInterval;
31class Coverage;
32class FreeAsset;
33class GridAsset;
34
43class WSF_COVERAGE_EXPORT IntervalConstraint
44{
45public:
46 IntervalConstraint() = default;
47 IntervalConstraint(const IntervalConstraint& aOther) = default;
49
50 IntervalConstraint* Clone() const { return new IntervalConstraint{*this}; }
51 bool ProcessInput(UtInput& aInput);
52
54 void Initialize(const Coverage& aCoverage, const std::string& aOutputDir);
55
59 void Finalize(const UtCalendar& aSimStartEpoch) const;
60
70 bool FilterInterval(const GridAsset& aGridAsset, const FreeAsset& aFreeAsset, const AccessInterval& aInterval) const;
71
80 std::string GetOutputFileName() const;
81
82private:
84 class Filter
85 {
86 public:
87 bool ProcessInput(UtInput& aInput);
88
89 bool FilterInterval(const IntervalConstraint& aConstraint,
90 const GridAsset& aGridAsset,
91 const FreeAsset& aFreeAsset,
92 const AccessInterval& aInterval) const;
93
94 private:
95 enum class ConstraintType
96 {
97 cPLATFORM_NAME,
98 cPLATFORM_TYPE,
99 cDEVICE_NAME,
100 cDEVICE_TYPE,
101 cUNKNOWN
102 };
103
104 void ReadLimits(UtInput& aInput);
105 bool MeetsConstraint(double aDuration) const;
106
107 ConstraintType mType{ConstraintType::cUNKNOWN};
108 std::string mIdentifier{};
109 double mMinimum{-1.0};
110 double mMaximum{-2.0};
111 };
112
113 bool IsPlatformOfType(const std::string& aPlatformName, const std::string& aPlatformType) const;
114 bool IsPlatformDeviceOfType(const std::string& aPlatformName,
115 const std::string& aDeviceName,
116 const std::string& aDeviceType) const;
117
119 const Coverage* mCoveragePtr{nullptr};
120
122 ut::CloneablePtr<RawDataOutput> mFilteredIntervalsPtr{nullptr};
123
125 std::vector<Filter> mFilters{};
126};
127
128} // namespace coverage
129} // namespace wsf
130
131#endif // WSFCOVERAGEINTERVALCONSTRAINT_HPP
Definition WsfCoverageAccessInterval.hpp:28
Definition WsfCoverage.hpp:57
Definition WsfCoverageAsset.hpp:81
Definition WsfCoverageAsset.hpp:37
Definition WsfCoverageIntervalConstraint.hpp:44
IntervalConstraint * Clone() const
Definition WsfCoverageIntervalConstraint.hpp:50
IntervalConstraint(const IntervalConstraint &aOther)=default
Definition WsfCoverage.cpp:35
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Copyrights Multiple, All Rights Reserved