WsfPlatform¶
-
WsfPlatform inherits WsfObjectVariable Access:
obj->VarName
Input type: WSF_PLATFORM
Static Methods¶
- WsfRoute CreateRoute(string aRouteName)¶
Returns a clone of the route with the given name. The returned value will not be valid if the named route is not found.
- bool ExecuteGlobalScript(string aScript)¶
Executes the script with the given name within the global context and returns true if successful. See WsfSimulation.Execute for more methods to execute global scripts.
- static bool IsA_TypeOf(string aDerivedType, string aBaseType)¶
Returns true if the platform type specified by aDerivedType inherits from the platform type specified by aBaseType (compare to WsfObject.IsA_TypeOf(aBaseType), which determines if a specific object inherits from aBaseType).
General Methods¶
- int Index()¶
Returns the unique index of the platform within the simulation. A platform’s index is constant, and a given index will never be reused during the course of the simulation.
- double CreationTime()¶
Returns the simulation time (in seconds) when the platform was created.
if (PLATFORM.CreationTime() > 60) { writeln("This platform was created at simulation time ", PLATFORM.CreationTime()); }
- double TimeSinceCreation()¶
Returns the elapsed time in seconds since the platform was created.
writeln("It has been ", PLATFORM.TimeSinceCreation(), " seconds since this platform was created");
- void SetCreationTime(double aTime)¶
Defines the simulation time in seconds when the platform is to be added to the simulation.
Note
This method is valid only during the execution of the simulation-scope on_platform_injection script when the platform is being added to the simulation. Setting a value greater than the current simulation time defers the addition of the platform to the simulation until the specified time. The call is ignored if the value is less than the current simulation time.
- void SetSide(string aSide)¶
Sets the platform’s side.
Note
This method is only valid prior to adding the platform to the simulation.
- bool IsExternallyControlled()¶
Returns whether the platform is being controlled externally to the local simulation (as with an external dis_interface entity).
- void Detonate(string aResult)¶
Detonates the platform. The value of “aResult” must be one of the following or the detonation will be treated as a “dud”:
target_impact
far_away_in_air
far_away_above_ground
far_away_ground_impact
target_proximity_air_burst
target_proximity_above_ground
target_proximity_ground_impact
- void DeletePlatform()¶
Schedules the platform for deletion from the simulation. Since the deletion will occur after the current script context returns, any remaining commands in the script context will be executed.
Command Chain Methods¶
- WsfPlatform Commander()¶
- WsfPlatform Commander(string aCommandChainName)¶
Returns the platform’s commander in the default command chain (first form) or the specified command chain (second form).
- void SetCommander(WsfPlatform aPlatform)¶
- void SetCommander(string aCommandChainName, WsfPlatform aPlatform)¶
Sets the platform’s commander in the default command chain (first form) or the specified command chain (second form). There is one issue with using this method. Any links to a commander that transmit over a comm devices that uses the <local:slave> network_name will not work. So if you plan on using this method to change a platform’s commander during run-time, then do NOT use the <local:slave> network_name on the platform’s comm devices.
- string CommanderName()¶
- string CommanderName(string aCommandChainName)¶
Returns the platform’s commander’s name in the default command chain (first form) or the specified command chain (second form).
- WsfPlatformList Peers()¶
- WsfPlatformList Peers(string aCommandChainName)¶
Returns a platform list of peers in the default command chain (first form) or the specified command chain (second form).
- WsfPlatformList Subordinates()¶
- WsfPlatformList Subordinates(string aCommandChainName)¶
Returns a platform list of subordinates in the default command chain (first form) or the specified command chain (second form).
- WsfCommandChain CommandChain(string aCommandChainName)¶
Returns the command chain with the specified name.
- int CommandChainCount()¶
Returns the number of command chains to which this platform belongs.
- WsfCommandChain CommandChainEntry(int aIndex)¶
Returns the command chain at the specified index. This must be in the range [0, CommandChainCount()-1].
Subsystem Methods¶
- int GPS_Status()¶
Retrieves the GPS availability state from the navigation_errors model. See navigation_errors for more information.
Note
The return value is a large positive value if navigation_errors have not been defined.
- bool SetGPS_Status(int aGPS_Status)¶
Sets the current GPS availability state ( navigation_errors for more information).
The return value is true if the GPS status was changed. The return value is false if the requested state is the same as the current state or if navigation_errors have not been defined.
Note
This has no effect if navigation_errors have not been defined.
- int CommCount()¶
Returns the number of communication devices.
- WsfComm CommEntry(int aIndex)¶
Returns the WsfComm object at the given index.
Note
0-based indexing applies.
- WsfCommRouter Router(string aName)¶
Returns the WsfCommRouter object with the given name.
- int RouterCount()¶
Returns the number of router objects.
- WsfCommRouter RouterEntry(int aIndex)¶
Returns the WsfCommRouter object at the given index.
Note
0-based indexing applies.
- WsfProcessor Processor(string aName)¶
Returns the WsfProcessor object with the given name.
- int ProcessorCount()¶
Returns the number of processor devices.
- WsfProcessor ProcessorEntry(int aIndex)¶
Returns the WsfProcessor object at the given index.
Note
0-based indexing applies.
- int SensorCount()¶
Returns the number of sensor instances on this platform.
- WsfSensor SensorEntry(int aIndex)¶
Returns the WsfSensor object at the given index.
Note
0-based indexing applies.
- bool TurnCommOn(string aName)¶
Turns the communication device with the specified name on, returns true if successful.
- bool TurnCommOff(string aName)¶
Turns the communication device with the specified name off, returns true if successful.
- bool TurnProcessorOn(string aName)¶
Turns the processor device with the specified name on, returns true if successful.
- bool TurnProcessorOff(string aName)¶
Turns the processor device with the specified name off, returns true if successful.
- bool TurnSensorOn(string aName)¶
Turns the sensor device with the specified name on, returns true if successful.
- bool TurnSensorOff(string aName)¶
Turns the sensor device with the specified name off, returns true if successful.
Appearance Methods¶
- double Length()¶
- double Width()¶
- double Height()¶
Returns the length, width and height of the platform (in meters) as defined by the length, {width and height commands. The return value will be zero if it was not defined.
- double TotalMass()¶
- double EmptyMass()¶
- double FuelMass()¶
- double PayloadMass()¶
Returns the total mass (empty mass + fuel mass + payload mass) of the platform or one of the components (in kilograms). The masses may be defined directly using the empty_mass, fuel_mass and payload_mass, but the masses are sometimes defined in and maintained by the mover.
- int Appearance()¶
Returns the platform’s current 32-bit Appearance data as an integer excluding data for bits 3-4, 21 & 23. (See Distributed Interactive Simulation (DIS) Entity Appearance field definitions.)
- void SetAppearance(int aLeastSignificantBit, int aNumberOfBits, int aValue)¶
Sets the platform’s 32-bit Appearance data excluding data for bits 3-4, 21 & 23. (See Distributed Interactive Simulation (DIS) Entity Appearance field definitions.)
Note
This capability allows for direct manipulation of the Entity State Appearance data being reported.
Example
# To set afterburner to on # LSB=16; number of bits=1; value=1 for afterburner on PLATFORM.SetAppearance(16, 1, 1); ... # To set configuration state # LSB=17; number of bits=4; value=15 // valid values in the range of [0..15] PLATFORM.SetAppearance(17, 4, 15); ... # To set power-plant status to on # LSB=22; number of bits=1 ; value=1 PLATFORM.SetAppearance(22, 1, 1);
- double ConcealmentFactor()¶
Returns the platform’s current Concealment Factor.
- void SetConcealmentFactor(double aConcealmentFactor)¶
Sets the platform’s concealment factor to a value within the range of [0..1], with 0 being visible and 1 being hidden. This value is used to determine the Entity State Appearance bit 19 for land domain platforms only. The SetAppearance function can also be used to set bit 19 directly.
- double DamageFactor()¶
Returns the platform’s current damage level (factor). The return value is in the range of [0..1], with 0 being undamaged and 1 being fully damaged or destroyed.
- void SetDamageFactor(double aDamageFactor)¶
Sets the platform’s damage factor to a value within the range of [0..1], with 0 being undamaged and 1 being fully damaged or destroyed.
- void SetTrailingEffects(int aTrailingEffect)¶
Sets the platform’s trailing effect to the given integer value. This value is used to set the Entity State Appearance bits 7-8. The SetAppearance function can also be used to set these bits directly.
- bool Indestructible()¶
Returns ‘true’ if the platform is indestructible. A platform may be marked as indestructible in order prevent it from being destroyed. When this value is set ‘true’, any applied damage accumulates in a logarithmically decaying fashion, so DamageFactor(), rather than returning an actual damage state, reflects an ever decreasing (but never reaching zero) probability of survival.
- void SetIndestructible(bool aIsIndestructible)¶
Sets the platform’s indestructible attribute.
- void SetSignatureState(string aState)¶
Sets the platform’s infrared, optical and radar signature state to the given state.
- void SetInfraredSigState(string aState)¶
Sets the platform’s infrared signature state to the given state.
- double InfraredSigScaleFactor()¶
Returns the current infrared signature scale factor (as a linear value, not dB).
- void SetInfraredSigScaleFactor(double aScaleValue)¶
Sets the infrared signature scale factor to the given value (as an linear value, not dB). The effective infrared signature of the platform becomes the baseline signature value multiplied by this value.
- double InfraredRadiantIntensity(WsfGeoPoint aViewer, double aEarthRadiusScale, string aBandName)¶
Returns the infrared radiant intensity of the platform (in W/sr) when viewed from the location specified by aViewer.
aEarthRadiusScale is a value that can be used to account for atmospheric refraction (typically 1.0). A value of less than or equal to zero is equivalent to specifying 1.0.
aBandName is the infrared band name to be used for the query and must be an empty string or one of the infrared band names as defined in infrared_signature. An empty string is equivalent to specifying “default”.
Note
This performs the same function as the new method WsfPlatform.RadiantIntensity, but only functions for infrared bands. The new method is preferred because it is more general in that it also handles the visual band (if the optical signature is one that also provides radiant intensity). This method may be deprecated in some future release.
- void SetOpticalSigState(string aState)¶
Sets the platform’s optical signature state to the given state.
- double OpticalSigScaleFactor()¶
Returns the current optical signature scale factor (as a linear value, not dB).
- void SetOpticalSigScaleFactor(double aScaleValue)¶
Sets the infrared optical scale factor to the given value (as an linear value, not dB). The effective optical signature of the platform becomes the baseline signature value multiplied by this value.
- double OpticalCrossSection(WsfGeoPoint aViewer, double aEarthRadiusScale)¶
Returns the optical cross section of the platform (in m^2) when viewed from the location specified by aViewer.
aEarthRadiusScale is a value that can be used to account for atmospheric refraction (typically 1.0). A value of less than or equal to zero is equivalent to specifying 1.0.
Note
This performs the same function as the new method WsfPlatform.ProjectedArea. The new method is preferred and this method may be deprecated in some future release.
- double ProjectedArea(WsfGeoPoint aViewer, double aEarthRadiusScale)¶
Returns the projected area of the platform (in m^2) when viewed from the location specified by aViewer.
aEarthRadiusScale is a value that can be used to account for atmospheric refraction (typically 1.0). A value of less than or equal to zero is equivalent to specifying 1.0.
Note
This is equivalent to WsfPlatform.OpticalCrossSection and is preferred because it is more representative of what is being returned.
- double RadiantIntensity(WsfGeoPoint aViewer, double aEarthRadiusScale, string aBandName)¶
Returns the radiant intensity of the platform (in W/sr) when viewed from the location specified by aViewer.
aEarthRadiusScale is a value that can be used to account for atmospheric refraction (typically 1.0). A value of less than or equal to zero is equivalent to specifying 1.0.
aBandName is either “visual” or one of the infrared band names as defined in infrared_signature. An empty string is equivalent to specifying “default”. “default” should be avoid because it is possibly ambiguous.
Note
If an infrared band is supplied as aBandName, this is equivalent to WsfPlatform.InfraredRadiantIntensity. This is the preferred method because it works for both visual and infrared bands.
- double RadarSigScaleFactor()¶
Returns the current radar signature scale factor (as a linear value, not dB).
- void SetRadarSigScaleFactor(double aScaleValue)¶
Sets the radar signature scale factor to the given value (as an linear value, not dB). The effective radar signature of the platform becomes the baseline signature value multiplied by this value.
- double RadarCrossSection(double aRcvrAzimuth, double aRcvrElevation, string aPolarization, double aFrequency)¶
- double RadarCrossSection(WsfGeoPoint aViewer, double aEarthRadiusScale, string aPolarization, double aFrequency)¶
- double RadarCrossSection(double aXmtrAzimuth, double aXmtrElevation, double aRcvrAzimuth, double aRcvrElevation, string aPolarization, double aFrequency)¶
Returns the radar cross section of the platform (in m^2) when viewed from the aspect (e.g. WsfPlatform.ApparentAspectOf) specified by aRcvrAzimuth and aRcvrElevation (degrees), or location specified by aViewer. In the first and second versions, the transmitter and receiver are assumed to be co-located. In the third version, the aspect of the transmitter illuminating the target is specified by aXmtrAzimuth and aXmtrElevation (degrees).
aEarthRadiusScale is a value that can be used to account for atmospheric refraction (typically 4/3). A value of less than or equal to zero is equivalent to specifying 4/3.
aPolarization is the polarization to be used for the query and must be an empty string or one of the polarization names as defined in radar_signature. An empty string is equivalent to specifying “default”.
aFrequency is the frequency of the signal (in Hertz) to be used for the query.
Capabilities Methods¶
- int Capabilities()¶
Returns the platform’s current 16-bit Capabilities data as an integer. The integer contains bit-mapped flags that indicate if the platform has the ability to supply payload, fuel, vehicle repair, vehicle recovery, or automated data service - broadcast (ADS_B) services. This information is especially of interest to the WSF_EXCHANGE_PROCESSOR. (See Distributed Interactive Simulation (DIS) Entity Capabilities field definitions.)
- void SetCapability(int aLeastSignificantBit, bool aValue)¶
Sets the platform’s 16-bit Capabilities data. (See |Distributed Interactive Simulation (DIS) Entity Capabilities field definitions.)
Note
This capability allows for direct manipulation of the Entity State Capability data being reported, and may internally generate a callback that Capabilities have changed.
Example
# To flag the platform as a fuel provider # LSB=1; value=true for supplying fuel PLATFORM.SetCapability(1, true);
Script Invocation Methods¶
- bool ScriptExists(string aScript)¶
Returns ‘true’ if a script with the given name exists on the platform.
- bool ExecuteScript(string aScript)¶
- bool ExecuteScriptWithArgs(string aScript, Array<Object> aArgs)¶
Executes the script with the given name and optional argument list. Returns the return value of the executed script.
Example
int count = (int)plat.Execute("SensorCount", {"airliner"} ); PLATFORM.Execute("TrackCount", {aTrack});
Note
The ExecuteScript and ExecuteScriptWithArgs forms are provided for backward compatibility, and return ‘true’ if the script exists.
Perception Methods¶
- WsfPerceptionProcessor PerceptionProcessor()¶
Returns the platform’s perception processor. If none were defined, a default perception processor is added and returned. If more than one were defined, it returns the first one.
- Array<WsfAssetPerception> PerceivedAssets()¶
Returns the platform’s perceived assets.
Track Methods¶
- WsfLocalTrackList MasterTrackList()¶
Returns the platform’s master track list.
- WsfTrackList MasterRawTrackList()¶
Returns the platform’s master raw track list, or list of raw tracks fused to form the master track list.
- WsfLocalTrackList TrackList(string aTrackProcessorName)¶
Returns the local track list associated with the given track processor. If the track processor is a non-master track processor, the returned track list will not be the master track list.
Note
The track processor, name aTrackProcessorName, must exist on the platform; otherwise, the track list will be invalid.
- WsfTrackList RawTrackList(string aTrackProcessorName)¶
Returns the raw track list associated with the given track processor. If the track processor is a non-master track processor, the returned track list will not be the master raw track list.
Note
The track processor, name aTrackProcessorName, must exist on the platform; otherwise, the track list will be invalid.
- WsfTrackManager TrackManager()¶
Returns the “master” track manager (i.e., the track manager that owns and maintains the master track list).
- WsfTrackId CurrentTarget()¶
Returns the WsfTrackId of the current target.
Note
return_value.IsNull() will be true if there is no current target.
- WsfTrackId SetCurrentTarget(WsfTrack aTrack)¶
Sets the current target given a track and return the WsfTrackId of the current target track. If the argument is a sensor track and already correlated to a local track in the track manager then the current target will be that local track. If the argument is a sensor track and NOT already correlated to a local track in the track manager then a new correlated local track is created and the current target will be that new local track.
- bool HasCurrentTarget()¶
Returns true if the platform has a current target.
- void ClearCurrentTarget()¶
Clears the current target.
- WsfTrack CurrentTargetTrack()¶
Returns the WsfTrack of the current target.
Note
Use return_value.IsValid() to ensure the return value is valid (i.e., there is a current target) before using it.
- double InterceptLocation2D(WsfTrack aTrack, WsfWaypoint aWaypoint)¶
Returns the time to intercept and the intercept bearing. An intercept time of -1 indicates that there is no solution.
The intercept bearing is available in the WsfWaypoint that is passed in by reference. All forms of InterceptLocation2D require a track to intercept and return by reference a waypoint with the intercept bearing.
- double InterceptLocation2D(WsfTrack aTrack, WsfWaypoint aWaypoint, bool aDebug)¶
See above. This version provides a third argument that outputs debug information about the intercept calculation.
- double InterceptLocation2D(WsfTrack aTrack, WsfWaypoint aWaypoint, double aOwnshipSpeed, double aTimeDelay)¶
See above. This version provides additional arguments for providing the ownship speed and a delay until that speed is reached.
- double InterceptLocation2D(WsfTrack aTrack, WsfWaypoint aWaypoint, double aOwnshipSpeed, double aTimeDelay, bool aDebug)¶
See above. This version provides additional arguments for providing the ownship speed, delay until that speed is reached, and whether to output debug information about the intercept calculation.
- double InterceptLocation3D(WsfTrack aTrack, WsfWaypoint aWaypoint)¶
Returns the intercept time, bearing, altitude. An intercept time of -1 indicates that there is no solution. The intercept bearing and altitude is available in the WsfWaypoint that is passed in by reference. All forms of InterceptLocation3D require a track to intercept and return by reference a waypoint with the intercept bearing and altitude.
- double InterceptLocation3D(WsfTrack aTrack, WsfWaypoint aWaypoint, bool aDebug)¶
See above. This version provides a third argument that outputs debug information about the intercept calculation.
- double InterceptLocation3D(WsfTrack aTrack, WsfWaypoint aWaypoint, double aOwnshipSpeed, double aTimeDelay)¶
See above. This version provides additional arguments for providing the ownship speed and a delay until that speed is reached.
- double InterceptLocation3D(WsfTrack aTrack, WsfWaypoint aWaypoint, double aOwnshipSpeed, double aTimeDelay, bool aDebug)¶
See above. This version provides additional arguments for providing the ownship speed, delay until that speed is reached, and whether to output debug information about the intercept calculation.
- double TravelTime(WsfTrack aTrack)¶
Returns the time required to travel to the provided track (seconds).
Note
This method is valid only for WSF_ROAD_MOVER.
Relative Geometry Methods¶
- double RelativeAzimuthOf(WsfGeoPoint aPoint)¶
Returns the azimuth angle ([-180, 180] degrees) of the supplied point with respect to the current orientation of the platform (includes any yaw, pitch or roll angles).
- double RelativeElevationOf(WsfGeoPoint aPoint)¶
Returns the elevation angle ([-90, 90] degrees) of the supplied point with respect to the current orientation of the platform (includes any yaw, pitch or roll angles).
- double TrueBearingTo(WsfTrack aTrack)¶
- double TrueBearingTo(WsfPlatform aPlatform)¶
- double TrueBearingTo(double aLat, double aLon, double aAlt)¶
- double TrueBearingTo(WsfGeoPoint aPoint)¶
Returns the bearing ([-180, 180] degrees) to the given location. The angle is relative to north, with positive values being clockwise.
- Array<double> ApparentAspectOf(WsfGeoPoint aPoint, double aEarthRadiusScale)¶
Returns the ‘apparent’ azimuth angle ([-180, 180] degrees) and the elevation angle, in a two element array of type double, of the supplied point with respect to the current orientation of the platform (includes any yaw, pitch or roll angles). The apparent location (i.e., the perceived location of an object which accounts for atmospheric refraction) may be needed to properly cue sensors that have very narrow beams.
aEarthRadiusScale is a value that can be used to account for atmospheric refraction (typically 1.0). A value of less than or equal to zero is equivalent to specifying 1.0.
- double RelativeBearingTo(WsfTrack aTrack)¶
- double RelativeBearingTo(WsfPlatform aPlatform)¶
- double RelativeBearingTo(double aLat, double aLon, double aAlt)¶
- double RelativeBearingTo(WsfGeoPoint aPoint)¶
Returns the bearing ([-180, 180] degrees) to the given location. The angle is relative to the platforms current heading with positive values being clockwise.
- double SlantRangeTo(WsfTrack aTrack)¶
- double SlantRangeTo(WsfTrack aTrack, bool aUseSpherical)¶
- double SlantRangeTo(WsfPlatform aPlatform)¶
- double SlantRangeTo(WsfPlatform aPlatform, bool aUseSpherical)¶
- double SlantRangeTo(double aLat, double aLon, double aAlt)¶
- double SlantRangeTo(double aLat, double aLon, double aAlt, bool aUseSpherical)¶
- double SlantRangeTo(WsfGeoPoint aPoint)¶
- double SlantRangeTo(WsfGeoPoint aPoint, bool aUseSpherical)¶
- double SlantRangeTo(WsfWaypoint aPoint)¶
- double SlantRangeTo(WsfWaypoint aPoint, bool aUseSpherical)¶
Returns the slant range in meters between the platform and the indicated location. If aUseSpherical is true, calculate using spherical coordinates; if it is false or left unspecified, calculate using ellipsoidal coordinates.
- double GroundRangeTo(WsfTrack aTrack)¶
- double GroundRangeTo(WsfPlatform aPlatform)¶
- double GroundRangeTo(double aLat, double aLon, double aAlt)¶
- double GroundRangeTo(WsfGeoPoint aPoint)¶
Returns the approximate ground range in meters between the platform and the indicated location. Calculated using spherical coordinates.
- double DownRangeTo(WsfTrack aTrack)¶
- double DownRangeTo(WsfPlatform aPlatform)¶
- double DownRangeTo(double aLat, double aLon, double aAlt)¶
- double DownRangeTo(WsfGeoPoint aPoint)¶
Returns the approximate down range in meters between the platform and the indicated location. This is the ground range times the cosine of the relative bearing to the location. Positive values indicate the location is in front of the platform while negative values indicate it is behind the platform. Calculated using spherical coordinates.
- double CrossRangeTo(WsfTrack aTrack)¶
- double CrossRangeTo(WsfPlatform aPlatform)¶
- double CrossRangeTo(double aLat, double aLon, double aAlt)¶
- double CrossRangeTo(WsfGeoPoint aPoint)¶
Returns the approximate cross range in meters between the platform and the indicated location. This is the ground range times the sine of the relative bearing to the location. Positive values indicate the location is to the right of the platform while negative values indicate it is to the left of the platform. Calculated using spherical coordinates.
- WsfGeoPoint ClosestApproachOf(WsfTrack aTrack)¶
- WsfGeoPoint ClosestApproachOf(WsfPlatform aPlatform)¶
Returns the approximate point at which the indicated object would pass closest to the platform. It is derived by extending the horizontal components of the velocity vector of the indicated object and determining the point at which the line passes closest to the platform. If the object is not moving or if it is coincident with the requesting platform, the returned value will be the current position of the object.
Note
The velocity of the requesting platform is not considered in this calculation (i.e., it is not an intercept calculation).
- double HeadingDifferenceOf(WsfTrack aTrack)¶
- double HeadingDifferenceOf(WsfPlatform aPlatform)¶
Returns the difference in heading in degrees between the platform and the indicated object. That is, result = heading of platform - heading of object normalized to the range [-180, 180]. The sign of the value indicates the potential direction of the crossing of the objects. A positive value indicates the object would cross the platform’s path from left to right while a negative value indicates it would cross from right to left. A value of zero indicates the objects are traveling in the same direction while a value of 180 indicates they are traveling in opposite directions.
- double ClosingSpeedOf(WsfTrack aTrack)¶
- double ClosingSpeedOf(WsfPlatform aPlatform)¶
- double ClosingSpeedOf(WsfTrack aTrack, double aMySpeed)¶
- double ClosingSpeedOf(WsfPlatform aPlatform, double aMySpeed)¶
Returns the closing speed in meters per second between the platform and the indicated object. This value is the component of the total velocity in the direction of the vector between the two objects. Positive values mean the objects are closing and negative values mean the objects are separating.
- bool WithinFieldOfView(WsfTrack aTrack, string aMySensorName)¶
- bool WithinFieldOfView(WsfPlatform aPlatform, string aMySensorName)¶
Is the given track or platform within the field of view of this platform’s sensor?
- bool MaskedByTerrain (WsfGeoPoint aPoint, double aVerticalOffset, double aRadiusScaleFactor)¶
Returns true if the line of sight between the platform and the supplied point is masked (obscured) by the terrain.
aVerticalOffset is the amount added to the platform altitude to simulate the height of the observer (e.g., antenna) above the platform.
aRadiusScaleFactor is the scale factor to be applied to Earths radius to simulate atmospheric refraction. This value is typically 1.3333 (4 / 3) for radio frequencies.
- double ApparentTime()¶
Return the apparent mean solar time at the position of this platform in hours since midnight.
Compatibility Methods¶
- double RelativeAltitudeOf(WsfTrack aTrack)¶
Returns the signed difference between the specified track and the requesting platform. A positive value means the altitude of the track is above the requesting platform.
- double RelativeHeadingOf(WsfTrack aTrack)¶
This returns the absolute value of the angle between the line-of-sight vector from the target (represented by the supplied track) to the requesting platform and the heading vector of the target.
Note
The track must have a valid non-zero velocity, or a large value (1.0E+10) will be returned.
Zone Methods¶
- bool WithinZone(string aZoneName)¶
Returns ‘true’ if the platform is within the specified zone defined on the platform. The zone can be created on the platform using the zone … end_zone block or the use_zone command. See platform.
- bool WithinZoneOf(WsfPlatform aPlatform, string aZoneName)¶
Returns ‘true’ if the platform is within the specified zone defined on the specified platform. The zone can be created on the platform using the zone … end_zone block or the use_zone command. See platform.
- Array<string> ZoneNames()¶
Returns an array of the names for all zones that were defined on the platform.
Auxiliary Data Methods¶
Auxiliary Data is a collection of optional named user data attributes that can be stored with the object. The framework will maintain the attributes but in no other way attempts to use the data contained within. The definition and use of any attribute is defined purely by the user.
- Object AuxDataObject(string aName)¶
Retrieve the value of the auxiliary data attribute with the indicated name. If the attribute does not exist then a default value will be returned (false for bool, 0 for int and 0.0 for double).
- bool CheckAuxData(string aName)¶
Returns true if an auxiliary data member exists with the specified name.
- bool HasAuxData()¶
Returns true if the object has auxiliary data.
- bool DeleteAuxData(string aName)¶
Delete the auxiliary data attribute with the indicated name. Returns true if the attribute exists and was deleted, or false if the attribute did not exist.
- void SetAuxData(string aName, bool aValue)¶
- void SetAuxData(string aName, int aValue)¶
- void SetAuxData(string aName, double aValue)¶
- void SetAuxData(string aName, string aValue)¶
- void SetAuxData(string aName, Object aValue)¶
Set the value of the auxiliary data attribute with the indicated name. The last form of SetAuxData() can store any script object type.
- Map<string, string> GetAllAuxDataTypes()¶
Return the names and types of all auxiliary data attributes in the form of a Map<string,string>. Map keys are valid names of auxiliary data attributes. Map values are type names corresponding to valid auxiliary data attribute names.
Group Methods¶
- bool GroupMemberOf(WsfGroup aGroupPtr)¶
Returns true if the platform is a member of the specified group (by name, id or object).
- Array<WsfGroup> Groups()¶
Returns a list of all groups this platform is a member of.
- Array<string> GroupsByName()¶
Returns a list of the names of all groups this platform is a member of.
Other Methods¶
- bool CategoryMemberOf(string aCategoryName)¶
Returns true if the platform is a member of the specified category.
- void Comment(string aComment)¶
- void Comment(double aTime, string aComment)¶
Sends a time-stamped comment entry for the platform to the simulation observers (such as event_output, dis_interface). This is typically used to insert application-specific data into the event logs or simulation output stream. In event_output, the supplied string will be written as a COMMENT entry. For the dis_interface, a Comment PDU will be written which can be interpreted by many visualization tools as a ‘thought bubble.’
The first form uses the current simulation time as the time of the comment. The second form uses the supplied time as the time of the comment and should be used very carefully as time should only increase in some output streams.
- WsfGeoPoint GeoPoint(string aGeoPointName)¶
Returns the point with the given name.
- WsfMover SwapMover(WsfMover aMover)¶
Changes the Platform’s mover. The platform actually starts using a copy of the specified mover. Use WsfPlatform.Mover to access the mover after SwapMover is called. If aMover is null, the platform will no longer have a mover. Returns the mover the platform was using prior to the swap.
- WsfMover SwapMover(string aMoverType)¶
Changes the Platform’s mover to a new mover of the given type. Use WsfPlatform.Mover to access the mover after SwapMover is called. If aMoverType is known, returns the mover the platform was using prior to the swap. If aMoverType is unknown, this does nothing and will return a null object.
- void SetMoverDebugEnabled(bool aBoolean)¶
Enables (‘true’) or disable (‘false’) the debug mode of the mover attached to the platform.
- WsfGeoPoint SubordinatesCentroid()¶
Calculates and returns the centroid of the platform’s subordinates.
- EntityType EntityType()¶
Returns the EntityType if it exists in the entity_type mapping command.
Example:
... EntityType et = pltfrm.EntityType(); ...
- void PrintComponentInfo()¶
Prints a list of the names and types of components attached to the platform, along with a descriptive header.
Cyber Methods¶
Attack Methods¶
- bool CyberAttack(WsfPlatform aTarget, string aAttackType)¶
Initiates a cyber attack against the target platform ‘aTarget’ using the attack type ‘aAttackType’. ‘aAttackType’ must be a valid cyber_attack type.
Returns true if the command was successful or false if one of the arguments was incorrect. This method will also return false is the attack contains an effect that requires the user to supply additional data, as the alternate CyberAttack method must be utilized.
- bool CyberAttack(WsfPlatform aTarget, string aAttackType, WsfCyberAttackParameters aParameters)¶
Initiates a cyber attack against the target platform ‘aTarget’ using the attack type ‘aAttackType’. Certain effects require additional user supplied data at the time an attack is initiated, which is supplied via the ‘aParameters’ object.
Returns true if the command was successful or false if one of the arguments was invalid. If none of the effects associated with an attack require additional user data, this method will also return false and terminate execution.
- bool CyberAttackStatus(WsfPlatform aTarget, string aAttackType)¶
Determines the perceived status of the most recent cyber attack against the target platform ‘aTarget’ using the the attack type ‘aAttackType’.
Returns:
< 0 if the status is unknown (the delivery_delay_time has not expired or the victim has blocked the attack and prevented a status report.)
= 0 if the status is failed.
> 0 if the attack succeeded.
- double LastCyberAttackTime(WsfPlatform aTarget, string aAttackType)¶
Returns the time when the last cyber attack was initiated against the target platform ‘aTarget’ using the attack type ‘aAttackType’. ‘aAttackType’ must be a valid cyber_attack type. This will be a large positive value if an attack has never been attempted.
Cancel Methods¶
To cancel a pending scan/attack see WsfSimulation.CyberScanCancel.
Constraint Methods¶
- WsfCyberConstraint Constraint()¶
Initializes and/or returns a cyber constraint object associated with the platform object.
Scan Methods¶
- bool CyberScan(WsfPlatform aTarget, string aAttackType)¶
Initiates a cyber scan against the target platform ‘aTarget’ using the attack type ‘aAttackType’. ‘aAttackType’ must be a valid cyber_attack type.
Returns true if the command was successful or false if one of the arguments was incorrect.
- bool CyberScanStatus(WsfPlatform aTarget, string aAttackType)¶
Determines the perceived status of the most recent cyber scan against the target platform ‘aTarget’ using the attack type ‘aAttackType’. ‘aAttackType’ must be a valid cyber_attack type.
Returns:
< 0 if the scan is still in progress (the scan_delay_time has not elapsed.)
= 0 if the scan was unsuccessful (target is not vulnerable.)
> 0 if the scan was successful (target is potentially vulnerable to an attack.)
- double LastCyberScanTime(WsfPlatform aTarget, string aAttackType)¶
Returns the time when the last cyber scan was initiated against the target platform ‘aTarget’ using the attack type ‘aAttackType’. ‘aAttackType’ must be a valid cyber_attack type. This will be a large positive value if a scan has never been attempted.
Military Specific¶
Subsystem Methods¶
- int WeaponCount()¶
Returns the number of weapon instances on this platform. This is not the weapon quantity.
- WsfWeapon WeaponEntry(int aIndex)¶
Returns the WsfWeapon object at the given index.
Note
0-based indexing applies.
- double TimeSinceWeaponLastFiredFor(WsfTrackId aTrackId)¶
Return the amount of time that has elapsed since a weapon fire was last requested against the track with the indicated track ID. NOTE: a weapon may or may not have actually been fired, this time is in reference to the last fire request. If no weapon fire has been requested, the return value will be less than zero.
- double TimeSinceWeaponLastTerminatedFor(WsfTrackId aTrackId)¶
Return the amount of time that has elapsed since any weapon (fired from this platform) last terminated against the track with the indicated track ID. If no weapon has terminated, the return value will be less than zero.
- int WeaponsPendingFor(WsfTrackId aTrackId)¶
Return the number of weapon rounds that are in the process of being fired but not yet in-flight against track with the indicated track ID. The reason the weapon is pending is likely because of a firing delay, firing interval, or salvo interval.
- int WeaponsActiveFor(WsfTrackId aTrackId)¶
Return the number of weapon rounds that are currently active (in-flight, weapon platforms created) against track with the indicated track ID.
- int RoundsCompleteFor(WsfTrackId aTrackId)¶
Return the number of terminated weapon platforms that were fired against track with the indicated track ID.
- int RoundsFiredAt(WsfTrackId aTrackId)¶
This is equivalent to “WeaponsActiveFor() + RoundsCompleteFor()”. This returns the number of weapon rounds that have been fired against the track with the indicated ID. This includes rounds that are in-flight.
- int SalvosFiredAt(WsfTrackId aTrackId)¶
Return the number of salvos fire requests that have been asked for against the track with the indicated ID. This includes salvos that are in-flight, and salvos that were requested even when no weapons were left.
- WsfPlatformList ActiveWeaponPlatformsFor(WsfTrackId aTrackId)¶
Return the weapon platforms (currently active & in-flight) fired from this platform against the track with the indicated ID.
Perception Methods¶
- Array<WsfTrack> PerceivedThreats()¶
Returns the platform’s perceived threats according to the perception rules setup in the WSF_PERCEPTION_PROCESSOR WsfPerceptionProcessor.
Track Methods¶
- WsfWeaponEngagement WeaponEngagement()¶
Returns the weapon engagement object for weapon platforms. Caller should test if the returned engagement IsValid() prior to using.