WSF
SAM_LaunchComputerGenerator.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 SAM_LAUNCHCOMPUTERGENERATOR_HPP
13#define SAM_LAUNCHCOMPUTERGENERATOR_HPP
14
15#include <string>
16#include <vector>
17
18#include "WeaponToolsExport.hpp"
20class WsfTrack;
21
22#include "Tool.hpp"
23
29
31{
32public:
35 Tool* Clone() const override;
36 bool Initialize(WsfSimulation& aSimulation) override;
37 bool ProcessInput(UtInput& aInput) override;
38 void Update(double aSimTime) override;
39
40protected:
43 {
46 };
47
48 void ErrorBailout() override;
49 bool FireNewWeapon(double aSimTime) override;
50 void LCGenUpdate(double aSimTime);
51 bool PlaceNewTarget(double aSimTime, WsfTrack& aTrack);
52
53 struct TestPoint
54 {
56 : latOffset(0)
57 , altitude(0)
58 , groundRange(0)
59 , speed(0.0){};
60 double latOffset;
61 double altitude;
63 double speed;
64 };
65
66 void WriteOutputFile();
67 void TestOutputFile();
68 void TestPoints();
69
70 bool ProcessArray(UtInput& aInput,
71 const std::string& aBlockTerminator,
72 UtInput::ValueType aUnitType,
73 std::vector<double>& aValues);
74
75private:
76 double CurrentOffset() const; //{ return mSpecifiedOffsets[mOffsetIndex]; }
77 double CurrentAlt(); // { return mSpecifiedAltitudes[mAltIndex]; }
78
79 // The independent variable is ground range, launcher to target.
80 // The DOWN range is calculated from cross range and ground range.
81 double CurrentGrndRng(); // { return mSpecifiedRanges[mRngIndex]; }
82 double CurrentDownRng();
83
84 double CurrentSpeed();
85
86 void ComputeTargetTrack();
87
88 bool CalcConstraints();
89
90 // -------- Attributes:
91
92 double mTrackerHeight;
93 double mTrackerMinEl;
94 double mTrackerMaxEl;
95 double mEffectiveEarthRadiusRatio;
96 std::string mTrackerName;
97 std::string mTrackerMode;
98
99 // The indexes change in the order listed, slowest first, fastest-changing last.
100 unsigned int mOffsetIndex;
101 unsigned int mAltIndex;
102 unsigned int mRngIndex;
103 unsigned int mSpeedIndex;
104
105 double mMaxDeltaAltitude;
106 double mMinDeltaAltitude;
107 double mMaxSlantRange;
108 double mMinSlantRange;
109 double mMaxTOF;
110
111 // --- Varying State Values
112 StateType mState;
113 bool mFirstPass;
114 // bool mLethalAtCurrentAlt;
115 // bool mContinueAfterMiss; // Once a hit is registered, keep trying longer ranges after a miss.
116 bool mReReadProducedFile; // If set, re-read the output file to assure it is "parsable".
117 int mTargetCount;
118 size_t mTgtIndex;
119 double mTgtLatDeg;
120 double mTgtLonDeg;
121 double mTgtAlt;
122 double mTgtHdgRad;
123 double mTgtSpeed;
124
125 std::vector<double> mSpecifiedOffsets;
126 std::vector<double> mSpecifiedAltitudes;
127 std::vector<double> mSpecifiedRanges; // These are GROUND ranges
128 std::vector<double> mSpecifiedTgtSpeeds;
129
130 std::vector<TestPoint> mTestPoints;
131
132 WsfSAM_LaunchComputer mLC_Instance;
133 std::string mGenTime;
134};
135
136#endif
#define WT_EXPORT
Definition WeaponToolsExport.hpp:26
SAM_LaunchComputerGenerator(WsfScenario &aScenario)
Definition SAM_LaunchComputerGenerator.cpp:43
bool ProcessArray(UtInput &aInput, const std::string &aBlockTerminator, UtInput::ValueType aUnitType, std::vector< double > &aValues)
Definition SAM_LaunchComputerGenerator.cpp:283
StateType
< Enumerated states listed in chronological order:
Definition SAM_LaunchComputerGenerator.hpp:43
@ cDONE
Done.
Definition SAM_LaunchComputerGenerator.hpp:45
@ cLC_GEN
Generate.
Definition SAM_LaunchComputerGenerator.hpp:44
void TestPoints()
Definition SAM_LaunchComputerGenerator.cpp:747
void WriteOutputFile()
Definition SAM_LaunchComputerGenerator.cpp:563
void TestOutputFile()
Definition SAM_LaunchComputerGenerator.cpp:689
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 WsfSAM_LaunchComputer.hpp:31
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
double groundRange
Definition SAM_LaunchComputerGenerator.hpp:62
double speed
Definition SAM_LaunchComputerGenerator.hpp:63
double altitude
Definition SAM_LaunchComputerGenerator.hpp:61
double latOffset
Definition SAM_LaunchComputerGenerator.hpp:60
TestPoint()
Definition SAM_LaunchComputerGenerator.hpp:55
Copyrights Multiple, All Rights Reserved