WSF
Tool Class Referenceabstract

#include <Tool.hpp>

Inheritance diagram for Tool:
Collaboration diagram for Tool:

Public Member Functions

 Tool (const Tool &aSrc)
Tooloperator= (const Tool &)=delete
 ~Tool () override
ToolClone () const override=0
virtual void Update (double aSimTime)
virtual bool Initialize (WsfSimulation &aSimulation)
bool ProcessInput (UtInput &aInput) override
virtual void MoverBurnout (double aSimTime, WsfMover *aMoverPtr)
 name Callbacks from WeaponObserver (lets the tool have access to simulation callbacks)
virtual void GuidanceComputerPhaseChanged (double aSimTime, WsfGuidanceComputer *aComputerPtr)
 Optional tool method called by WeaponObserver to pass on the GuidanceComputerPhaseChanged simulation observer event.
virtual void PlatformAdded (double aSimTime, WsfPlatform *aPlatformPtr)
 Optional tool method called by WeaponObserver to pass on the PlatformAdded simulation observer event.
WsfStringId WeaponPlatformTypeId () const
double FrameStep () const
bool IsInitialized () const
WsfPlatformGetLauncherPlatform () const
WsfExplicitWeaponGetLauncherWeapon () 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

WsfSimulationGetSimulation () const
WsfScenarioGetScenario () const
ToolManagerGetManager () const
 Tool (WsfScenario &aScenario)
 This constructor initializes the object.
void UnInitialize ()
bool IsDone () const
 Return a flag to indicate that this Tool has completed its work.
bool DebugEnabled () const
 Return a flag to indicate that debugging is enabled.
virtual void ResolveNames ()
 Method called to determine what the output objects and file names are called.
virtual bool FireNewWeapon (double aSimTime)=0
virtual void ErrorBailout ()
 WsfObject (const WsfObject &aSrc)
 Copy constructor (for Clone()).

Protected Attributes

WsfScenariomScenarioPtr
WsfSimulationmSimulationPtr
WeaponObserver mObserver
WsfPlatformmLaunchPlatPtr
WsfExplicitWeaponmLaunchWpnPtr
double mFrameStep
double mLastUpdate
double mLatDeg
double mLonDeg
double mAlt
double mHeadingRad
bool mDone
bool mNotifiedDone
bool mInitialized
bool mDebug
bool mTerminateOnLaunchFailure
std::string mToolProduces
std::string mFileExtension
WsfStringId mWeaponEffectTypeId
WsfStringId mLaunchPlatformTypeId
WsfStringId mTargetPlatformTypeId
WsfStringId mWeaponNameId
std::string mOutputFileName
std::string mOutputObjectName

Additional Inherited Members

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

Detailed Description

Tool is a base class for a processor that does some utility function and reports when it is done. Tool is a processor (similar to WsfProcessor, but distinct from it, since it does not reside on a WsfPlatform) that does some utility function. The look and feel of this utility is modeled upon the WSF core framework. The intent is that a single "main" function will instantiate and control one or more Tools, and carry out a WsfSimulation, advancing time until each of the instantiated Tools have reported that they are done. The earliest use of this class is in repeatedly firing explicit weapons of interest, under completely controlled engagement conditions, to gather metrics that quantify the weapon's performance and behavior (defining lethality tables, Launch Acceptable Regions (LARs), times of flight, etc.). The input stream (see ProcessInput()) will specify where the Tool activity takes place (in latitude, longitude), the explicit weapon type to experiment upon, and other necessary information.

Constructor & Destructor Documentation

◆ Tool() [1/2]

Tool::Tool ( const Tool & aSrc)

References mAlt, mDebug, mDone, mFileExtension, mFrameStep, mHeadingRad, mInitialized, mLastUpdate, mLatDeg, mLaunchPlatformTypeId, mLaunchPlatPtr, mLaunchWpnPtr, mLonDeg, mNotifiedDone, mObserver, mOutputFileName, mOutputObjectName, mScenarioPtr, mSimulationPtr, mTargetPlatformTypeId, mTerminateOnLaunchFailure, mToolProduces, mWeaponEffectTypeId, mWeaponNameId, Tool(), and WsfObject::WsfObject().

