WSF
wsf::coverage::Coverage Class Referenceabstract

#include <WsfCoverage.hpp>

Inheritance diagram for wsf::coverage::Coverage:
Collaboration diagram for wsf::coverage::Coverage:

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< WsfStringIdTypeList
 The list of types returned by GetTypeList.

Public Member Functions

 Coverage (const WsfScenario &aScenario)
 Coverage (const Coverage &aOther)=default
 ~Coverage () override=default
CoverageClone () 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)
AccessIntervalStartCallbackAccessIntervalStart ()
AccessIntervalEndCallbackAccessIntervalEnd ()
AccessIntervalCompleteCallbackAccessIntervalComplete ()
const GridGetGrid () 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 TypeListGetTypeList () const
bool IsA_TypeOf (WsfStringId aType) const
WsfObjectoperator= (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< FreeAssetmFreeAssets {}
 Free assets for this coverage.
UtCallbackHolder mCallbacks {}

Detailed Description

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.

Member Typedef Documentation

◆ AccessIntervalCompleteCallback

using wsf::coverage::Coverage::AccessIntervalCompleteCallback = UtCallbackListN<void(const GridAsset&, const FreeAsset&, const AccessInterval&)>

◆ AccessIntervalEndCallback

using wsf::coverage::Coverage::AccessIntervalEndCallback = UtCallbackListN<void(const GridAsset&, const FreeAsset&, double)>

◆ AccessIntervalStartCallback

using wsf::coverage::Coverage::AccessIntervalStartCallback = UtCallbackListN<void(const GridAsset&, const FreeAsset&, double)>

Constructor & Destructor Documentation

◆ Coverage() [1/2]

wsf::coverage::Coverage::Coverage ( const WsfScenario & aScenario)
inlineexplicit

◆ Coverage() [2/2]

wsf::coverage::Coverage::Coverage ( const Coverage & aOther)
default

References Coverage().

◆ ~Coverage()

wsf::coverage::Coverage::~Coverage ( )
overridedefault

Member Function Documentation

◆ AccessIntervalComplete()

AccessIntervalCompleteCallback & wsf::coverage::Coverage::AccessIntervalComplete ( )
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.

◆ AccessIntervalEnd()

AccessIntervalEndCallback & wsf::coverage::Coverage::AccessIntervalEnd ( )
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.

◆ AccessIntervalStart()

AccessIntervalStartCallback & wsf::coverage::Coverage::AccessIntervalStart ( )
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.

◆ AddIntervalEndToData()

void wsf::coverage::Coverage::AddIntervalEndToData ( const GridAsset & aGridAsset,
const FreeAsset & aFreeAsset,
double aSimTime )
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.

Parameters
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.

◆ AddIntervalStartToData()

void wsf::coverage::Coverage::AddIntervalStartToData ( const GridAsset & aGridAsset,
const FreeAsset & aFreeAsset,
double aSimTime )
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.

Parameters
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().

◆ CategorizePlatforms()

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.

Parameters
aSimulation- The simulation with platforms to be categorized.

References GetGridAssetCategory().

Referenced by Clone().

◆ Clone()

Coverage * wsf::coverage::Coverage::Clone ( ) const
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().

◆ Finalize()

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.

Parameters
aSimTime- The time at which the coverage is being finalized.
aSimStartEpoch- The start epoch of the simulation.

References mCallbacks.

Referenced by Clone().

◆ GetEndEpoch()

const UtCalendar & wsf::coverage::Coverage::GetEndEpoch ( ) const
inline

Return the date and time of the end of the coverage interval.

◆ GetEndTime()

double wsf::coverage::Coverage::GetEndTime ( ) const
inline

Return the simulation time of the end of the coverage interval.

◆ GetFreeAssetCategory()

const std::string & wsf::coverage::Coverage::GetFreeAssetCategory ( ) const
inlineprotected

Return the category assigned to free asset platform for this coverage.

◆ GetGrid()

const Grid * wsf::coverage::Coverage::GetGrid ( ) const
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.

Returns
- The grid over which this coverage computes if this object is initialized; nullptr if this object is not initialized.

Referenced by wsf::coverage::MeasureGridStats::MeasureGridStats(), and wsf::coverage::MeasureLatLonStats::MeasureLatLonStats().

◆ GetGridAssetCategory()

const std::string & wsf::coverage::Coverage::GetGridAssetCategory ( ) const
inlineprotected

Return the category assigned to grid asset platforms for this coverage.

Referenced by CategorizePlatforms().

◆ GetOutputDir()

const std::string & wsf::coverage::Coverage::GetOutputDir ( ) const
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().

◆ GetStartEpoch()

const UtCalendar & wsf::coverage::Coverage::GetStartEpoch ( ) const
inline

Return the date and time of the start of the coverage interval.

◆ GetStartTime()

double wsf::coverage::Coverage::GetStartTime ( ) const
inline

Return the simulation time of the start of the coverage interval.

◆ InCoverageInterval()

bool wsf::coverage::Coverage::InCoverageInterval ( double aSimTime) const
inline

Does the given simulation time fall inside this object's coverage interval?

Referenced by AddIntervalStartToData().

◆ Initialize()

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.

Parameters
aSimulation- The simulation that this coverage object will be part of.
Returns
- true on successful initialization; false otherwise.

References WsfObject::GetName().

Referenced by Clone().

◆ IsAsset()

bool wsf::coverage::Coverage::IsAsset ( const WsfPlatform * aPlatformPtr) const
inline

Return if the given aPlatformPtr is either a grid or free asset for this coverage.

References IsFreeAsset(), and IsGridAsset().

◆ IsEndEpochDefined()

bool wsf::coverage::Coverage::IsEndEpochDefined ( ) const
inline

Has the end epoch been given a value?

◆ IsFreeAsset()

bool wsf::coverage::Coverage::IsFreeAsset ( const WsfPlatform * aPlatformPtr) const
inline

Return if the given aPlatformPtr is a free asset for this coverage.

References WsfPlatform::IsCategoryMember().

Referenced by IsAsset().

◆ IsGridAsset()

bool wsf::coverage::Coverage::IsGridAsset ( const WsfPlatform * aPlatformPtr) const
inline

Return if the given aPlatformPtr is a grid asset for this coverage.

References WsfPlatform::IsCategoryMember().

Referenced by IsAsset().

◆ IsPlatformDeviceOfType()

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.

◆ IsPlatformOfType()

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.

◆ IsStartEpochDefined()

bool wsf::coverage::Coverage::IsStartEpochDefined ( ) const
inline

Has the start epoch been given a value?

◆ PendingStart()

void wsf::coverage::Coverage::PendingStart ( WsfSimulation & aSimulation)

◆ ProcessInput()

bool wsf::coverage::Coverage::ProcessInput ( UtInput & aInput)
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'.

Parameters
aInputa reference to a UtInput object.
Returns
'true' if the command was one recognized by the class or 'false' if not.
Exceptions
UtInput::ExceptionBase(or an object derived from it) if the command was recognized but contains some sort of error.
Note
If a derived class does not recognize the command (i.e.: the return value is false) then it should call the base class ProcessInput method. This chain should continue until either the command is recognized or the top-level base class is encountered.

Reimplemented from WsfObject.

References end(), WsfObjectTypeList< T >::Find(), and wsf::coverage::MeasureTypes::Get().

Referenced by Clone().

◆ ResolveAssets()

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.

Parameters
aSimulation- The simulation in which this coverage object participates.
Returns
- true if all assets are successfully resolved; false otherwise.

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().

◆ SetGrid()

void wsf::coverage::Coverage::SetGrid ( const Grid * aGridPtr)
inlineprotected

Set the grid for this coverage object.

This sets the grid for this coverage object to be the given aGridPtr.

Note
This is intended for use in unit tests. This should not be used by general clients of this class.

Member Data Documentation

◆ mCallbacks

UtCallbackHolder wsf::coverage::Coverage::mCallbacks {}
protected

This is intended to hold all the callbacks that derived classes use to connect to simulation events.

Referenced by Finalize().

◆ mFreeAssets

std::set<FreeAsset> wsf::coverage::Coverage::mFreeAssets {}
protected

Free assets for this coverage.


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved