WSF
AirToAirLaunchComputerGenerator.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef AIRTOAIRLAUNCHCOMPUTERGENERATOR_HPP
13#define AIRTOAIRLAUNCHCOMPUTERGENERATOR_HPP
14
15
16#include "UtAtmosphere.hpp"
17#include "WeaponToolsExport.hpp"
19
20// Base Class
21#include "Tool.hpp"
22
23// Forward declarations
25
44
46{
47public:
50 Tool* Clone() const override;
51 bool Initialize(WsfSimulation& aSimulation) override;
52 bool ProcessInput(UtInput& aInput) override;
53 void Update(double aSimTime) override;
54
55protected:
67
76
85
86 void ErrorBailout() override;
87
88 void Finish()
89 {
90 mState = cSTATE_DONE;
91 mDone = true;
92 mObserver.SetAllDone();
93 }
94
95 bool FireNewWeapon(double aSimTime) override;
96
97private:
98 void Iterate(double aSimTime);
99 bool EvaluateResult();
100 bool Evaluate();
101
102 void DetermineTargetStateValues(double aShooterLatDeg,
103 double aShooterLonDeg,
104 double aShooterAlt,
105 double aShooterHeadingRad,
106 double aGroundRange,
107 double aTargetLeadRad,
108 double aTargetAspectRad,
109 double aTargetMach,
110 double aTargetAlt,
111 double& aTargetLatDeg,
112 double& aTargetLonDeg,
113 double& aTargetHeadingRad,
114 double aTargetVelNED[3]);
115
116 WsfPlatform* PlaceNewTarget(double aSimTime, WsfTrack& aTrack);
117
118 void ProcessResults();
119
120 void SetLaunchConditions(double aSimTime);
121
122 void SetSearchRmin();
123 void SetSearchRmax();
124 void SetSearchRne();
125
126 void WriteOutputFile();
127
128 unsigned int mTargetCount;
129 size_t mTargetIndex;
130 unsigned int mQuantityLaunched;
131 unsigned int mHitCount;
132 unsigned int mMissCount;
133 unsigned int mSignificant;
134 unsigned int mNullCount;
135 size_t mResultsSize;
136 unsigned int mCurrentIndex;
137 unsigned int mMaxIterations;
138 unsigned int mIterationCount;
139
140 double mIncrementRatio;
141
142 bool mFirstPass;
143
144 bool mAspectRotIsClockwise;
145 bool mAspectRotIsSignedToLead;
146
147 double mShooterMach;
148 double mShooterSpeed;
149 double mTargetAlt;
150 double mTargetMach;
151 double mTargetAspect;
152 double mTargetLead;
153
154 StateType mState;
155 SearchingFor mSearchingFor;
156
157 std::pair<double, bool> mCurrent;
158 std::pair<double, bool> mPrevious;
159
160 double mCurrentGrndRange;
161 bool mCurrentHit;
162 double mCurrentTOF;
163 double mGrndRangeTolerance;
164
165 std::string mGeneratedTimeString;
166
167 UtAtmosphere mAtmosphere;
168
169 // Most of the functionality required is in the
170 // software object that this tool creates:
171 WsfAirToAirLaunchComputer* mATA_LaunchComputerPtr;
173
174 std::string mTableFileName;
175 std::string mResultsFileName;
176
177 double mLastTargetAspect;
178 double mLastTargetLead;
179 double mLastTargetMach;
180 double mLastTargetAlt;
181 double mLastShooterMach;
182 double mLastShooterAlt;
183
184 unsigned int mSuccesses;
185 unsigned int mFailures;
186 double mGlobalMinRmax;
187 double mGlobalMaxRmax;
188 double mGlobalMinRmin;
189 double mGlobalMaxRmin;
190 double mGlobalMinRne;
191 double mGlobalMaxRne;
192 double mGlobalMinRmaxTOF;
193 double mGlobalMaxRmaxTOF;
194 double mGlobalMinRminTOF;
195 double mGlobalMaxRminTOF;
196 double mGlobalMinRneTOF;
197 double mGlobalMaxRneTOF;
198
199 GenerationStateType mGenerationState;
200 double mMaxRange; // meters (default 1km)
201 double mMinRange; // meters (default 120km)
202};
203
204#endif
#define WT_EXPORT
Definition WeaponToolsExport.hpp:26
SearchingFor
Definition AirToAirLaunchComputerGenerator.hpp:69
@ cSEARCH_R_NE
Definition AirToAirLaunchComputerGenerator.hpp:72
@ cNO_SEARCH
Definition AirToAirLaunchComputerGenerator.hpp:70
@ cSEARCH_R_MIN
Definition AirToAirLaunchComputerGenerator.hpp:71
@ cSEARCH_DONE
Definition AirToAirLaunchComputerGenerator.hpp:74
@ cSEARCH_R_MAX
Definition AirToAirLaunchComputerGenerator.hpp:73
void Finish()
Definition AirToAirLaunchComputerGenerator.hpp:88
StateType
Tool States, listed in chronological order:
Definition AirToAirLaunchComputerGenerator.hpp:58
@ cSTATE_GENERATION
Generating the results.
Definition AirToAirLaunchComputerGenerator.hpp:63
@ cSTATE_DONE
Complete.
Definition AirToAirLaunchComputerGenerator.hpp:65
@ cNO_STATE
Un-initialized.
Definition AirToAirLaunchComputerGenerator.hpp:59
@ cSTATE_INITIALIZED
Initialized.
Definition AirToAirLaunchComputerGenerator.hpp:61
GenerationStateType
Definition AirToAirLaunchComputerGenerator.hpp:78
@ cBISECTING
Definition AirToAirLaunchComputerGenerator.hpp:81
@ cNONE
Definition AirToAirLaunchComputerGenerator.hpp:79
@ cFAILED
Definition AirToAirLaunchComputerGenerator.hpp:83
@ cBRACKETING
Definition AirToAirLaunchComputerGenerator.hpp:80
@ cDONE
Definition AirToAirLaunchComputerGenerator.hpp:82
AirToAirLaunchComputerGenerator(WsfScenario &aScenario)
Definition AirToAirLaunchComputerGenerator.cpp:37
bool mDone
Definition Tool.hpp:99
WeaponObserver mObserver
Definition Tool.hpp:88
virtual bool Initialize(WsfSimulation &aSimulation)
Definition Tool.cpp:206
bool ProcessInput(UtInput &aInput) override
Definition Tool.cpp:103
Tool(const Tool &aSrc)
Definition Tool.cpp:65
virtual void Update(double aSimTime)
Definition Tool.cpp:336
virtual void ErrorBailout()
Definition Tool.hpp:84
Tool * Clone() const override=0
virtual bool FireNewWeapon(double aSimTime)=0
Definition WsfAirToAirLaunchComputer.hpp:37
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
The main controller for a simulation.
Definition WsfSimulation.hpp:109
An object that represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
Definition WsfAirToAirLaunchComputer.hpp:89
Copyrights Multiple, All Rights Reserved