|
WSF
|
#include <WsfCoverage.hpp>


Public Types | |
| using | AccessIntervalStartCallback = UtCallbackListN<void(const GridAsset&, const FreeAsset&, double)> |
| using | AccessIntervalEndCallback = UtCallbackListN<void(const GridAsset&, const FreeAsset&, double)> |
| using | AccessIntervalCompleteCallback = UtCallbackListN<void(const GridAsset&, const FreeAsset&, const AccessInterval&)> |
| Public Types inherited from WsfObject | |
| typedef std::vector< WsfStringId > | TypeList |
| The list of types returned by GetTypeList. | |
Public Member Functions | |
| Coverage (const WsfScenario &aScenario) | |
| Coverage (const Coverage &aOther)=default | |
| ~Coverage () override=default | |
| Coverage * | Clone () const override=0 |
| bool | ProcessInput (UtInput &aInput) override |
| bool | Initialize (WsfSimulation &aSimulation) |
| bool | ResolveAssets (WsfSimulation &aSimulation) |
| void | CategorizePlatforms (const WsfSimulation &aSimulation) |
| void | PendingStart (WsfSimulation &aSimulation) |
| void | Finalize (double aSimTime, const UtCalendar &aSimStartEpoch) |
| AccessIntervalStartCallback & | AccessIntervalStart () |
| AccessIntervalEndCallback & | AccessIntervalEnd () |
| AccessIntervalCompleteCallback & | AccessIntervalComplete () |
| const Grid * | GetGrid () const |
| const std::string & | GetOutputDir () const |
| bool | InCoverageInterval (double aSimTime) const |
| Does the given simulation time fall inside this object's coverage interval? | |
| double | GetStartTime () const |
| Return the simulation time of the start of the coverage interval. | |
| double | GetEndTime () const |
| Return the simulation time of the end of the coverage interval. | |
| const UtCalendar & | GetStartEpoch () const |
| Return the date and time of the start of the coverage interval. | |
| bool | IsStartEpochDefined () const |
| Has the start epoch been given a value? | |
| const UtCalendar & | GetEndEpoch () const |
| Return the date and time of the end of the coverage interval. | |
| bool | IsEndEpochDefined () const |
| Has the end epoch been given a value? | |
| bool | IsAsset (const WsfPlatform *aPlatformPtr) const |
Return if the given aPlatformPtr is either a grid or free asset for this coverage. | |
| bool | IsFreeAsset (const WsfPlatform *aPlatformPtr) const |
Return if the given aPlatformPtr is a free asset for this coverage. | |
| bool | IsGridAsset (const WsfPlatform *aPlatformPtr) const |
Return if the given aPlatformPtr is a grid asset for this coverage. | |
| bool | IsPlatformOfType (const std::string &aPlatformName, const std::string &aPlatformType) const |
Return if the platform with the given aPlatformName has the given aPlatformType. | |
| bool | IsPlatformDeviceOfType (const std::string &aPlatformName, const std::string &aDeviceName, const std::string &aDeviceType) const |
| Public Member Functions inherited from WsfObject | |
| WsfObject () | |
| This is the constructor for the WsfObject class. | |
| ~WsfObject () override | |
| This is the destructor for the WsfObject class. | |
| const char * | GetScriptClassName () const override |
| const std::string & | GetType () const |
| WsfStringId | GetTypeId () const |
| Get the string ID of the 'type' of the object. | |
| void | SetType (WsfStringId aType) |
| const std::string & | GetBaseType () const |
| WsfStringId | GetBaseTypeId () const |
| const TypeList & | GetTypeList () const |
| bool | IsA_TypeOf (WsfStringId aType) const |
| WsfObject & | operator= (const WsfObject &aRhs) |
| Assignment operator. | |
| template<typename T> | |
| void | Serialize (T &aBuff) |
| For XIO (de)serialization. | |
| const std::string & | GetName () const |
| WsfStringId | GetNameId () const |
| void | SetName (WsfStringId aName) |
Protected Member Functions | |
| void | SetGrid (const Grid *aGridPtr) |
| void | AddIntervalStartToData (const GridAsset &aGridAsset, const FreeAsset &aFreeAsset, double aSimTime) |
| void | AddIntervalEndToData (const GridAsset &aGridAsset, const FreeAsset &aFreeAsset, double aSimTime) |
| const std::string & | GetGridAssetCategory () const |
| Return the category assigned to grid asset platforms for this coverage. | |
| const std::string & | GetFreeAssetCategory () const |
| Return the category assigned to free asset platform for this coverage. | |
| WsfObject (const WsfObject &aSrc) | |
| Copy constructor (for Clone()). | |
Protected Attributes | |
| std::set< FreeAsset > | mFreeAssets {} |
| Free assets for this coverage. | |
| UtCallbackHolder | mCallbacks {} |
Compute coverage of various assets over a specified grid.
A coverage computation observes interactions between platforms in the simulation and computes various measures of effectiveness (denoted MOE or Measure) from the interaction data. The platforms whose interactions are observed are either from a set of platforms instantiated to be at the locations of the points in the grid (these are called grid assets), or from platforms that exist in the simulation (these are called free assets, or just assets).
Each coverage object will specify the set of assets to use in the computation, a grid over which to compute, and a set of MOEs to compute for those assets over that grid.
| using wsf::coverage::Coverage::AccessIntervalCompleteCallback = UtCallbackListN<void(const GridAsset&, const FreeAsset&, const AccessInterval&)> |
| using wsf::coverage::Coverage::AccessIntervalEndCallback = UtCallbackListN<void(const GridAsset&, const FreeAsset&, double)> |
| using wsf::coverage::Coverage::AccessIntervalStartCallback = UtCallbackListN<void(const GridAsset&, const FreeAsset&, double)> |
|
inlineexplicit |
Referenced by Clone(), Coverage(), and wsf::coverage::SensorCoverage::SensorCoverage().
|
default |
References Coverage().
|
overridedefault |
|
inline |
Return the callback list that is triggered when a complete access interval is formed.
Unlike for the start and end of an access interval, subscribers to the event are only notified if the access interval passes any filtering provided by the IntervalConstraints defined on this object.
|
inline |
Return the callback list that is triggered at the end of a relevant access interval. Subscribers to this event are always notified even in the event that the complete access interval is filtered out of the data.
|
inline |
Return the callback list that is triggered at the start of a relevant access interval.
The Measure objects defined on a coverage may observe these events so that they might include this information in their calculation. The subscribers to the access interval start event are always notified of the event, even if the complete interval is ultimately filtered out of the data.
|
protected |
End an interval for the given assets at the given time.
This will end an access interval between the given aGridAsset and aFreeAsset with the given aSimTime as the end of the interval. The provided assets should already be filtered to be relevant for this coverage object, and the time of this event should be inside the coverage interval. This method handles notification of MOEs about the end of an interval, the completion of an interval, and in some cases the start of an interval. This method also collects the full interval data into the raw data store in case the output of this data has been requested by the user.
| aGridAsset | - The grid asset for the access interval. |
| aFreeAsset | - The free asset for the access interval. |
| aSimTime | - The simulation time of the end of the access interval. |
|
protected |
Start an interval for the given assets with the given start time.
This will start an access interval between the given aGridAsset and aFreeAsset with the given aSimTime as the start of the interval. The provided assets should already be filtered to be relevant for this coverage object, and the time of this event should be inside the coverage interval. This method handles notification of any MOE observing interval start times.
| aGridAsset | - The grid asset for the access interval. |
| aFreeAsset | - The free asset for the access interval. |
| aSimTime | - The simulation time of the start of the access interval. |
References InCoverageInterval().
| void wsf::coverage::Coverage::CategorizePlatforms | ( | const WsfSimulation & | aSimulation | ) |
Categorize all platforms in the simulation relative to this coverage object.
Categorization allows for fast detection of the status of a platform, and allows for sensors on platforms to ignore irrelevant platforms.
| aSimulation | - The simulation with platforms to be categorized. |
References GetGridAssetCategory().
Referenced by Clone().
|
overridepure virtual |
Return a copy of this object. Must be implemented by all derived types. If cloning is impossible, a WsfUncloneableException should be thrown.
Implements WsfObject.
Implemented in wsf::coverage::SensorCoverage.
References CategorizePlatforms(), Coverage(), Finalize(), Initialize(), PendingStart(), ProcessInput(), and ResolveAssets().
| void wsf::coverage::Coverage::Finalize | ( | double | aSimTime, |
| const UtCalendar & | aSimStartEpoch ) |
Finalize the work of this coverage object.
This will close any open intervals, disconnect the object from simulation events, and write out the raw interaction data at the end of the coverage interval. This method is called either as a result of a coverage interval end-point that is before the end of the simulation, or due to the end of the simulation.
| aSimTime | - The time at which the coverage is being finalized. |
| aSimStartEpoch | - The start epoch of the simulation. |
References mCallbacks.
Referenced by Clone().
|
inline |
Return the date and time of the end of the coverage interval.
|
inline |
Return the simulation time of the end of the coverage interval.
|
inlineprotected |
Return the category assigned to free asset platform for this coverage.
|
inline |
Return the grid object this object will compute over.
This method returns the grid object this coverage object will compute over. If this is called before this object is initialized, this will return nullptr.
Referenced by wsf::coverage::MeasureGridStats::MeasureGridStats(), and wsf::coverage::MeasureLatLonStats::MeasureLatLonStats().
|
inlineprotected |
Return the category assigned to grid asset platforms for this coverage.
Referenced by CategorizePlatforms().
|
inline |
Return the output directory for this objects data.
Any output files that are produced by this object will be placed in this folder.
Referenced by wsf::coverage::Measure::Initialize().
|
inline |
Return the date and time of the start of the coverage interval.
|
inline |
Return the simulation time of the start of the coverage interval.
|
inline |
Does the given simulation time fall inside this object's coverage interval?
Referenced by AddIntervalStartToData().
| bool wsf::coverage::Coverage::Initialize | ( | WsfSimulation & | aSimulation | ) |
Initialize this coverage object.
This is called by the simulation extension when the simulation is being initialized. This is a template pattern method; most of the work occurs in methods on this class, InitializeP is called on the derived classes to set up any connections with simulation events.
| aSimulation | - The simulation that this coverage object will be part of. |
References WsfObject::GetName().
Referenced by Clone().
|
inline |
Return if the given aPlatformPtr is either a grid or free asset for this coverage.
References IsFreeAsset(), and IsGridAsset().
|
inline |
Has the end epoch been given a value?
|
inline |
Return if the given aPlatformPtr is a free asset for this coverage.
References WsfPlatform::IsCategoryMember().
Referenced by IsAsset().
|
inline |
Return if the given aPlatformPtr is a grid asset for this coverage.
References WsfPlatform::IsCategoryMember().
Referenced by IsAsset().
| bool wsf::coverage::Coverage::IsPlatformDeviceOfType | ( | const std::string & | aPlatformName, |
| const std::string & | aDeviceName, | ||
| const std::string & | aDeviceType ) const |
Return if the platform with the given aPlatformName has a device with the given aDeviceName that has the given aDeviceType.
References platformPtr.
| bool wsf::coverage::Coverage::IsPlatformOfType | ( | const std::string & | aPlatformName, |
| const std::string & | aPlatformType ) const |
Return if the platform with the given aPlatformName has the given aPlatformType.
References platformPtr.
|
inline |
Has the start epoch been given a value?
| void wsf::coverage::Coverage::PendingStart | ( | WsfSimulation & | aSimulation | ) |
References WsfSimulation::AddEvent(), WsfSimulation::GetDateTime(), and WsfDateTime::GetStartDateAndTime().
Referenced by Clone().
|
overridevirtual |
Process input from a generic source.
Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.
| aInput | a reference to a UtInput object. |
| UtInput::ExceptionBase | (or an object derived from it) if the command was recognized but contains some sort of error. |
Reimplemented from WsfObject.
References end(), WsfObjectTypeList< T >::Find(), and wsf::coverage::MeasureTypes::Get().
Referenced by Clone().
| bool wsf::coverage::Coverage::ResolveAssets | ( | WsfSimulation & | aSimulation | ) |
Resolve the asset specifications.
The user is able to specify assets in groups, so this method resolves the user-specified assets into a single platform per asset form used by the coverage object. If there is any problem making this resolution, then this will return false.
| aSimulation | - The simulation in which this coverage object participates. |
References wsf::coverage::AssetSpecification::cCATEGORY, wsf::coverage::AssetSpecification::cGROUP, wsf::coverage::AssetSpecification::cPLATFORM, wsf::coverage::AssetSpecification::cPLATFORM_TYPE, and wsf::coverage::AssetSpecification::cUNKNOWN.
Referenced by Clone().
|
inlineprotected |
Set the grid for this coverage object.
This sets the grid for this coverage object to be the given aGridPtr.
|
protected |
This is intended to hold all the callbacks that derived classes use to connect to simulation events.
Referenced by Finalize().
|
protected |
Free assets for this coverage.