12#ifndef WSFBALLISTICMISSILELAUNCHCOMPUTER_HPP
13#define WSFBALLISTICMISSILELAUNCHCOMPUTER_HPP
15#include "wsf_mil_export.h"
21#include "TblLookup.hpp"
22#include "UtCallbackHolder.hpp"
23#include "UtEntity.hpp"
45 using TargetMap = std::map<size_t, WsfMover::KinematicModel*>;
59 static std::string
BaseTypeName() {
return "WSF_BALLISTIC_MISSILE_LAUNCH_COMPUTER"; }
91 double GetFirstLaunchTime(
unsigned int aIndex)
const;
92 double GetFirstInterceptTime(
unsigned int aIndex)
const;
93 void GetFirstInterceptLocationWCS(
unsigned int aIndex,
double aLocWCS[3])
const;
94 double GetLastLaunchTime(
unsigned int aIndex)
const;
95 double GetLastInterceptTime(
unsigned int aIndex)
const;
96 void GetLastInterceptLocationWCS(
unsigned int aIndex,
double aLocWCS[3])
const;
102 bool GetPrecomputedLaunchWindowsFor(
double aSimTime,
unsigned int aThreatIndex, std::vector<SA_LaunchWindow>& aWindows);
104 void QueuedSolutionPurge(
double aSimTime,
size_t aTargetIndex,
const std::string& aCaller);
116 const double aLocationWCS[3],
117 const double aVelocityWCS[3],
118 double aIntegrationInterval,
122 bool GetLocationXYZ(
double aTime,
double aLocXYZ[3])
const override;
124 bool GetVelocityXYZ(
double aTime,
double aVelXYZ[3])
const override;
138 double mIntegrationInterval;
143 double mIntegLocWCS[3];
144 double mIntegVelWCS[3];
145 double mIntegWCS_ToNED_Transform[3][3];
148 std::vector<Point> mPoints;
159 const std::string& aCaller);
163 size_t mPlatformIndex;
234 void ComputeRoundedLimits(
double aInterval,
double& aMinValue,
double& aMaxValue,
int& aPointCount);
241 if (groundRangeIndex < 0)
243 groundRangeIndex = 0;
249 return groundRangeIndex;
254 void PrintRangeLine(
const RangeLine& aRangeLine, ut::log::MessageStream& aStream)
const;
256 bool Read(
const std::string& aFileName,
bool aDebugEnabled,
bool aPrintDetail);
281 bool Read(
const std::string& aFileName);
315 double& aTimeToIntercept,
316 double& aTimeOfFlight,
318 double& aInterceptSpeed,
319 double& aInterceptFlightPathAngle);
322 double& aTimeToIntercept,
323 double& aTimeOfFlight,
325 double& aInterceptSpeed,
326 double& aInterceptFlightPathAngle);
329 double& aTimeToLaunch,
330 double& aTimeToIntercept,
331 double& aTimeOfFlight,
333 double& aInterceptSpeed,
334 double& aInterceptFlightPathAngle);
396 double aLaunchDelayTime,
397 double aTimeToLaunch,
398 double aTimeToIntercept,
400 std::vector<SA_LaunchWindow>& aLaunchWindows);
415 const double aTargetLocWCS[3],
416 const double aTargetVelWCS[3],
421 const double aTargetLocWCS[3],
422 const double aTargetVelWCS[3],
425 void PlatformDeleted(
double aSimTime,
WsfPlatform* aPlatformPtr);
427 void PurgeSolution(
double aSimTime,
size_t aTargetIndex,
const std::string& aCaller);
429 void ShowPoint(
const double aLocWCS[3],
430 double aRedValue = 1.0,
431 double aGreenValue = 1.0,
432 double aBlueValue = 0.0,
436 std::shared_ptr<SA_Table> mSA_TablePtr;
437 std::shared_ptr<SS_Table> mSS_TablePtr;
439 double mMaxLaunchSlantRange;
440 double mMaxInterceptSlantRange;
441 double mMinInterceptAltitude;
442 double mMaxInterceptAltitude;
443 double mMinInterceptVelocity;
444 double mMaxInterceptAngle;
445 double mIntegrationTimeStep;
446 double mGroundRangeSampleInterval;
447 double mSolutionValidityTime;
448 double mPredictedTrajectoryErrorLimit;
449 double mLastEvaluatedGroundRange;
450 bool mAllowBoostPhaseIntercept;
452 bool mDebugFileLoading;
453 bool mInterceptTruth;
454 std::unique_ptr<WsfDraw> mDrawPtr;
455 std::unique_ptr<WsfDraw> mLineDrawPtr;
457 bool mInputComputeEndPoint;
458 bool mComputeEndPoint;
459 bool mComputeLaunchWindows;
460 std::vector<SA_LaunchWindow> mLaunchWindows;
462 double mTargetApogeeTime;
463 double mTargetApogeeLocWCS[3];
466 using SA_SolutionCache = std::map<size_t, SA_Solution>;
467 SA_SolutionCache mSA_SolutionCache;
469 UtCallbackHolder mCallbacks;
aObjectPtr Update(simTime)
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Definition WsfAero.hpp:30
Definition WsfBallisticMissileLaunchComputer.hpp:475
UtCallbackHolder mCallbacks
Definition WsfBallisticMissileLaunchComputer.hpp:504
std::map< WsfStringId, WsfStringId > mTargetAeroMap
Definition WsfBallisticMissileLaunchComputer.hpp:502
void GlobalPlatformDeleted(double aSimTime, WsfPlatform *aPlatformPtr)
Definition WsfBallisticMissileLaunchComputer.cpp:3016
WsfBallisticMissileLaunchComputer::TargetMap mTargetDataMap
Definition WsfBallisticMissileLaunchComputer.hpp:501
std::map< WsfStringId, double > mTargetMassMap
Definition WsfBallisticMissileLaunchComputer.hpp:503
WsfBallisticMissileLaunchComputerSharedData()
Definition WsfBallisticMissileLaunchComputer.cpp:3035
bool GetVelocityXYZ(double aTime, double aVelXYZ[3]) const override
Definition WsfBallisticMissileLaunchComputer.cpp:2882
bool GetLocationXYZ(double aTime, double aLocXYZ[3]) const override
Definition WsfBallisticMissileLaunchComputer.cpp:2853
PurgeSolutionEvent(double aSimTime, WsfBallisticMissileLaunchComputer *aLC_Ptr, size_t aTargetIndex, const std::string &aCaller)
Definition WsfBallisticMissileLaunchComputer.cpp:2995
WsfEvent::EventDisposition Execute() override
Definition WsfBallisticMissileLaunchComputer.cpp:3007
Definition WsfBallisticMissileLaunchComputer.hpp:219
RangeLine mIncreasingLine
The line where increasing loft angle results in increasing altitude.
Definition WsfBallisticMissileLaunchComputer.hpp:222
RangeLine mDecreasingLine
The line where increasing loft angle results in decreasing altitude.
Definition WsfBallisticMissileLaunchComputer.hpp:224
Definition WsfBallisticMissileLaunchComputer.hpp:206
double mMinAltitude
Definition WsfBallisticMissileLaunchComputer.hpp:214
TblDepVar1< double > mTimeOfFlight
Definition WsfBallisticMissileLaunchComputer.hpp:209
TblDepVar1< double > mSpeed
Definition WsfBallisticMissileLaunchComputer.hpp:211
TblDepVar1< double > mLoftAngle
Definition WsfBallisticMissileLaunchComputer.hpp:210
double mMaxAltitude
Definition WsfBallisticMissileLaunchComputer.hpp:215
TblIndVarU< double > mAltitude
Definition WsfBallisticMissileLaunchComputer.hpp:208
TblDepVar1< double > mFlightPathAngle
Definition WsfBallisticMissileLaunchComputer.hpp:212
Definition WsfBallisticMissileLaunchComputer.hpp:308
double mEndRange
Definition WsfBallisticMissileLaunchComputer.hpp:352
int mIterCount
Definition WsfBallisticMissileLaunchComputer.hpp:357
double mEndTime
Definition WsfBallisticMissileLaunchComputer.hpp:350
int mBegRangeIndex
Definition WsfBallisticMissileLaunchComputer.hpp:348
bool CheckForInterceptOnRangeLine(int aRangeIndex, double &aTimeToLaunch, double &aTimeToIntercept, double &aTimeOfFlight, double &aLoftAngle, double &aInterceptSpeed, double &aInterceptFlightPathAngle)
Definition WsfBallisticMissileLaunchComputer.cpp:2494
int mEndRangeIndex
Definition WsfBallisticMissileLaunchComputer.hpp:354
double mLastRange
Definition WsfBallisticMissileLaunchComputer.hpp:356
const WsfBallisticMissileLaunchComputer * mComputerPtr
Definition WsfBallisticMissileLaunchComputer.hpp:336
double mEndAltitude
Definition WsfBallisticMissileLaunchComputer.hpp:353
bool mClosing
Definition WsfBallisticMissileLaunchComputer.hpp:358
TblLookupLUBX< double > mAltitudeLU
Definition WsfBallisticMissileLaunchComputer.hpp:360
double mBegRange
Definition WsfBallisticMissileLaunchComputer.hpp:346
void FindLaunchWindowStart(double &aTimeToLaunch, double &aTimeToIntercept, double &aTimeOfFlight, double &aLoftAngle, double &aInterceptSpeed, double &aInterceptFlightPathAngle)
Definition WsfBallisticMissileLaunchComputer.cpp:2132
double mEndLocXYZ[3]
Definition WsfBallisticMissileLaunchComputer.hpp:351
double mBegLocXYZ[3]
Definition WsfBallisticMissileLaunchComputer.hpp:345
void FindLaunchWindowEnd(double &aTimeToLaunch, double &aTimeToIntercept, double &aTimeOfFlight, double &aLoftAngle, double &aInterceptSpeed, double &aInterceptFlightPathAngle)
Definition WsfBallisticMissileLaunchComputer.cpp:2326
double mBaseTime
Definition WsfBallisticMissileLaunchComputer.hpp:339
bool mCheckGeometry
Definition WsfBallisticMissileLaunchComputer.hpp:342
double mBegTime
Definition WsfBallisticMissileLaunchComputer.hpp:344
double mBegAltitude
Definition WsfBallisticMissileLaunchComputer.hpp:347
SA_Evaluator(double aBaseTime, WsfBallisticMissileLaunchComputer *aComputerPtr, WsfMover::KinematicModel *aTargetDataPtr)
Definition WsfBallisticMissileLaunchComputer.cpp:2091
const SA_Table & mSA_Table
Definition WsfBallisticMissileLaunchComputer.hpp:338
double mLaunchLocXYZ[3]
Definition WsfBallisticMissileLaunchComputer.hpp:340
const WsfMover::KinematicModel * mTargetDataPtr
Definition WsfBallisticMissileLaunchComputer.hpp:337
Definition WsfBallisticMissileLaunchComputer.hpp:48
double mFirstInterceptLocWCS[3]
Definition WsfBallisticMissileLaunchComputer.hpp:52
double mLastInterceptTime
Definition WsfBallisticMissileLaunchComputer.hpp:54
double mLastInterceptLocWCS[3]
Definition WsfBallisticMissileLaunchComputer.hpp:55
double mFirstInterceptTime
Definition WsfBallisticMissileLaunchComputer.hpp:51
double mFirstLaunchTime
Definition WsfBallisticMissileLaunchComputer.hpp:50
double mLastLaunchTime
Definition WsfBallisticMissileLaunchComputer.hpp:53
double mLoftAngle
Definition WsfBallisticMissileLaunchComputer.hpp:382
double mInterceptTime
Definition WsfBallisticMissileLaunchComputer.hpp:380
double mInterceptFlightPathAngle
Definition WsfBallisticMissileLaunchComputer.hpp:384
double mLaunchTime
Definition WsfBallisticMissileLaunchComputer.hpp:379
double mTimeOfFlight
Definition WsfBallisticMissileLaunchComputer.hpp:381
double mInterceptSpeed
Definition WsfBallisticMissileLaunchComputer.hpp:383
double mEndPointWCS[3]
Definition WsfBallisticMissileLaunchComputer.hpp:386
double mEndTime
Definition WsfBallisticMissileLaunchComputer.hpp:385
std::vector< SA_LaunchWindow > mLaunchWindows
Definition WsfBallisticMissileLaunchComputer.hpp:388
SA_Solution()
Definition WsfBallisticMissileLaunchComputer.hpp:366
The data used for surface-to-air launches.
Definition WsfBallisticMissileLaunchComputer.hpp:229
SA_Table(double aRangeInterval)
Definition WsfBallisticMissileLaunchComputer.cpp:1630
void ConvertRangeLine(TempRangeLine &aTempRangeLine, RangeLine &aRealRangeLine)
Definition WsfBallisticMissileLaunchComputer.cpp:1669
double mMinRange
Definition WsfBallisticMissileLaunchComputer.hpp:258
void ComputeRoundedLimits(double aInterval, double &aMinValue, double &aMaxValue, int &aPointCount)
Definition WsfBallisticMissileLaunchComputer.cpp:1647
int mRangePointCount
Definition WsfBallisticMissileLaunchComputer.hpp:266
std::vector< RangeEntry > mRangeTable
Definition WsfBallisticMissileLaunchComputer.hpp:271
double mMaxRange
Definition WsfBallisticMissileLaunchComputer.hpp:259
int IndexOfRange(double aRange) const
Definition WsfBallisticMissileLaunchComputer.hpp:238
double mMaxTimeOfFlight
Definition WsfBallisticMissileLaunchComputer.hpp:263
double mRangeInterval
Definition WsfBallisticMissileLaunchComputer.hpp:265
double mMaxAltitude
Definition WsfBallisticMissileLaunchComputer.hpp:261
double mMinTimeOfFlight
Definition WsfBallisticMissileLaunchComputer.hpp:262
double RangeOfIndex(size_t aRangeIndex) const
Definition WsfBallisticMissileLaunchComputer.hpp:252
double mMinAltitude
Definition WsfBallisticMissileLaunchComputer.hpp:260
bool mHasVelocityData
Definition WsfBallisticMissileLaunchComputer.hpp:268
bool mHasBurnoutData
Definition WsfBallisticMissileLaunchComputer.hpp:299
TblDepVar1< double > mSpeed
Definition WsfBallisticMissileLaunchComputer.hpp:290
TblDepVar1< double > mBurnTime
Definition WsfBallisticMissileLaunchComputer.hpp:288
TblDepVar1< double > mFlightPathAngle
Definition WsfBallisticMissileLaunchComputer.hpp:291
TblDepVar1< double > mBO_FlightPathAngle
Definition WsfBallisticMissileLaunchComputer.hpp:296
TblIndVarU< double > mRange
Definition WsfBallisticMissileLaunchComputer.hpp:284
TblDepVar1< double > mBO_Speed
Definition WsfBallisticMissileLaunchComputer.hpp:295
TblDepVar1< double > mBO_Range
Definition WsfBallisticMissileLaunchComputer.hpp:294
bool mHasVelocityData
Definition WsfBallisticMissileLaunchComputer.hpp:298
bool Read(const std::string &aFileName)
Definition WsfBallisticMissileLaunchComputer.cpp:1492
TblDepVar1< double > mLoftAngle
Definition WsfBallisticMissileLaunchComputer.hpp:287
TblDepVar1< double > mBO_TimeOfFlight
Definition WsfBallisticMissileLaunchComputer.hpp:293
TblDepVar1< double > mTimeOfFlight
Definition WsfBallisticMissileLaunchComputer.hpp:289
A temporary class for holding an intersection point.
Definition WsfBallisticMissileLaunchComputer.hpp:177
double mSpeed
Definition WsfBallisticMissileLaunchComputer.hpp:182
double mTimeOfFlight
Definition WsfBallisticMissileLaunchComputer.hpp:180
double mFlightPathAngle
Definition WsfBallisticMissileLaunchComputer.hpp:183
double mLoftAngle
Definition WsfBallisticMissileLaunchComputer.hpp:181
double mAltitude
Definition WsfBallisticMissileLaunchComputer.hpp:179
A temporary form of 'RangeEntry' used during creation of the final tables.
Definition WsfBallisticMissileLaunchComputer.hpp:191
TempRangeLine mIncreasingLine
Definition WsfBallisticMissileLaunchComputer.hpp:193
TempRangeLine mDecreasingLine
Definition WsfBallisticMissileLaunchComputer.hpp:194
Definition WsfBallisticMissileLaunchComputer.hpp:40
static std::string BaseTypeName()
The basic type name (needed by weapon_tools and launch computer processor).
Definition WsfBallisticMissileLaunchComputer.hpp:59
void ComputeEndPoint()
Definition WsfBallisticMissileLaunchComputer.hpp:82
WsfBallisticMissileLaunchComputer()
Constructor.
Definition WsfBallisticMissileLaunchComputer.cpp:179
void SetLauncherBearingOnly(double aValue)
Definition WsfBallisticMissileLaunchComputer.hpp:170
bool ComputeGroundIntercept(double aSimTime, double aLaunchDelayTime, const double aTargetLocWCS[3])
Definition WsfBallisticMissileLaunchComputer.cpp:1026
double GetTargetApogeeTime() const
Definition WsfBallisticMissileLaunchComputer.cpp:686
bool ComputeAirIntercept(double aSimTime, WsfPlatform *aTargetPtr, const WsfTrack *aTrackPtr, double aLaunchDelayTime)
Definition WsfBallisticMissileLaunchComputer.cpp:731
virtual double ComputeLateralTargetOffset(double aSimTime, const WsfTrack &aTrack)
Definition WsfBallisticMissileLaunchComputer.cpp:540
void WeaponFired(double aSimTime, const WsfWeaponEngagement *aEngagementPtr, const WsfTrack *aTrackPtr)
Simulation observer for a weapon firing.
Definition WsfBallisticMissileLaunchComputer.cpp:1469
std::map< size_t, WsfMover::KinematicModel * > TargetMap
Definition WsfBallisticMissileLaunchComputer.hpp:45
void ComputeLaunchWindows()
Definition WsfBallisticMissileLaunchComputer.hpp:89
void GetTargetApogeeLocationWCS(double aLocWCS[3]) const
Definition WsfBallisticMissileLaunchComputer.cpp:692
WsfBallisticMissileLaunchComputer & operator=(const WsfBallisticMissileLaunchComputer &)=delete
std::vector< TempPoint > TempRangeLine
A temporary form of 'RangeLine' used during creation of the final tables.
Definition WsfBallisticMissileLaunchComputer.hpp:187
double LastEvaluatedGroundRange() const
Definition WsfBallisticMissileLaunchComputer.hpp:151
unsigned int GetLaunchWindowCount() const
Definition WsfBallisticMissileLaunchComputer.hpp:90
void WeaponFireAborted(double aSimTime, WsfWeapon *aWeaponPtr, const WsfTrack *aTrackPtr, double aQuantity)
Definition WsfBallisticMissileLaunchComputer.cpp:1455
Provides the capability to draw shapes into the WSF replay file.
Definition WsfDraw.hpp:35
EventDisposition
Definition WsfEvent.hpp:37
virtual bool InitializeTTIData()
Definition WsfLaunchComputer.cpp:440
double mLauncherBearing
Definition WsfLaunchComputer.hpp:360
WsfLaunchComputer()
Definition WsfLaunchComputer.cpp:44
virtual double EstimatedTimeToIntercept(double aSimTime, const WsfTrack &aTrack, double aLaunchDelayTime)
Definition WsfLaunchComputer.cpp:749
WsfLaunchComputer * Clone() const override
Definition WsfLaunchComputer.cpp:518
bool ProcessInput(UtInput &aInput) override
Definition WsfLaunchComputer.cpp:171
virtual bool Initialize(double aSimTime, WsfWeapon *aWeaponPtr)
Definition WsfLaunchComputer.cpp:393
Definition WsfMover.hpp:286
Definition WsfMover.hpp:37
WsfSimulationExtension()
Definition WsfSimulationExtension.cpp:23
An object that represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
Definition WsfWeaponEngagement.hpp:43
Definition WsfWeapon.hpp:63