Referenced by AirToAirLaunchComputerGenerator::AirToAirLaunchComputerGenerator(), ATA_LaunchComputerGenerator::ATA_LaunchComputerGenerator(), ATA_LaunchComputerGenerator::ATA_LaunchComputerGenerator(), ATG_LAR_And_LC_Generator::ATG_LAR_And_LC_Generator(), ATG_LAR_And_LC_Generator::ATG_LAR_And_LC_Generator(), BallisticLaunchComputerGenerator::BallisticLaunchComputerGenerator(), BallisticLaunchComputerGenerator::BallisticLaunchComputerGenerator(), BallisticMissileLaunchComputerGenerator::BallisticMissileLaunchComputerGenerator(), BallisticMissileLaunchComputerGenerator::BallisticMissileLaunchComputerGenerator(), AirToAirLaunchComputerGenerator::Clone(), ATA_LaunchComputerGenerator::Clone(), ATG_LAR_And_LC_Generator::Clone(), BallisticLaunchComputerGenerator::Clone(), BallisticMissileLaunchComputerGenerator::Clone(), OrbitalLaunchComputerGenerator::Clone(), SAM_LaunchComputerGenerator::Clone(), Clone(), ATA_LaunchComputerGenerator::operator=(), BallisticLaunchComputerGenerator::operator=(), BallisticMissileLaunchComputerGenerator::operator=(), operator=(), OrbitalLaunchComputerGenerator::OrbitalLaunchComputerGenerator(), OrbitalLaunchComputerGenerator::OrbitalLaunchComputerGenerator(), SAM_LaunchComputerGenerator::SAM_LaunchComputerGenerator(), Tool(), ATG_LAR_And_LC_Generator::~ATG_LAR_And_LC_Generator(), and OrbitalLaunchComputerGenerator::~OrbitalLaunchComputerGenerator().

◆ ~Tool()

Tool::~Tool ( )
override

◆ Tool() [2/2]

Member Function Documentation

◆ Clone()

Tool * Tool::Clone ( ) const
overridepure virtual

◆ DebugEnabled()

◆ ErrorBailout()

virtual void Tool::ErrorBailout ( )
inlineprotectedvirtual

◆ FireNewWeapon()

virtual bool Tool::FireNewWeapon ( double aSimTime)
protectedpure virtual

Method called to fire a new weapon. Pure virtual base method must be implemented in derived classes.

Parameters
aSimTimeThe current simulated time.

Implemented in AirToAirLaunchComputerGenerator, ATG_LAR_And_LC_Generator, BallisticLaunchComputerGenerator, and SAM_LaunchComputerGenerator.

◆ FrameStep()

double Tool::FrameStep ( ) const
inline

References mFrameStep.

◆ GetLauncherPlatform()

WsfPlatform * Tool::GetLauncherPlatform ( ) const
inline

References mLaunchPlatPtr.

◆ GetLauncherWeapon()

WsfExplicitWeapon * Tool::GetLauncherWeapon ( ) const
inline

References mLaunchWpnPtr.

◆ GetManager()

ToolManager * Tool::GetManager ( ) const
protected

References ToolManager::Find(), and GetScenario().

Referenced by UnInitialize(), and Update().

◆ GetScenario()

◆ GetSimulation()

◆ GuidanceComputerPhaseChanged()

void Tool::GuidanceComputerPhaseChanged ( double aSimTime,
WsfGuidanceComputer * aComputerPtr )
virtual

Optional tool method called by WeaponObserver to pass on the GuidanceComputerPhaseChanged simulation observer event.

Reimplemented in OrbitalLaunchComputerGenerator.

Referenced by Clone().

◆ Initialize()

bool Tool::Initialize ( WsfSimulation & aSimulation)
virtual

In another typical WSF construct, this method initializes the object prior to run time. If the Initialization fails, the object will not be permitted to transition to the run mode. Derived classes must assure that they are initialized internally, as well as calling the base class Initialize method.

Returns
Boolean success value.

Reimplemented in AirToAirLaunchComputerGenerator, ATA_LaunchComputerGenerator, ATG_LAR_And_LC_Generator, BallisticLaunchComputerGenerator, BallisticMissileLaunchComputerGenerator, OrbitalLaunchComputerGenerator, and SAM_LaunchComputerGenerator.

References WsfSimulation::AddEvent(), WsfSimulation::AddPlatform(), WsfComponentList::RoleIterator< T >::AtEnd(), WsfObjectTypeList< T >::Clone(), WsfPlatformTypes::Get(), WsfWeaponEffectsTypes::Get(), WsfObject::GetNameId(), WsfSimulation::GetPlatformByName(), GetScenario(), WsfSimulation::GetSimTime(), mAlt, mHeadingRad, mInitialized, mLastUpdate, mLatDeg, mLaunchPlatformTypeId, mLaunchPlatPtr, mLaunchWpnPtr, mLonDeg, mObserver, mSimulationPtr, mWeaponEffectTypeId, mWeaponNameId, ResolveNames(), WsfLaunchComputer::SetComputerGenerationMode(), success, and UnInitialize().

