WSF
WsfEW_RPJ_Effect.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 WSFEW_RPJ_EFFECT_HPP
13#define WSFEW_RPJ_EFFECT_HPP
14
15#include "wsf_mil_export.h"
16
17#include <iosfwd>
18#include <map>
19
20class UtInput;
21
22#include "WsfEM_Interaction.hpp"
23#include "WsfEW_PulseEffect.hpp"
24
26
27class WSF_MIL_EXPORT WsfEW_RPJ_Effect : public WsfEW_PulseEffect
28{
29public:
30 using PD_GainMap = std::map<double, double>;
31 using JNR_PD_GainMapMap = std::map<double, PD_GainMap>;
32
33 using PulseRangeVec = std::vector<double>;
34
37 ~WsfEW_RPJ_Effect() override = default;
38 WsfEW_Effect* Clone() const override;
39 bool Initialize(WsfSimulation& aSimulation) override;
40 bool ProcessInput(UtInput& aInput) override;
41
42
43 void ApplyUnmitigatedEffect(WsfEW_Effects& aEW_Effects) const override;
44
45 void ApplyMitigatedEffect(WsfEW_Effect* aEW_EffectPtr, WsfEW_Effects& aEW_Effects) const override;
46
47 void UpdateEffects(double aSimTime,
48 const WsfEM_Interaction& aTargetInteraction,
49 const WsfEM_Interaction& aJammerToTgtInteraction,
50 const ut::optional<WsfEM_Interaction>& aTgtToJammerInteraction,
51 WsfEW_Effects& aEW_Effects,
52 WsfEW_Effect* aEW_EffectPtr = nullptr) override;
53
55
56
58 double GetJammerToNoise() { return mJammerToNoise; }
59
61 void GetPulseRanges(PulseRangeVec& aPulseRanges) { aPulseRanges = mPulseRangesVec; };
62
64 double GetRPJ_Gain(WsfStringId aRadarTypeId, double aJammerToNoise, double aPulseDensity);
65
67 double GetRPJ_Gain() { return mRPJ_Gain; }
68
70 double GetPulseDensity() { return mPulseDensity; }
72
73protected:
74 class WSF_MIL_EXPORT RPJ_Data : public WsfEW_PulseEffect::PulseData
75 {
76 public:
77 RPJ_Data();
78 RPJ_Data& operator=(const RPJ_Data&) = delete;
79 ~RPJ_Data() override = default;
80
81 bool ProcessInput(UtInput& aInput) override;
82 bool Initialize(WsfSimulation& aSimulation) override;
83
84 EW_EffectData* Clone() const override;
85
86 void Reset() override;
87
88 double GetRPJ_Gain(double aJammerToNoise, double aPulseDensity) const;
89
92
95
96 protected:
97 RPJ_Data(const RPJ_Data& aSrc) = default;
98 };
99
101
103
104 EffectData* NewEffectData() override { return new RPJ_Data(); }
105 EffectData* PropagateEffectDataPtr(WsfStringId aSystemTypeId) override;
106
107 double GetMinJNR_Threshold(WsfStringId aSystemTypeId) const;
108 int GetSamplesPerDetection(WsfStringId aSystemTypeId) const;
109 JNR_PD_GainMapMap GetJNR_PD_GainMapMap(WsfStringId aSystemTypeId) const;
111
112private:
113 using RPJ_DataMap =
114 std::map<WsfStringId, RPJ_Data*>;
115
116 double GetRPJ_Gain(JNR_PD_GainMapMap& aJNR_PD_GainMapMap, double aJammerToNoise, double aPulseDensity);
117
118 double mCoherentRatio;
119 RPJ_DataMap mRPJ_DataMap;
120 double mRPJ_Gain;
121 int mPulsesInSamples;
122 double mPulseDensity;
123 double mJammerToNoise;
124 PulseRangeVec mPulseRangesVec;
125};
126
127#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Definition WsfEM_Interaction.hpp:68
Base effect data used to derive from in inheriting effect classes.
Definition WsfEW_Effect.hpp:317
Definition WsfEW_Effect.hpp:45
Definition WsfEW_Effects.hpp:41
void ApplyUnmitigatedEffect(WsfEW_Effects &aEW_Effects) const override
Definition WsfEW_PowerEffect.cpp:72
void ApplyMitigatedEffect(WsfEW_Effect *aEW_EffectPtr, WsfEW_Effects &aEW_Effects) const override
Definition WsfEW_PowerEffect.cpp:233
Definition WsfEW_PulseEffect.hpp:75
EffectData * PropagateEffectDataPtr(WsfStringId aSystemTypeId) override
Definition WsfEW_PulseEffect.cpp:104
WsfEW_Effect * Clone() const override
Definition WsfEW_PulseEffect.cpp:42
WsfEW_PulseEffect()
Definition WsfEW_PulseEffect.cpp:24
bool Initialize(WsfSimulation &aSimulation) override
Definition WsfEW_PulseEffect.cpp:48
void UpdateEffects(double aSimTime, const WsfEM_Interaction &aTargetInteraction, const WsfEM_Interaction &aJammerToTgtInteraction, const ut::optional< WsfEM_Interaction > &aTgtToJammerInteraction, WsfEW_Effects &aEW_Effects, WsfEW_Effect *aEW_EffectPtr=nullptr) override
Definition WsfEW_PulseEffect.cpp:67
bool ProcessInput(UtInput &aInput) override
Definition WsfEW_PulseEffect.cpp:61
Definition WsfEW_RPJ_Effect.hpp:75
~RPJ_Data() override=default
RPJ_Data & operator=(const RPJ_Data &)=delete
int mSamplesPerDetection
Number of samples taken per detection (e.g. FFT sample size).
Definition WsfEW_RPJ_Effect.hpp:90
double GetRPJ_Gain(double aJammerToNoise, double aPulseDensity) const
Definition WsfEW_RPJ_Effect.cpp:479
RPJ_Data(const RPJ_Data &aSrc)=default
JNR_PD_GainMapMap mJNR_PD_GainMapMap
Definition WsfEW_RPJ_Effect.hpp:94
RPJ_Data()
Definition WsfEW_RPJ_Effect.cpp:377
double mMinJNR_Threshold
Minimum JNR that is required to activate this effect.
Definition WsfEW_RPJ_Effect.hpp:91
void Reset() override
Definition WsfEW_RPJ_Effect.cpp:465
WsfEW_RPJ_Effect()
Definition WsfEW_RPJ_Effect.cpp:32
void GetPulseRanges(PulseRangeVec &aPulseRanges)
Get the calculated pulse ranges for the last call to UpdateEffects(..).
Definition WsfEW_RPJ_Effect.hpp:61
~WsfEW_RPJ_Effect() override=default
std::vector< double > PulseRangeVec
Definition WsfEW_RPJ_Effect.hpp:33
double GetRPJ_Gain()
Get the calculated gain for the last call to UpdateEffects(..).
Definition WsfEW_RPJ_Effect.hpp:67
std::map< double, double > PD_GainMap
Definition WsfEW_RPJ_Effect.hpp:30
double GetJammerToNoise()
Get the calculated JNR for the last call to UpdateEffects(..).
Definition WsfEW_RPJ_Effect.hpp:58
std::map< double, PD_GainMap > JNR_PD_GainMapMap
Definition WsfEW_RPJ_Effect.hpp:31
WsfEW_RPJ_Effect & operator=(const WsfEW_RPJ_Effect &)=delete
double GetPulseDensity()
Get the calculated pulses in the sample for the last call to UpdateEffects(..).
Definition WsfEW_RPJ_Effect.hpp:70
EffectData * NewEffectData() override
Definition WsfEW_RPJ_Effect.hpp:104
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Copyrights Multiple, All Rights Reserved