WSF
wsf::coverage::Measure Class Referenceabstract

#include <WsfCoverageMeasure.hpp>

Inheritance diagram for wsf::coverage::Measure:
Collaboration diagram for wsf::coverage::Measure:

Public Member Functions

 Measure (const WsfScenario &aScenario)
 Measure (const Measure &aOther)=default
 ~Measure () override=default
MeasureClone () const override=0
bool ProcessInput (UtInput &aInput) override
virtual double GetMeasuredValue (const GridAsset &aGridAsset) const =0
 Return the measured value for a given aGridAsset.
virtual std::string GetValueHeader () const =0
virtual double GetDefaultValue () const =0
 Return the default value of the measure.
bool Initialize (Coverage &aCoverage)
virtual void CollectionStarting (Coverage &aCoverage, double aSimTime)
void CollectionCompleting (Coverage &aCoverage, double aSimTime)
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

std::size_t GetNumOutput () const
 Return the number of output objects attached to this Measure.
const MeasureOutputGetOutput (std::size_t aIndex) const
 Return the output object at the given index.
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).

Protected Attributes

UtCallbackHolder mCallbacks {}
 Holder for callbacks created when this object connects to events on it's coverage.

Additional Inherited Members

Public Types inherited from WsfObject
typedef std::vector< WsfStringIdTypeList
 The list of types returned by GetTypeList.

Detailed Description

Measure represents a MOE for a coverage computation.

Each MOE is owned by a coverage object, and is responsible for connecting to the various interval events on that coverage objects. In this way, the Measure is updated as the simulation progresses with data as it becomes available. Measures also own instances of output objects that will write the resulting measured values out in various formats.

Constructor & Destructor Documentation

◆ Measure() [1/2]

◆ Measure() [2/2]

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

References Measure().

◆ ~Measure()

wsf::coverage::Measure::~Measure ( )
overridedefault

Member Function Documentation

◆ Clone()

Measure * wsf::coverage::Measure::Clone ( ) const
overridepure virtual

◆ CollectionCompleting()

void wsf::coverage::Measure::CollectionCompleting ( Coverage & aCoverage,
double aSimTime )

Tack any action needed at the end of a coverage collection interval.

In addition to allowing the subclass to perform any subclass-specific tasks, this will cause all the output objects to produce their output.

Parameters
aCoverage- The coverage owning this object.
aSimTime- The sim time of the end of collection.

◆ CollectionStarting()

virtual void wsf::coverage::Measure::CollectionStarting ( Coverage & aCoverage,
double aSimTime )
inlinevirtual

Perform any needed actions when the coverage interval begins.

Parameters
aCoverage- The coverage owning this object.
aSimTime- The sim time at which the coverate interval starts.

Reimplemented in wsf::coverage::AccessDuration, wsf::coverage::CoverageTime, wsf::coverage::N_AssetCoverage, wsf::coverage::NumberOfAccesses, wsf::coverage::NumberOfGaps, wsf::coverage::RevisitTime, and wsf::coverage::TimeAverageGap.

◆ GetDefaultValue()

virtual double wsf::coverage::Measure::GetDefaultValue ( ) const
pure virtual

◆ GetMeasuredValue()

◆ GetNumOutput()

std::size_t wsf::coverage::Measure::GetNumOutput ( ) const
inlineprotected

Return the number of output objects attached to this Measure.

◆ GetOutput()

const MeasureOutput * wsf::coverage::Measure::GetOutput ( std::size_t aIndex) const
inlineprotected

Return the output object at the given index.

◆ GetValueHeader()

virtual std::string wsf::coverage::Measure::GetValueHeader ( ) const
pure virtual

Return a string giving the header for this value in output files.

This header should be descriptive enough to be interpreted by a human reader. The return value will appear as a field in a CSV file, so there should not be any commas in the returned value.

Implemented in wsf::coverage::AccessDuration, wsf::coverage::CoverageTime, wsf::coverage::N_AssetCoverage, wsf::coverage::NumberOfAccesses, wsf::coverage::NumberOfGaps, wsf::coverage::RevisitTime, wsf::coverage::SimpleCoverage, and wsf::coverage::TimeAverageGap.

◆ Initialize()

bool wsf::coverage::Measure::Initialize ( Coverage & aCoverage)

Initialize this Measure.

In addition to propagating the output directory from aCoverage to this objects output, this will assure that the output will produce files with unique names among the outputs for this Measure. Finally, this calls into the subclasses intialization method, in which it is expected that the subclass will connect to the interval events on aCoverage.

Parameters
aCoverage- The coverage owning this.
Returns
- true if initialization is successful; false otherwise.

References WsfObject::GetName(), and wsf::coverage::Coverage::GetOutputDir().

Referenced by GetDefaultValue().

◆ ProcessInput()

bool wsf::coverage::Measure::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.

Reimplemented in wsf::coverage::N_AssetCoverage, wsf::coverage::NumberOfAccesses, wsf::coverage::NumberOfGaps, and wsf::coverage::RevisitTime.

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

Referenced by Clone(), wsf::coverage::AccessDuration::ProcessInput(), wsf::coverage::CoverageTime::ProcessInput(), wsf::coverage::N_AssetCoverage::ProcessInput(), wsf::coverage::NumberOfAccesses::ProcessInput(), wsf::coverage::NumberOfGaps::ProcessInput(), and wsf::coverage::RevisitTime::ProcessInput().

Member Data Documentation

◆ mCallbacks

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

Holder for callbacks created when this object connects to events on it's coverage.


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