Referenced by Clone(), AirToAirLaunchComputerGenerator::Initialize(), ATA_LaunchComputerGenerator::Initialize(), ATG_LAR_And_LC_Generator::Initialize(), BallisticLaunchComputerGenerator::Initialize(), BallisticMissileLaunchComputerGenerator::Initialize(), OrbitalLaunchComputerGenerator::Initialize(), and SAM_LaunchComputerGenerator::Initialize().

◆ IsDone()

bool Tool::IsDone ( ) const
inlineprotected

Return a flag to indicate that this Tool has completed its work.

References mDone.

◆ IsInitialized()

bool Tool::IsInitialized ( ) const
inline

References mInitialized.

◆ MoverBurnout()

void Tool::MoverBurnout ( double aSimTime,
WsfMover * aMoverPtr )
virtual

name Callbacks from WeaponObserver (lets the tool have access to simulation callbacks)

Optional tool method called by WeaponObserver to pass on the MoverBurnout simulation observer event.

Reimplemented in OrbitalLaunchComputerGenerator.

Referenced by Clone().

◆ operator=()

Tool & Tool::operator= ( const Tool & )
delete

References Tool().

◆ PlatformAdded()

void Tool::PlatformAdded ( double aSimTime,
WsfPlatform * aPlatformPtr )
virtual

Optional tool method called by WeaponObserver to pass on the PlatformAdded simulation observer event.

Reimplemented in BallisticLaunchComputerGenerator, and OrbitalLaunchComputerGenerator.

Referenced by Clone().

◆ ProcessInput()

◆ ResolveNames()

void Tool::ResolveNames ( )
protectedvirtual

Method called to determine what the output objects and file names are called.

Virtual method to resolve the output object name and output file names.

Reimplemented in ATA_LaunchComputerGenerator.

References mFileExtension, mOutputFileName, mOutputObjectName, mToolProduces, and WeaponPlatformTypeId().

Referenced by Initialize().

◆ UnInitialize()

void Tool::UnInitialize ( )
protected

If Initialize() fails, this method will de-register the Tool from active consideration within the main execution loop, allowing the simulation to complete when all other Tools (if any) are done.

References GetManager(), and ToolManager::UnRegister().

Referenced by AirToAirLaunchComputerGenerator::Initialize(), ATA_LaunchComputerGenerator::Initialize(), ATG_LAR_And_LC_Generator::Initialize(), BallisticLaunchComputerGenerator::Initialize(), SAM_LaunchComputerGenerator::Initialize(), and Initialize().

◆ Update()

◆ WeaponPlatformTypeId()

Member Data Documentation

◆ mAlt

◆ mDebug

bool Tool::mDebug
protected

Referenced by DebugEnabled(), ProcessInput(), Tool(), and Tool().

◆ mDone

◆ mFileExtension

std::string Tool::mFileExtension
protected

◆ mFrameStep

double Tool::mFrameStep
protected

Referenced by FrameStep(), ProcessInput(), Tool(), and Tool().

◆ mHeadingRad

◆ mInitialized

◆ mLastUpdate

◆ mLatDeg

◆ mLaunchPlatformTypeId

WsfStringId Tool::mLaunchPlatformTypeId
protected

◆ mLaunchPlatPtr

◆ mLaunchWpnPtr

◆ mLonDeg

◆ mNotifiedDone

bool Tool::mNotifiedDone
protected

Referenced by Tool(), Tool(), and Update().

◆ mObserver

◆ mOutputFileName

◆ mOutputObjectName

◆ mScenarioPtr

WsfScenario* Tool::mScenarioPtr
protected

Referenced by GetScenario(), Tool(), and Tool().

◆ mSimulationPtr

WsfSimulation* Tool::mSimulationPtr
protected

Referenced by GetSimulation(), Initialize(), Tool(), and Tool().

◆ mTargetPlatformTypeId

◆ mTerminateOnLaunchFailure

◆ mToolProduces

◆ mWeaponEffectTypeId

◆ mWeaponNameId

WsfStringId Tool::mWeaponNameId
protected

Referenced by Initialize(), ProcessInput(), Tool(), and Tool().


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