|
WSF
|
This is the perceive module of the SA Processor. More...
#include <WsfSA_Perceive.hpp>


Public Types | |
| enum | RecipientType { cCOMMANDER = 1 , cPEERS = 2 , cSUBORDINATES = 4 , cALLCOMMANDERS = 8 , cALLSUBORDINATES = 16 } |
Public Member Functions | |
| WsfSA_Perceive (WsfSA_Processor *aSA_ProcPtr, WsfSA_Processor::PerceiveData *aDataPtr) | |
| WsfSA_Perceive & | operator= (const WsfSA_Perceive &)=delete |
| ~WsfSA_Perceive () | |
| void | AddExtraCognitiveLoading (double aTimeDelay) |
| Add a cognitive loading time (delay). | |
| void | MarkAssetAsImportant (WsfPlatform &aAsset) |
| Mark an asset as important. | |
| void | MarkAssetAsImportant (size_t aIndex) |
| Mark an asset as important. | |
| void | MarkAssetTypeAsImportant (const std::string &aType) |
| Mark an asset type as important. | |
| void | MarkAssetTypeAsUnimportant (const std::string &aType) |
| Mark an asset type as unimportant. | |
| void | MarkAssetAsUnimportant (WsfPlatform &aAsset) |
| Mark an asset as unimportant. | |
| void | MarkAssetAsUnimportant (size_t aIndex) |
| Mark an asset as unimportant. | |
| void | MarkThreatAsImportant (WsfLocalTrack &aThreat) |
| Mark a threat as important. | |
| void | MarkThreatAsUnimportant (WsfLocalTrack &aThreat) |
| Mark a threat as unimportant. | |
| void | MarkThreatTypeAsImportant (const std::string &aType) |
| Mark a threat type as important. | |
| void | MarkThreatTypeAsUnimportant (const std::string &aType) |
| Mark a threat type as unimportant. | |
| int | MaxAssetLoad () |
| Return the max asset load the platform can handle. | |
| int | MaxThreatLoad () |
| Return the max threat load the platform can handle. | |
| const WsfSA_EntityPerception * | PerceivedAsset (size_t aPlatformIndex) const |
| Find an asset in the perceived asset list by platform index. | |
| const std::vector< WsfSA_EntityPerception * > & | PerceivedAssets (double aSimTime) |
| Return a reference to the list of perceived assets for the current platform at a given time. | |
| const std::vector< WsfSA_EntityPerception * > & | PerceivedAircraftAssets (double aSimTime) |
| Return a reference to the list of perceived aircraft assets for the current platform at a given time. | |
| const std::vector< WsfSA_EntityPerception * > & | PerceivedMissileAssets (double aSimTime) |
| Return a reference to the list of missile perceived assets for the current platform at a given time. | |
| const std::vector< WsfSA_EntityPerception * > & | PerceivedBogies (double aSimTime) |
| Return a reference to the list of perceived bogies for the current platform at a given time. | |
| const std::vector< WsfSA_EntityPerception * > & | PerceivedAircraftBogies (double aSimTime) |
| Return a reference to the list of perceived aircraft bogies for the current platform at a given time. | |
| const std::vector< WsfSA_EntityPerception * > & | PerceivedMissileBogies (double aSimTime) |
| Return a reference to the list of perceived missile bogies for the current platform at a given time. | |
| const std::vector< WsfSA_EntityPerception * > & | PerceivedBandits (double aSimTime) |
| Return a reference to the list of perceived missile bandits for the current platform at a given time. | |
| const std::vector< WsfSA_EntityPerception * > & | PerceivedAircraftBandits (double aSimTime) |
| Return a reference to the list of perceived aircraft bandits for the current platform at a given time. | |
| const std::vector< WsfSA_EntityPerception * > & | PerceivedMissileBandits (double aSimTime) |
| Return a reference to the list of perceived missile bandits for the current platform at a given time. | |
| WsfLocalTrack * | PerceivedThreat (WsfStringId aTargetNameId) |
| Find a threat in the perceived threat list by string id. | |
| WsfLocalTrack * | PerceivedThreat (const WsfTrackId &aTrackId) |
| Find a threat in the perceived threat list by track id. | |
| bool | PossibleEnemy (WsfLocalTrack *aTrackPtr) |
| Return true if a track is a possible enemy, false otherwise. | |
| bool | ProcessInput (UtInput &aInput) |
| Process input from script. | |
| bool | ProcessMessage (double aSimTime, const WsfMessage &aMessage) |
| Process a WsfMessage. | |
| void | Initialize (double aSimTime) |
| Performs initialization during creation. | |
| void | SetMaxAssetLoad (int aLoad) |
| Set the max asset load. | |
| void | ResetMaxAssetLoad () |
| Set the max asset load to the value provided during initialization (default is -1 where not provided). | |
| bool | AssetScore (double aSimTime, WsfSA_EntityPerception *aEntityPtr, double &aScore) |
| Score an asset. | |
| bool | EntityIsInAssetGroup (const WsfSA_EntityPerception *aEntity) const |
| bool | EntityIsInAssetGroup (size_t aEntityIndex) const |
| void | PurgeOldAssets (double aSimTime) |
| WsfSA_EntityPerception * | NearestAsset (double aSimTime) |
| Return the nearest asset entity perception (WsfSA_EntityPerception). | |
| WsfSA_EntityPerception * | NearestAircraftAsset (double aSimTime) |
| Return the nearest aircraft asset entity perception (WsfSA_EntityPerception). | |
| WsfSA_EntityPerception * | NearestMissileAsset (double aSimTime) |
| Return the nearest missile asset entity perception (WsfSA_EntityPerception). | |
| void | SetMaxThreatLoad (int aLoad) |
| Set the max asset load. | |
| void | ResetMaxThreatLoad () |
| Set the max threat load to the value provided during initialization (default is -1 where not provided). | |
| bool | ThreatScore (double aSimTime, WsfLocalTrack *aThreatPtr, bool aIsMissile, double &aScore) |
| Score a threat. | |
| double | DefaultThreatScore (double aSimTime, WsfSA_PerceivedItem *aThreatPtr) |
| If a threat scoring function isn't provided by script, this is what's used instead. | |
| WsfSA_EntityPerception * | NearestBogie () const |
| Return the nearest bogie entity perception (WsfSA_EntityPerception). | |
| WsfSA_EntityPerception * | NearestAircraftBogie () const |
| Return the nearest aircraft bogie entity perception (WsfSA_EntityPerception). | |
| WsfSA_EntityPerception * | NearestMissileBogie () const |
| Return the nearest missile bogie entity perception (WsfSA_EntityPerception). | |
| WsfSA_EntityPerception * | NearestBandit () const |
| Return the nearest bandit entity perception (WsfSA_EntityPerception). | |
| WsfSA_EntityPerception * | NearestAircraftBandit () const |
| Return the nearest aircraft bandit entity perception (WsfSA_EntityPerception). | |
| WsfSA_EntityPerception * | NearestMissileBandit () const |
| Return the nearest missile bandit entity perception (WsfSA_EntityPerception). | |
| std::set< WsfPlatform * > | TruthAssets () |
| Return a set of assets based on mTruthPerceptionMask. | |
| std::string | SelectedWeaponName () const |
| These functions provide data related to the selected weapon ------------------------------------—. | |
| const WsfExplicitWeapon * | SelectedWeapon () const |
| Returns a pointer to the selected weapon. | |
| int | QuantityOfSelectedWeapon () const |
| Returns the available quantity of the selected weapon. | |
| bool | SetSelectedWeapon (const std::string &aWeaponName) |
| Returns true if the weapon selection was successful, else false. | |
| const std::vector< WsfExplicitWeapon * > | GetWeaponList () const |
| Returns the current list of weapons. | |
| void | SetMasterArm (bool aArmed) |
| Sets the master arm to the specified condition. | |
| bool | GetMasterArm () const |
| Returns true if the master arm is active (armed), else false. | |
| bool | MasterWarningActive () const |
| Returns true if the master warning is active, else false. | |
| bool | MasterCautionActive () const |
| Returns true if the master warning is active, else false. | |
| bool | WeaponBayDoorsAreOpen () const |
| Returns true if the weapon bay doors are open, else false. | |
| bool | ShootCueActive () const |
| Returns true if the shoot cue is active, else false. | |
| bool | ShootCueBlinking () const |
| Returns true if the shoot cue is blinking, else false. | |
| bool | JammingDetected () const |
| Returns true if radar jamming is detected by local radar sensors, else false. | |
| void | SetMasterWarningActive (bool aActive) |
| Sets the master warning to the specified condition. | |
| void | SetMasterCautionActive (bool aActive) |
| Sets the master caution to the specified condition. | |
| void | SetWeaponBayDoorsAreOpen (bool aOpen) |
| Sets the weapon bay doors to the specified condition. | |
| void | SetShootCueActive (bool aActive) |
| Sets the shoot cue to the specified condition. | |
| void | SetShootCueBlinking (bool aBlinking) |
| Sets the shoot cue blinking to the specified condition. | |
| void | SetJammingDetected (bool aJammingDetected) |
| Sets the jamming detected flag to the specified condition. | |
| bool | EngagedTargetValid () const |
| These functions provide data related to the primary target being engaged. | |
| WsfSA_Processor::SA_EngagedTarget | GetEngagedTarget () const |
| Returns an EngagedTarget struct for the primary engaged target. | |
| void | SetEngagedTarget (const WsfSA_Processor::SA_EngagedTarget &aEngagedTarget) |
| Sets the engaged target using the specified engaged target data. | |
| int | QuantityOfChaff () const |
| These functions provide data related to expendables. | |
| int | QuantityOfFlares () const |
| Returns the available quantity of the flare cartridges. | |
| int | QuantityOfDecoys () const |
| Returns the available quantity of the expendable decoys. | |
| bool | DispenseChaff (double aSimTime) |
| Returns true if there was chaff available and dispenses a deployment of chaff. | |
| bool | DispenseFlare (double aSimTime) |
| Returns true if there was a flare available and dispenses a deployment of flare(s). | |
| bool | DispenseDecoy (double aSimTime) |
| Returns true if there was a decoy available and dispenses a single decoy. | |
| bool | RenameGroup (WsfSA_Group *aGroup, const std::string &aName) |
| This allows a group to be renamed. | |
| WsfSA_Group * | CreateGroup (const std::list< WsfSA_EntityPerception * > &aElements, bool aProtect=false) |
| Creates a new group and inserts all entities from the array argument into it. | |
| bool | DisbandGroup (WsfSA_Group *aGroup, bool aProtect=false) |
| Disbands the group. | |
| WsfSA_Group * | MergeGroups (const std::list< WsfSA_Group * > &aGroups, bool aProtect=false) |
| Merges the groups. | |
| std::pair< WsfSA_Group *, WsfSA_Group * > | SplitGroup (WsfSA_Group *aGroup, int aNumElements, int aCriterion, bool aProtect=false) |
| Splits a group according to the splitCriteria enumeration. | |
| bool | TransferEntity (WsfSA_EntityPerception *aEntity, WsfSA_Group *aGroup, bool aProtect=false) |
| Transfers the entity into the group. | |
| bool | RemoveEntityFromGroup (WsfSA_EntityPerception *aEntity, bool aProtect=false) |
| Removes an entity from a group, but does not delete the entity. | |
| bool | SetFocus (WsfSA_Group *aGroup, bool aFocus, bool aProtect=false) |
| Sets a group to focused or unfocused depending on whether focus is true or false, respectively. | |
| void | SetImportant (WsfSA_PerceivedItem *aItem, bool aIsImportant) |
| Sets an entity as important, meaning it should be favored over other entities. | |
| bool | GetFocus (WsfSA_Group *aGroup) |
| Gets whenther or not a group is focused. | |
| bool | GetImportant (WsfSA_PerceivedItem *aItem) |
| Gets the importance of a PI as a boolean. | |
Protected Member Functions | |
| WsfSA_Perceive (const WsfSA_Perceive &aSrc) | |
| WsfSA_EntityPerception * | NearestEntity (const std::vector< WsfSA_EntityPerception * > &aDataList) const |
| Return the nearest bogie/bandit entity perception (WsfSA_EntityPerception) in the list. | |
| bool | Important (WsfLocalTrack *aThreatPtr) |
| Return true if the threat given is important, false otherwise. | |
| bool | Important (WsfPlatform *aAssetPtr) |
| Return true if the asset given is important, false otherwise. | |
| bool | Important (size_t aPlatformIndex) |
| Return true if the platform given is important, false otherwise. | |
| bool | Unimportant (WsfLocalTrack *aThreatPtr) |
| Return true if the threat given is unimportant, false otherwise. | |
| bool | Unimportant (WsfPlatform *aAssetPtr) |
| Return true if the asset given is unimportant, false otherwise. | |
| bool | Unimportant (size_t aPlatformIndex) |
| Return true if the platform given is unimportant, false otherwise. | |
| void | LocalTrackDropped (double aSimTime, const WsfLocalTrack *aLocalTrackPtr) |
| Handle a track dropping. | |
| double | TryUpdateStatus (double aSimTime) |
| Attempt to update status at a sim time, and return an appropriate time for the next event update. | |
| double | TryUpdateAssets (double aSimTime) |
| Attempt to update assets at a sim time, and return an appropriate time for the next event update. | |
| double | TryUpdatePerceivedItemData (double aSimTime) |
| Attempt to update the data for perceived items, which include bogies and bandits as well as groups. | |
| double | TryUpdatePerceivedItemCalculation (double aSimTime) |
| Attempt to update the perceived items calculations, which include bogies and bandits as well as groups, at a sim time, and return an appropriate time for the next event update. | |
| double | UpdateStatus (double aSimTime) |
| If this platform has external links, send a status message to those links. | |
| void | UpdateAssets (double aSimTime) |
| Update assets. | |
| void | UpdateAssetsData (double aSimTime) |
| Update assets. | |
| void | UpdateGroupsData (double aSimTime) |
| Update group data at a sim time, and return an appropriate time for the next event update. | |
| void | UpdatePerceivedItemsCalculation (double aSimTime) |
| Update the perceived items calculations, which include bogies and bandits as well as groups. | |
| void | RemoveAnyInvalidEntitiesInBogiesAndBandits () |
| Remove any invalid (perceived index not valid) in the bogies and bandits lists. | |
| void | Prune (double aSimTime) |
| Unfocus or remove groups in order to stay under the PI limit. | |
| void | FindExpenableCountermeasures () |
| This will attempt to find expendable countermeasures for chaff, flare, and decoys. | |
| void | FindWeapons () |
| This will attempt to find weapons, excluding countermeasure "weapons". | |
| void | CreateAssetsList (double aSimTime, std::list< WsfSA_EntityPerception * > &aTempAssetsList, bool aUnlimitedAssets) |
| This creates the mPerceivedAssets list, using the specified temporary asset list and flag. | |
| void | CreateBanditsList (double aSimTime, std::list< WsfSA_EntityPerception * > &aTrackedEntitiesList, bool aUnlimitedBandits) |
| This creates the mPerceivedBandits list, using the specified temporary tracked entities list and flag. | |
| void | CreateBogiesList (double aSimTime, std::list< WsfSA_EntityPerception * > &aTrackedEntitiesList, bool aUnlimitedBogies) |
| This creates the mPerceivedBogies list, using the specified temporary tracked entities list and flag. | |
| double | GetThreatScore (double aSimTime, WsfSA_EntityPerception *aThreatPtr, bool aIsMissile) |
| Score a threat. | |
| void | CreateAssetSublists () |
| This creates sublists for aircraft and missiles for assets. | |
| void | CreateSublists () |
| This creates sublists for aircraft and missiles for bogies and bandits. | |
| void | RemoveExpiredCoastingPerceptions (std::vector< WsfSA_EntityPerception * > &aPerceptionList, double aCoastTime, double aSimTime) |
| This function removes any Wsf_EntityPerceptions from the given list that have outlived the given coast time. | |
| void | SetOldPerceptionsAsCoasting (const std::vector< WsfSA_EntityPerception * > &aPerceptionList, double aSimTime) |
| void | UpdateCoastingPerceptions (const std::vector< WsfSA_EntityPerception * > &aPerceptionList, const std::list< WsfSA_EntityPerception * > &aNewPerceptionList, double aSimTime) |
| This function sets any currently perceived entities to coasting if they aren't present in the new data. | |
| void | AddOrUpdatePerception (std::vector< WsfSA_EntityPerception * > &aPerceptionList, WsfSA_EntityPerception &aPerception, double aSimTime) |
| Either adds an entity perception to the given vector or updates a matching perception in the list. | |
| void | JoinInitialGroups (std::vector< WsfSA_EntityPerception * > &aPerceptionList, std::list< WsfSA_Group * > &aGroupList, double aSimTime) |
| All entities in aPerceptionList that do not have a parent group will either join an existing one, or form a degenerate group. | |
| void | DropEntity (WsfSA_EntityPerception *aOldEntity) |
| Helper function for Prune() which drops an entity from current perception. | |
| void | DeleteLater (WsfSA_EntityPerception *aOldEntity) |
| Prepare an entity for later deletion. | |
| void | DeferredDelete () |
| Deletes all entities that have been passed to DeleteLater(). | |
Friends | |
| class | WsfSA_Processor |
| class | WsfSA_ProcessorUpdateEvent |
This is the perceive module of the SA Processor.
| WsfSA_Perceive::WsfSA_Perceive | ( | WsfSA_Processor * | aSA_ProcPtr, |
| WsfSA_Processor::PerceiveData * | aDataPtr ) |
References WsfSA_Module::WsfSA_Module(), and WsfSA_Processor.
Referenced by operator=(), and WsfSA_Perceive().
| WsfSA_Perceive::~WsfSA_Perceive | ( | ) |
References DeferredDelete().
|
protected |
References WsfSA_Module::WsfSA_Module(), and WsfSA_Perceive().
| void WsfSA_Perceive::AddExtraCognitiveLoading | ( | double | aTimeDelay | ) |
Add a cognitive loading time (delay).
| aTimeDelay | time to delay |
References WsfSA_Module::mDataPtr.
Referenced by operator=().
|
protected |
Either adds an entity perception to the given vector or updates a matching perception in the list.
| aPerceptionList | A vector containing entity perceptions. |
| aPerception | The entity perception to add (or the perception containing data to update an existing perception with). |
| aSimTime | The current simulation time. |
References WsfSA_EntityPerception::IsSame(), and WsfSA_EntityPerception::SetLastUpdateTime().
Referenced by CreateAssetsList(), CreateBanditsList(), and CreateBogiesList().
| bool WsfSA_Perceive::AssetScore | ( | double | aSimTime, |
| WsfSA_EntityPerception * | aEntityPtr, | ||
| double & | aScore ) |
Score an asset.
Return true if scored, false otherwise
| aSimTime | time at which to calc score |
| aEntityPtr | asset to score |
| aScore | reference variable to hold the score |
References WsfScriptContext::ExecuteScript(), WsfObject::GetName(), WsfSA_Module::GetPlatform(), WsfSA_Module::GetScriptContext(), and WsfSA_Module::mDataPtr.
Referenced by CreateAssetsList().
|
protected |
This creates the mPerceivedAssets list, using the specified temporary asset list and flag.
| aSimTime | time at which to calc score |
| aTempAssetsList | list of temporary assets to evaluate |
| aUnlimitedAssets | true if there is no limit to the number of assets in mPerceivedAssets |
References AddOrUpdatePerception(), AssetScore(), WsfSA_PerceivedItem::CalcRangeForPlatform(), WsfSA_PerceivedItem::CompareScoreHighGood(), WsfSA_PerceivedItem::CompareScoreLowGood(), WsfSA_EntityPerception::GetEntityPlatformIndex(), WsfPlatform::GetIndex(), WsfSA_EntityPerception::GetPerceivedIndex(), WsfSA_Module::GetPlatform(), WsfSimulation::GetPlatformByIndex(), WsfSA_Module::GetSAP(), WsfSA_Module::GetSimulation(), WsfSA_EntityPerception::GetTargetPlatformIndex(), Important(), WsfSA_Module::mDataPtr, platformPtr, SetOldPerceptionsAsCoasting(), WsfSA_PerceivedItem::SetSelectionScore(), and Unimportant().
Referenced by UpdateAssetsData().
|
protected |
This creates sublists for aircraft and missiles for assets.
References WsfSA_Module::mDataPtr.
Referenced by UpdateAssetsData().
|
protected |
This creates the mPerceivedBandits list, using the specified temporary tracked entities list and flag.
Note: CreateBanditsList should be called before calling CreateBogiesList.
| aSimTime | time when created |
| aTrackedEntitiesList | list of tracked entities to evaluate |
| aUnlimitedBandits | true if there is no limit to the number of assets in mPerceivedThreats |
References AddOrUpdatePerception(), WsfSA_PerceivedItem::BANDIT, WsfTrack::cIFF_FOE, WsfTrack::cIFF_FRIEND, WsfTrack::cIFF_NEUTRAL, WsfSA_PerceivedItem::CompareScoreHighGood(), WsfSA_PerceivedItem::FRIENDLY, WsfSA_EntityPerception::GetEntityPlatformIndex(), WsfSA_EntityPerception::GetIdAuxFoe(), WsfSA_EntityPerception::GetIdAuxFriend(), WsfSA_EntityPerception::GetIdAuxNeutral(), WsfSA_EntityPerception::GetIdIffFoe(), WsfSA_EntityPerception::GetIdIffFriend(), WsfSA_EntityPerception::GetIdIffNeutral(), WsfSA_EntityPerception::GetIdSideFoe(), WsfSA_EntityPerception::GetIdSideFriend(), WsfSA_EntityPerception::GetIdSideNeutral(), WsfSA_EntityPerception::GetIdTypeFoe(), WsfSA_EntityPerception::GetIdTypeFriend(), WsfSA_EntityPerception::GetIdTypeNeutral(), WsfTrack::GetIFF_Status(), WsfSA_EntityPerception::GetIsMissile(), WsfSimulation::GetPlatformByIndex(), WsfSA_Module::GetSAP(), WsfSA_PerceivedItem::GetSelectionScore(), WsfPlatform::GetSide(), WsfSA_Module::GetSimulation(), WsfTrack::GetTargetIndex(), GetThreatScore(), WsfSA_EntityPerception::GetTrackPtr(), WsfTrack::IFF_StatusValid(), WsfSA_PerceivedItem::IGNORED, WsfSA_PerceivedItem::IMPORTANT, Important(), WsfSA_Module::mDataPtr, WsfSA_PerceivedItem::NEUTRAL, WsfSA_EntityPerception::SetIdentification(), WsfSA_EntityPerception::SetIdIffFoe(), WsfSA_EntityPerception::SetIdIffFriend(), WsfSA_EntityPerception::SetIdIffNeutral(), WsfSA_EntityPerception::SetIdSideFoe(), WsfSA_EntityPerception::SetIdSideFriend(), WsfSA_EntityPerception::SetIdSideNeutral(), WsfSA_EntityPerception::SetIdTypeFoe(), WsfSA_EntityPerception::SetIdTypeFriend(), WsfSA_EntityPerception::SetIdTypeNeutral(), WsfSA_EntityPerception::SetImportance(), WsfSA_EntityPerception::SetIsMissile(), SetOldPerceptionsAsCoasting(), WsfSA_PerceivedItem::SetSelectionScore(), and Unimportant().
Referenced by UpdatePerceivedItemsCalculation().
|
protected |
This creates the mPerceivedBogies list, using the specified temporary tracked entities list and flag.
Note: CreateBogiesList should be called after calling CreateThreatsList.
| aSimTime | time when created |
| aTrackedEntitiesList | list of tracked entities to evaluate |
| aUnlimitedBogies | true if there is no limit to the number of assets in mPerceivedBogies |
References AddOrUpdatePerception(), WsfSA_PerceivedItem::CompareScoreHighGood(), EntityIsInAssetGroup(), WsfSA_EntityPerception::GetIsMissile(), WsfSA_EntityPerception::GetPerceivedIndex(), WsfSA_Module::GetPlatform(), WsfSA_PerceivedItem::GetSelectionScore(), GetThreatScore(), WsfSA_EntityPerception::GetTrackPtr(), Important(), WsfSA_Module::mDataPtr, SetOldPerceptionsAsCoasting(), WsfSA_PerceivedItem::SetSelectionScore(), and Unimportant().
Referenced by UpdatePerceivedItemsCalculation().
| WsfSA_Group * WsfSA_Perceive::CreateGroup | ( | const std::list< WsfSA_EntityPerception * > & | aElements, |
| bool | aProtect = false ) |
Creates a new group and inserts all entities from the array argument into it.
As an exception to the general approach, if an entity in the array is already in another group, it will be removed from that group, but that group will not be marked as protected.
| aElements | The list of entities that should be contained within this new group. |
| aProtect | If this function was called from script, then this should be set to true in order to protect the user's changes from being overridden by automatic merges or splits. Otherwise, it should be false. |
References WsfSA_GroupUtils::CalculateNumPIs(), WsfSA_GroupUtils::CreateGroup(), WsfSA_Module::GetPlatform(), and WsfSA_Module::mDataPtr.
|
protected |
This creates sublists for aircraft and missiles for bogies and bandits.
References WsfSA_Module::mDataPtr.
Referenced by UpdatePerceivedItemsCalculation().
| double WsfSA_Perceive::DefaultThreatScore | ( | double | aSimTime, |
| WsfSA_PerceivedItem * | aThreatPtr ) |
If a threat scoring function isn't provided by script, this is what's used instead.
| aSimTime | time when calculated |
| aThreatPtr | threat to score |
References WsfSA_PerceivedItem::CalcRangeForPlatform(), and WsfSA_Module::GetPlatform().
Referenced by GetThreatScore(), and Prune().
|
protected |
Deletes all entities that have been passed to DeleteLater().
Referenced by UpdatePerceivedItemsCalculation(), and ~WsfSA_Perceive().
|
protected |
Prepare an entity for later deletion.
This is used to allow a pointer to remain valid after an entity is no longer needed until all other references to it are gone.
| aOldEntity | The entity to be deleted. |
Referenced by DropEntity(), RemoveAnyInvalidEntitiesInBogiesAndBandits(), and RemoveExpiredCoastingPerceptions().
| bool WsfSA_Perceive::DisbandGroup | ( | WsfSA_Group * | aGroup, |
| bool | aProtect = false ) |
Disbands the group.
This does not delete the entities within that group. The group is deleted, so it should be considered invalid after successfully calling the function.
| aGroup | The group to disband. |
| aProtect | If this function was called from script, then this should be set to true in order to protect the user's changes from being overridden by automatic merges or splits. Otherwise, it should be false. |
References WsfSA_GroupUtils::CalculateNumPIs(), WsfSA_GroupUtils::DisbandGroup(), and WsfSA_Module::mDataPtr.
| bool WsfSA_Perceive::DispenseChaff | ( | double | aSimTime | ) |
Returns true if there was chaff available and dispenses a deployment of chaff.
References WsfSA_Module::mDataPtr, and QuantityOfChaff().
| bool WsfSA_Perceive::DispenseDecoy | ( | double | aSimTime | ) |
Returns true if there was a decoy available and dispenses a single decoy.
References WsfSA_Module::mDataPtr.
| bool WsfSA_Perceive::DispenseFlare | ( | double | aSimTime | ) |
Returns true if there was a flare available and dispenses a deployment of flare(s).
References WsfSA_Module::mDataPtr.
|
protected |
Helper function for Prune() which drops an entity from current perception.
In addition to deleting the entity, it removes it from all relevant entity lists.
| aOldEntity | The entity to be dropped. |
References WsfSA_PerceivedItem::BANDIT, WsfSA_PerceivedItem::BOGIE, DeleteLater(), WsfSA_PerceivedItem::FRIENDLY, WsfSA_EntityPerception::GetIdentification(), WsfSA_EntityPerception::IsSame(), and WsfSA_Module::mDataPtr.
Referenced by Prune().
|
inline |
These functions provide data related to the primary target being engaged.
Returns true if there is an engaged target
References WsfSA_Module::mDataPtr.
| bool WsfSA_Perceive::EntityIsInAssetGroup | ( | const WsfSA_EntityPerception * | aEntity | ) | const |
References WsfSA_EntityPerception::GetPerceivedIndex(), and WsfSA_Module::mDataPtr.
Referenced by CreateBogiesList(), and UpdatePerceivedItemsCalculation().
| bool WsfSA_Perceive::EntityIsInAssetGroup | ( | size_t | aEntityIndex | ) | const |
References WsfSA_Module::mDataPtr.
|
protected |
This will attempt to find expendable countermeasures for chaff, flare, and decoys.
References WsfComponentList::RoleIterator< T >::AtEnd(), WsfSA_Module::GetPlatform(), WsfObject::IsA_TypeOf(), and WsfSA_Module::mDataPtr.
Referenced by Initialize().
|
protected |
This will attempt to find weapons, excluding countermeasure "weapons".
References WsfComponentList::RoleIterator< T >::AtEnd(), WsfSA_Module::GetPlatform(), WsfObject::IsA_TypeOf(), and WsfSA_Module::mDataPtr.
Referenced by Initialize().
|
inline |
Returns an EngagedTarget struct for the primary engaged target.
References WsfSA_Module::mDataPtr.
| bool WsfSA_Perceive::GetFocus | ( | WsfSA_Group * | aGroup | ) |
Gets whenther or not a group is focused.
| aGroup | The group to query. |
References WsfSA_Group::GetFocus().
| bool WsfSA_Perceive::GetImportant | ( | WsfSA_PerceivedItem * | aItem | ) |
Gets the importance of a PI as a boolean.
| aItem | The PI to query. |
References WsfSA_PerceivedItem::GetImportance(), and WsfSA_PerceivedItem::IMPORTANT.
| bool WsfSA_Perceive::GetMasterArm | ( | ) | const |
Returns true if the master arm is active (armed), else false.
References WsfSA_Module::mDataPtr.
|
protected |
Score a threat.
Return the score. Prefer a user-defined scoring method, but failing that, use the default.
| aSimTime | time when calculated |
| aThreatPtr | threat to score |
| aIsMissile | indicates if track is perceived as a missile |
References DefaultThreatScore(), WsfSA_EntityPerception::GetTrackPtr(), and ThreatScore().
Referenced by CreateBanditsList(), and CreateBogiesList().
|
inline |
Returns the current list of weapons.
References WsfSA_Module::mDataPtr.
|
protected |
Return true if the platform given is important, false otherwise.
| aPlatformIndex | index of platform to evaluate |
References WsfSA_Module::GetSimulation(), and Important().
|
protected |
Return true if the threat given is important, false otherwise.
| aThreatPtr | threat to evaluate |
References WsfTrack::GetTargetIndex(), WsfTrack::GetTargetType(), and WsfSA_Module::mDataPtr.
Referenced by CreateAssetsList(), CreateBanditsList(), CreateBogiesList(), Important(), and Prune().
|
protected |
Return true if the asset given is important, false otherwise.
| aAssetPtr | asset to evaluate |
References WsfPlatform::GetIndex(), WsfObject::GetType(), and WsfSA_Module::mDataPtr.
| void WsfSA_Perceive::Initialize | ( | double | aSimTime | ) |
Performs initialization during creation.
This should be called from the SA Processor's Initialize() function.
| aSimTime | sim time when processing |
References FindExpenableCountermeasures(), WsfScriptContext::FindScript(), FindWeapons(), WsfScriptContext::GetClass(), WsfSA_Module::GetPlatform(), WsfSA_Module::GetSAP(), WsfScriptProcessor::GetScriptContext(), WsfSA_Module::mDataPtr, ok, and WsfScriptContext::ValidateScript().
| bool WsfSA_Perceive::JammingDetected | ( | ) | const |
Returns true if radar jamming is detected by local radar sensors, else false.
References WsfSA_Module::mDataPtr.
|
protected |
All entities in aPerceptionList that do not have a parent group will either join an existing one, or form a degenerate group.
| aPerceptionList | A vector containing entity perceptions. |
| aGroupList | A list of possible groups that perceptions can join. |
| aSimTime | The current simulation time. |
Referenced by UpdatePerceivedItemsCalculation().
|
protected |
Handle a track dropping.
| aSimTime | sim time at which track dropped |
| aLocalTrackPtr | pointer to the dropped track |
References WsfTrack::GetTrackId(), and WsfSA_Module::mDataPtr.
| void WsfSA_Perceive::MarkAssetAsImportant | ( | size_t | aIndex | ) |
Mark an asset as important.
| aIndex | index of the platform to mark as important |
References WsfSA_Module::mDataPtr.
| void WsfSA_Perceive::MarkAssetAsImportant | ( | WsfPlatform & | aAsset | ) |
Mark an asset as important.
| aAsset | platform to mark as important |
References WsfPlatform::GetIndex(), and MarkAssetAsImportant().
Referenced by MarkAssetAsImportant(), and operator=().
| void WsfSA_Perceive::MarkAssetAsUnimportant | ( | size_t | aIndex | ) |
Mark an asset as unimportant.
| aIndex | index of the platform to mark as unimportant |
References WsfSA_Module::mDataPtr.
| void WsfSA_Perceive::MarkAssetAsUnimportant | ( | WsfPlatform & | aAsset | ) |
Mark an asset as unimportant.
| aAsset | platform to mark as unimportant |
References WsfPlatform::GetIndex(), and MarkAssetAsUnimportant().
Referenced by MarkAssetAsUnimportant(), and operator=().
| void WsfSA_Perceive::MarkAssetTypeAsImportant | ( | const std::string & | aType | ) |
Mark an asset type as important.
| aType | type to mark as important |
References WsfSA_Module::mDataPtr.
Referenced by operator=().
| void WsfSA_Perceive::MarkAssetTypeAsUnimportant | ( | const std::string & | aType | ) |
Mark an asset type as unimportant.
| aType | type to mark as unimportant |
References WsfSA_Module::mDataPtr.
Referenced by operator=().
| void WsfSA_Perceive::MarkThreatAsImportant | ( | WsfLocalTrack & | aThreat | ) |
Mark a threat as important.
| aThreat | track to mark as important |
References WsfTrack::GetTargetIndex(), and WsfSA_Module::mDataPtr.
Referenced by operator=().
| void WsfSA_Perceive::MarkThreatAsUnimportant | ( | WsfLocalTrack & | aThreat | ) |
Mark a threat as unimportant.
| aThreat | track to mark as unimportant |
References WsfTrack::GetTargetIndex(), and WsfSA_Module::mDataPtr.
Referenced by operator=().
| void WsfSA_Perceive::MarkThreatTypeAsImportant | ( | const std::string & | aType | ) |
Mark a threat type as important.
| aType | type to mark as important |
References WsfSA_Module::mDataPtr.
Referenced by operator=().
| void WsfSA_Perceive::MarkThreatTypeAsUnimportant | ( | const std::string & | aType | ) |
Mark a threat type as unimportant.
| aType | type to mark as unimportant |
References WsfSA_Module::mDataPtr.
Referenced by operator=().
| bool WsfSA_Perceive::MasterCautionActive | ( | ) | const |
Returns true if the master warning is active, else false.
References WsfSA_Module::mDataPtr.
| bool WsfSA_Perceive::MasterWarningActive | ( | ) | const |
Returns true if the master warning is active, else false.
References WsfSA_Module::mDataPtr.
|
inline |
Return the max asset load the platform can handle.
References WsfSA_Module::mDataPtr.
|
inline |
Return the max threat load the platform can handle.
References WsfSA_Module::mDataPtr.
| WsfSA_Group * WsfSA_Perceive::MergeGroups | ( | const std::list< WsfSA_Group * > & | aGroups, |
| bool | aProtect = false ) |
Merges the groups.
All groups are deleted, and a new group is created, so the original groups should be considered invalid after successfully calling this function.
| aGroups | A list of all of the groups which will be merged. The group pointers in this list will be invalid after this function successfuly completes. |
| aProtect | If this function was called from script, then this should be set to true in order to protect the user's changes from being overridden by automatic merges or splits. Otherwise, it should be false. |
References WsfSA_Module::GetPlatform(), WsfSA_Module::mDataPtr, and WsfSA_GroupUtils::MergeGroups().
| WsfSA_EntityPerception * WsfSA_Perceive::NearestAircraftAsset | ( | double | aSimTime | ) |
Return the nearest aircraft asset entity perception (WsfSA_EntityPerception).
If no such entity exists, return nullptr.
| aSimTime | time at which to get entity |
References WsfSA_Module::mDataPtr, and NearestEntity().
| WsfSA_EntityPerception * WsfSA_Perceive::NearestAircraftBandit | ( | ) | const |
Return the nearest aircraft bandit entity perception (WsfSA_EntityPerception).
If no such entity exists, return nullptr.
References WsfSA_Module::mDataPtr, and NearestEntity().
| WsfSA_EntityPerception * WsfSA_Perceive::NearestAircraftBogie | ( | ) | const |
Return the nearest aircraft bogie entity perception (WsfSA_EntityPerception).
If no such entity exists, return nullptr.
References WsfSA_Module::mDataPtr, and NearestEntity().
| WsfSA_EntityPerception * WsfSA_Perceive::NearestAsset | ( | double | aSimTime | ) |
Return the nearest asset entity perception (WsfSA_EntityPerception).
If no such entity exists, return nullptr.
| aSimTime | time at which to get entity |
References WsfSA_Module::mDataPtr, and NearestEntity().
| WsfSA_EntityPerception * WsfSA_Perceive::NearestBandit | ( | ) | const |
Return the nearest bandit entity perception (WsfSA_EntityPerception).
If no such entity exists, return nullptr.
References WsfSA_Module::mDataPtr, and NearestEntity().
| WsfSA_EntityPerception * WsfSA_Perceive::NearestBogie | ( | ) | const |
Return the nearest bogie entity perception (WsfSA_EntityPerception).
If no such entity exists, return nullptr.
References WsfSA_Module::mDataPtr, and NearestEntity().
|
protected |
Return the nearest bogie/bandit entity perception (WsfSA_EntityPerception) in the list.
If no such entity exists, return nullptr.
References WsfSA_Module::GetPlatform().
Referenced by NearestAircraftAsset(), NearestAircraftBandit(), NearestAircraftBogie(), NearestAsset(), NearestBandit(), NearestBogie(), NearestMissileAsset(), NearestMissileBandit(), and NearestMissileBogie().
| WsfSA_EntityPerception * WsfSA_Perceive::NearestMissileAsset | ( | double | aSimTime | ) |
Return the nearest missile asset entity perception (WsfSA_EntityPerception).
If no such entity exists, return nullptr.
| aSimTime | time at which to get entity |
References WsfSA_Module::mDataPtr, and NearestEntity().
| WsfSA_EntityPerception * WsfSA_Perceive::NearestMissileBandit | ( | ) | const |
Return the nearest missile bandit entity perception (WsfSA_EntityPerception).
If no such entity exists, return nullptr.
References WsfSA_Module::mDataPtr, and NearestEntity().
| WsfSA_EntityPerception * WsfSA_Perceive::NearestMissileBogie | ( | ) | const |
Return the nearest missile bogie entity perception (WsfSA_EntityPerception).
If no such entity exists, return nullptr.
References WsfSA_Module::mDataPtr, and NearestEntity().
|
delete |
| const std::vector< WsfSA_EntityPerception * > & WsfSA_Perceive::PerceivedAircraftAssets | ( | double | aSimTime | ) |
Return a reference to the list of perceived aircraft assets for the current platform at a given time.
| aSimTime | sim time at which to get list of perceived assets |
References WsfSA_Processor::cASSETS_DATA, WsfSA_Module::GetSAP(), WsfSA_Module::mDataPtr, and UpdateAssets().
| const std::vector< WsfSA_EntityPerception * > & WsfSA_Perceive::PerceivedAircraftBandits | ( | double | aSimTime | ) |
Return a reference to the list of perceived aircraft bandits for the current platform at a given time.
| aSimTime | sim time at which to get list of perceived aircraft bandits |
References WsfSA_Module::mDataPtr.
| const std::vector< WsfSA_EntityPerception * > & WsfSA_Perceive::PerceivedAircraftBogies | ( | double | aSimTime | ) |
Return a reference to the list of perceived aircraft bogies for the current platform at a given time.
| aSimTime | sim time at which to get list of perceived aircraft bogies |
References WsfSA_Module::mDataPtr.
| const WsfSA_EntityPerception * WsfSA_Perceive::PerceivedAsset | ( | size_t | aPlatformIndex | ) | const |
Find an asset in the perceived asset list by platform index.
If the asset isn't found, return nullptr.
| aPlatformIndex | index of the platform asset |
References WsfSA_Module::mDataPtr.
| const std::vector< WsfSA_EntityPerception * > & WsfSA_Perceive::PerceivedAssets | ( | double | aSimTime | ) |
Return a reference to the list of perceived assets for the current platform at a given time.
| aSimTime | sim time at which to get list of perceived assets |
References WsfSA_Processor::cASSETS_DATA, WsfSA_Module::GetSAP(), WsfSA_Module::mDataPtr, and UpdateAssets().
| const std::vector< WsfSA_EntityPerception * > & WsfSA_Perceive::PerceivedBandits | ( | double | aSimTime | ) |
Return a reference to the list of perceived missile bandits for the current platform at a given time.
| aSimTime | sim time at which to get list of perceived bandits |
References WsfSA_Module::mDataPtr.
| const std::vector< WsfSA_EntityPerception * > & WsfSA_Perceive::PerceivedBogies | ( | double | aSimTime | ) |
Return a reference to the list of perceived bogies for the current platform at a given time.
| aSimTime | sim time at which to get list of perceived bogies |
References WsfSA_Module::mDataPtr.
| const std::vector< WsfSA_EntityPerception * > & WsfSA_Perceive::PerceivedMissileAssets | ( | double | aSimTime | ) |
Return a reference to the list of missile perceived assets for the current platform at a given time.
| aSimTime | sim time at which to get list of perceived assets |
References WsfSA_Processor::cASSETS_DATA, WsfSA_Module::GetSAP(), WsfSA_Module::mDataPtr, and UpdateAssets().
| const std::vector< WsfSA_EntityPerception * > & WsfSA_Perceive::PerceivedMissileBandits | ( | double | aSimTime | ) |
Return a reference to the list of perceived missile bandits for the current platform at a given time.
| aSimTime | sim time at which to get list of perceived missile bandits |
References WsfSA_Module::mDataPtr.
| const std::vector< WsfSA_EntityPerception * > & WsfSA_Perceive::PerceivedMissileBogies | ( | double | aSimTime | ) |
Return a reference to the list of perceived missile bogies for the current platform at a given time.
| aSimTime | sim time at which to get list of perceived missile bogies |
References WsfSA_Module::mDataPtr.
| WsfLocalTrack * WsfSA_Perceive::PerceivedThreat | ( | const WsfTrackId & | aTrackId | ) |
Find a threat in the perceived threat list by track id.
If the threat isn't found, return nullptr.
| aTrackId | track id of the threat |
References WsfSA_Module::mDataPtr.
| WsfLocalTrack * WsfSA_Perceive::PerceivedThreat | ( | WsfStringId | aTargetNameId | ) |
Find a threat in the perceived threat list by string id.
If the threat isn't found, return nullptr.
| aTargetNameId | string id of the threat |
References WsfSA_Module::mDataPtr.
| bool WsfSA_Perceive::PossibleEnemy | ( | WsfLocalTrack * | aTrackPtr | ) |
Return true if a track is a possible enemy, false otherwise.
| aTrackPtr | track to check |
References WsfTrack::cIFF_FOE, WsfTrack::cIFF_FRIEND, WsfTrack::cIFF_NEUTRAL, WsfTrack::GetIFF_Status(), WsfSA_Module::GetSAP(), and WsfTrack::IFF_StatusValid().
| bool WsfSA_Perceive::ProcessInput | ( | UtInput & | aInput | ) |
Process input from script.
| aInput | input to parse |
References cALLCOMMANDERS, cALLSUBORDINATES, cCOMMANDER, cPEERS, cSUBORDINATES, WsfSA_Module::GetSAP(), WsfSA_Module::mDataPtr, WsfSA_Processor::STATUS_MESSAGES, and WsfSA_Processor::TRUTH.
| bool WsfSA_Perceive::ProcessMessage | ( | double | aSimTime, |
| const WsfMessage & | aMessage ) |
Process a WsfMessage.
| aSimTime | sim time when processing |
| aMessage | message to handle |
References WsfSA_EntityPerception::Clone(), WsfSA_EntityMessage::GetEntity(), WsfSA_EntityPerception::GetEntityPlatformIndex(), WsfScriptProcessor::GetMessageHandler(), WsfSA_Module::GetPlatform(), WsfSimulation::GetPlatformByIndex(), WsfSA_Module::GetSAP(), WsfSA_Module::GetSimulation(), WsfMessage::GetType(), WsfSA_EntityMessage::GetTypeId(), WsfSA_Module::mDataPtr, WsfScriptMessageHandler::ProcessMessage(), PurgeOldAssets(), and WsfSA_EntityPerception::Time().
|
protected |
Unfocus or remove groups in order to stay under the PI limit.
If PIs are unlimited, then immediately return.
| aSimTime | Sim time at which to prune. |
References WsfSA_PerceivedItem::CompareScoreLowGood(), DefaultThreatScore(), DropEntity(), WsfSA_PerceivedItem::ENTITY, WsfScriptContext::ExecuteScript(), WsfObject::GetName(), WsfSA_Module::GetPlatform(), WsfSA_Module::GetSAP(), WsfSA_Module::GetScriptContext(), WsfSA_PerceivedItem::IMPORTANT, Important(), WsfSA_Module::mDataPtr, PI, WsfSA_GroupUtils::Prune(), and WsfSA_Group::SetFocus().
Referenced by UpdatePerceivedItemsCalculation().
| void WsfSA_Perceive::PurgeOldAssets | ( | double | aSimTime | ) |
References WsfSA_Processor::GetAssetDataPurgeLifetime(), WsfSA_Module::GetSAP(), WsfSA_Module::mDataPtr, and WsfSA_EntityPerception::Time().
Referenced by ProcessMessage(), and UpdateAssetsData().
| int WsfSA_Perceive::QuantityOfChaff | ( | ) | const |
These functions provide data related to expendables.
Returns the available quantity of the chaff cartridges
References WsfSA_Module::mDataPtr.
Referenced by DispenseChaff().
| int WsfSA_Perceive::QuantityOfDecoys | ( | ) | const |
Returns the available quantity of the expendable decoys.
References WsfSA_Module::mDataPtr.
| int WsfSA_Perceive::QuantityOfFlares | ( | ) | const |
Returns the available quantity of the flare cartridges.
References WsfSA_Module::mDataPtr.
| int WsfSA_Perceive::QuantityOfSelectedWeapon | ( | ) | const |
Returns the available quantity of the selected weapon.
References WsfSA_Module::mDataPtr.
|
protected |
Remove any invalid (perceived index not valid) in the bogies and bandits lists.
References DeleteLater(), WsfSA_EntityPerception::GetPerceivedIndex(), and WsfSA_Module::mDataPtr.
Referenced by UpdatePerceivedItemsCalculation().
| bool WsfSA_Perceive::RemoveEntityFromGroup | ( | WsfSA_EntityPerception * | aEntity, |
| bool | aProtect = false ) |
Removes an entity from a group, but does not delete the entity.
| aEntity | The entity to remove from its group. |
| aProtect | If this function was called from script, then this should be set to true in order to protect the user's changes from being overridden by automatic merges or splits. Otherwise, it should be false. |
References WsfSA_GroupUtils::CalculateNumPIs(), WsfSA_Module::mDataPtr, and WsfSA_GroupUtils::RemoveEntityFromGroup().
|
protected |
This function removes any Wsf_EntityPerceptions from the given list that have outlived the given coast time.
| aPerceptionList | A vector containing entity perceptions. |
| aCoastTime | The time each perception is allowed to persist without any update (in sec). |
| aSimTime | The current simulation time. |
References DeleteLater().
Referenced by UpdateAssetsData(), and UpdatePerceivedItemsCalculation().
| bool WsfSA_Perceive::RenameGroup | ( | WsfSA_Group * | aGroup, |
| const std::string & | aName ) |
This allows a group to be renamed.
| aGroup | The group to rename. |
| aName | The new name. |
References WsfSA_Module::mDataPtr, and WsfSA_GroupUtils::RenameGroup().
|
inline |
Set the max asset load to the value provided during initialization (default is -1 where not provided).
References WsfSA_Module::mDataPtr.
|
inline |
Set the max threat load to the value provided during initialization (default is -1 where not provided).
References WsfSA_Module::mDataPtr.
| const WsfExplicitWeapon * WsfSA_Perceive::SelectedWeapon | ( | ) | const |
Returns a pointer to the selected weapon.
References WsfSA_Module::mDataPtr.
| std::string WsfSA_Perceive::SelectedWeaponName | ( | ) | const |
These functions provide data related to the selected weapon ------------------------------------—.
Returns the name of the selected weapon
References WsfSA_Module::mDataPtr.
|
inline |
Sets the engaged target using the specified engaged target data.
| aEngagedTarget | engaged target data |
References WsfSA_Module::mDataPtr.
| bool WsfSA_Perceive::SetFocus | ( | WsfSA_Group * | aGroup, |
| bool | aFocus, | ||
| bool | aProtect = false ) |
Sets a group to focused or unfocused depending on whether focus is true or false, respectively.
| aGroup | The group for which focus is set. |
| aFocus | Sets the group to focused if true, unfocused otherwise. |
| aProtect | If this function was called from script, then this should be set to true in order to protect the user's changes from being overridden by automatic merges or splits. Otherwise, it should be false. |
References WsfSA_Processor::Assess(), WsfSA_GroupUtils::CalculateNumPIs(), WsfSA_Module::GetSAP(), WsfSA_Module::mDataPtr, WsfSA_GroupUtils::SetFocus(), and WsfSA_Assess::UpdateGroupFocusLists().
| void WsfSA_Perceive::SetImportant | ( | WsfSA_PerceivedItem * | aItem, |
| bool | aIsImportant ) |
Sets an entity as important, meaning it should be favored over other entities.
A version of this for groups would be available as well, which for focused groups, would set each entity within the group as important, and for unfocused groups, will flag the group itself as important.
| aItem | The PI for which importance is set. |
| aIsImportant | True to set as important, false otherwise. |
References WsfSA_PerceivedItem::IMPORTANT, WsfSA_PerceivedItem::NOMINAL, and WsfSA_PerceivedItem::SetImportance().
| void WsfSA_Perceive::SetJammingDetected | ( | bool | aJammingDetected | ) |
Sets the jamming detected flag to the specified condition.
| aJammingDetected | set to true if jamming is detected, false if no jamming is detected |
References WsfSA_Module::mDataPtr.
| void WsfSA_Perceive::SetMasterArm | ( | bool | aArmed | ) |
Sets the master arm to the specified condition.
| aArmed | set to true to arm, false to safe |
References WsfSA_Module::mDataPtr.
| void WsfSA_Perceive::SetMasterCautionActive | ( | bool | aActive | ) |
Sets the master caution to the specified condition.
| aActive | set to true if active, false if off |
References WsfSA_Module::mDataPtr.
| void WsfSA_Perceive::SetMasterWarningActive | ( | bool | aActive | ) |
Sets the master warning to the specified condition.
| aActive | set to true if active, false if off |
References WsfSA_Module::mDataPtr.
|
inline |
Set the max asset load.
| aLoad | number of assets a platform can cognitively handle (negative value means no limit) |
References WsfSA_Module::mDataPtr.
|
inline |
Set the max asset load.
| aLoad | number of threats a platform can cognitively handle (negative value means no limit) |
References WsfSA_Module::mDataPtr.
|
protected |
Referenced by CreateAssetsList(), CreateBanditsList(), CreateBogiesList(), and UpdatePerceivedItemsCalculation().
| bool WsfSA_Perceive::SetSelectedWeapon | ( | const std::string & | aWeaponName | ) |
Returns true if the weapon selection was successful, else false.
| aWeaponName | name of the desired weapon |
References WsfComponentList::RoleIterator< T >::AtEnd(), WsfSA_Module::GetPlatform(), and WsfSA_Module::mDataPtr.
| void WsfSA_Perceive::SetShootCueActive | ( | bool | aActive | ) |
Sets the shoot cue to the specified condition.
| aActive | set to true if active, false if off |
References WsfSA_Module::mDataPtr.
| void WsfSA_Perceive::SetShootCueBlinking | ( | bool | aBlinking | ) |
Sets the shoot cue blinking to the specified condition.
| aBlinking | set to true if blinking, false if not |
References WsfSA_Module::mDataPtr.
| void WsfSA_Perceive::SetWeaponBayDoorsAreOpen | ( | bool | aOpen | ) |
Sets the weapon bay doors to the specified condition.
| aOpen | set to true if doors are open, false if doors are closed |
References WsfSA_Module::mDataPtr.
| bool WsfSA_Perceive::ShootCueActive | ( | ) | const |
Returns true if the shoot cue is active, else false.
References WsfSA_Module::mDataPtr.
| bool WsfSA_Perceive::ShootCueBlinking | ( | ) | const |
Returns true if the shoot cue is blinking, else false.
References WsfSA_Module::mDataPtr.
| std::pair< WsfSA_Group *, WsfSA_Group * > WsfSA_Perceive::SplitGroup | ( | WsfSA_Group * | aGroup, |
| int | aNumElements, | ||
| int | aCriterion, | ||
| bool | aProtect = false ) |
Splits a group according to the splitCriteria enumeration.
The number of entities specified by the number argument will be added to a new group which fits splitCriteria. The remainder will be put into the other created group. The input group is deleted, so the original group should be considered invalid after successfully calling this function.
| aGroup | The group to split. |
| aNumElements | The number of elements that will appear in the new group. |
| aCriterion | An enumeration describing how the group should be split. |
| aProtect | If this function was called from script, then this should be set to true in order to protect the user's changes from being overridden by automatic merges or splits. Otherwise, it should be false. |
References WsfSA_GroupUtils::CalculateNumPIs(), WsfSA_Module::GetPlatform(), WsfSA_Module::mDataPtr, and WsfSA_GroupUtils::SplitGroup().
| bool WsfSA_Perceive::ThreatScore | ( | double | aSimTime, |
| WsfLocalTrack * | aThreatPtr, | ||
| bool | aIsMissile, | ||
| double & | aScore ) |
Score a threat.
Return true if scored, false otherwise.
| aSimTime | time when calculated |
| aThreatPtr | threat to score |
| aIsMissile | indicates if track is perceived as a missile |
| aScore | reference variable in which to hold the score |
References WsfScriptContext::ExecuteScript(), WsfObject::GetName(), WsfSA_Module::GetPlatform(), WsfSA_Module::GetScriptContext(), and WsfSA_Module::mDataPtr.
Referenced by GetThreatScore().
| bool WsfSA_Perceive::TransferEntity | ( | WsfSA_EntityPerception * | aEntity, |
| WsfSA_Group * | aGroup, | ||
| bool | aProtect = false ) |
Transfers the entity into the group.
As an exception to the general approach, if the entity is already in another group, it will be removed from that group, but that group will not be marked as protected.
| aEntity | The entity to transfer. |
| aGroup | The group into which the entity will be transferred. |
| aProtect | If this function was called from script, then this should be set to true in order to protect the user's changes from being overridden by automatic merges or splits. Otherwise, it should be false. |
References WsfSA_GroupUtils::CalculateNumPIs(), WsfSA_Module::mDataPtr, and WsfSA_GroupUtils::TransferEntity().
| std::set< WsfPlatform * > WsfSA_Perceive::TruthAssets | ( | ) |
Return a set of assets based on mTruthPerceptionMask.
This is a utility method for when asset knowledge is truth data.
References cALLCOMMANDERS, cALLSUBORDINATES, cCOMMANDER, cPEERS, cSUBORDINATES, WsfCommandChain::GetCommander(), WsfComponentList::GetComponent(), WsfComponentList::GetComponentCount(), WsfComponentList::GetComponentEntry(), WsfCommandChain::GetDefaultNameId(), WsfCommandChain::GetPeers(), WsfSA_Module::GetPlatform(), WsfCommandChain::GetSubordinates(), WsfPlatform::IsBroken(), WsfPlatform::IsDeleted(), and WsfSA_Module::mDataPtr.
Referenced by UpdateAssetsData().
|
protected |
Attempt to update assets at a sim time, and return an appropriate time for the next event update.
A cognitive delay is factored in.
| aSimTime | sim time at which to attempt updating |
References WsfObserver::AirCombatSendPerceivedAssetsData(), WsfSA_Processor::cASSETS_DATA, WsfSA_Module::GetPlatform(), WsfSA_Module::GetSAP(), WsfSA_Module::GetSimulation(), WsfSA_Module::mDataPtr, WsfSA_Processor::SetLastUpdateTime(), and UpdateAssets().
|
protected |
Attempt to update the perceived items calculations, which include bogies and bandits as well as groups, at a sim time, and return an appropriate time for the next event update.
A cognitive delay is factored in.
| aSimTime | sim time at which to attempt updating |
References WsfSA_Processor::cPERCEIVED_ITEM_CALCULATION, WsfSA_Module::GetSAP(), WsfSA_Module::mDataPtr, WsfSA_Processor::SetLastUpdateTime(), UpdateGroupsData(), and UpdatePerceivedItemsCalculation().
|
protected |
Attempt to update the data for perceived items, which include bogies and bandits as well as groups.
A cognitive delay is factored in.
| aSimTime | sim time at which to attempt updating |
References WsfObserver::AirCombatSendPerceivedItemsData(), WsfSA_Processor::cPERCEIVED_ITEM_DATA, WsfSA_Module::GetPlatform(), WsfSA_Module::GetSAP(), WsfSA_Module::GetSimulation(), and WsfSA_Processor::SetLastUpdateTime().
|
protected |
Attempt to update status at a sim time, and return an appropriate time for the next event update.
| aSimTime | sim time at which to send status |
References WsfSA_Processor::cSTATUS, WsfSA_Module::GetSAP(), and UpdateStatus().
|
protected |
Return true if the platform given is unimportant, false otherwise.
| aPlatformIndex | index of platform to evaluate |
References WsfSA_Module::GetSimulation(), and Unimportant().
|
protected |
Return true if the threat given is unimportant, false otherwise.
| aThreatPtr | threat to evaluate |
References WsfTrack::GetTargetIndex(), WsfTrack::GetTargetType(), and WsfSA_Module::mDataPtr.
Referenced by CreateAssetsList(), CreateBanditsList(), CreateBogiesList(), Unimportant(), and UpdatePerceivedItemsCalculation().
|
protected |
Return true if the asset given is unimportant, false otherwise.
| aAssetPtr | asset to evaluate |
References WsfPlatform::GetIndex(), WsfObject::GetType(), and WsfSA_Module::mDataPtr.
|
protected |
Update assets.
| aSimTime | sim time at which to update |
References WsfSA_Processor::cASSETS_DATA, WsfSA_Module::GetSAP(), WsfSA_Processor::SetLastUpdateTime(), and UpdateAssetsData().
Referenced by PerceivedAircraftAssets(), PerceivedAssets(), PerceivedMissileAssets(), and TryUpdateAssets().
|
protected |
Update assets.
| aSimTime | sim time at which to update |
References CreateAssetsList(), CreateAssetSublists(), WsfPlatform::GetIndex(), WsfSA_Module::GetPlatform(), WsfSA_Module::GetSAP(), WsfSA_Module::GetSimulation(), WsfSA_Module::mDataPtr, PurgeOldAssets(), RemoveExpiredCoastingPerceptions(), TruthAssets(), and UpdateCoastingPerceptions().
Referenced by UpdateAssets().
|
protected |
This function sets any currently perceived entities to coasting if they aren't present in the new data.
Additionally, any perceived entities that are already coasting will have their positions manually updated based on their last known velocity and heading.
| aPerceptionList | A vector containing entity perceptions to potentially coast. |
| aNewPerceptionList | A list containing new entity perceptions to update aPerceptionList with. |
| aSimTime | The current simulation time. |
Referenced by UpdateAssetsData(), and UpdatePerceivedItemsCalculation().
|
protected |
Update group data at a sim time, and return an appropriate time for the next event update.
A cognitive delay is factored in.
| aSimTime | sim time at which to attempt updating |
References WsfSA_Processor::Assess(), WsfSA_Module::GetPlatform(), WsfSA_Module::GetSAP(), WsfSA_Module::mDataPtr, and WsfSA_Assess::UpdateGroupFocusLists().
Referenced by TryUpdatePerceivedItemCalculation().
|
protected |
Update the perceived items calculations, which include bogies and bandits as well as groups.
| aSimTime | sim time at which to update |
References WsfSA_Processor::Assess(), WsfSA_Assess::AssessBogiesBandits(), CreateBanditsList(), CreateBogiesList(), CreateSublists(), DeferredDelete(), EntityIsInAssetGroup(), WsfTrackListT< T >::FindTrack(), WsfPlatform::GetMasterTrackList(), WsfSA_Processor::GetPerceptionMasterTrackProcessorTrackList(), WsfSA_Module::GetPlatform(), WsfSimulation::GetPlatformByIndex(), WsfSA_Module::GetSAP(), WsfSA_Module::GetSimulation(), WsfTrack::GetTargetIndex(), WsfTrackListT< T >::GetTrackCount(), WsfTrackListT< T >::GetTrackEntry(), WsfTrack::GetTrackId(), WsfTrackManager::GetTrackList(), WsfTrackProcessor::GetTrackManager(), WsfSA_Processor::GetTrackProcessor(), WsfTrack::IsFalseTarget(), JoinInitialGroups(), WsfSA_Module::mDataPtr, Prune(), RemoveAnyInvalidEntitiesInBogiesAndBandits(), RemoveExpiredCoastingPerceptions(), WsfSA_PerceivedItem::SetAssumedRangeForAngleOnlyTargets(), SetOldPerceptionsAsCoasting(), targetIndex(), Unimportant(), and UpdateCoastingPerceptions().
Referenced by TryUpdatePerceivedItemCalculation().
|
protected |
If this platform has external links, send a status message to those links.
| aSimTime | sim time at which to send status |
References WsfSA_Processor::cSTATUS, WsfSA_Module::GetPlatform(), WsfSA_Module::GetSAP(), WsfSA_Module::GetSimulation(), WsfSA_Processor::GetUpdateInterval(), WsfSA_Module::mDataPtr, platformPtr, WsfSA_Processor::SendMessage(), and WsfSA_EntityPerception::SetFlightId().
Referenced by TryUpdateStatus().
| bool WsfSA_Perceive::WeaponBayDoorsAreOpen | ( | ) | const |
Returns true if the weapon bay doors are open, else false.
References WsfSA_Module::mDataPtr.
|
friend |
References WsfSA_Processor.
Referenced by WsfSA_Perceive(), and WsfSA_Processor.
|
friend |
References WsfSA_ProcessorUpdateEvent.
Referenced by WsfSA_ProcessorUpdateEvent.