WSF
WsfSatelliteBreakupModel.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 2019 Infoscitex, a DCS 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 WSFSATELLITEBREAKUPMODEL_HPP
13#define WSFSATELLITEBREAKUPMODEL_HPP
14
15#include <memory>
16#include <string>
17
18class UtCalendar;
19#include "UtVec3.hpp"
20#include "WsfScenario.hpp"
21#include "WsfSimulation.hpp"
22
24{
25public:
27 : mScenario(aSimulation.GetScenario())
28 , mSimulation(aSimulation)
29 {
30 }
31 virtual ~WsfSatelliteBreakupModel() = default;
32
33 // Look at the other constructors and assignment operators.
34
35 bool HasGenerated() const { return mHasGenerated; }
36
38 virtual size_t GetFragmentCount() const = 0;
39
41 struct Fragment
42 {
43 double mLength{0.0};
44 double mAoverM{0.0};
45 double mMass{-1.0};
46 double mArea{0.0};
47 UtVec3d mLocationECI{};
48 UtVec3d mVelocityECI{};
49 UtVec3d mDeltaV_ECI{};
50 std::string mName{};
51
52 bool IsInitialized() const { return mMass > 0.0; }
53 };
54
56 virtual Fragment GetFragment(size_t aIndex) const = 0;
57
58 bool ExplosiveBreakup(double aSimTime, const std::string& aPlatformName, const std::vector<double>& aParams);
59
60 bool CollisionalBreakup(double aSimTime,
61 const std::string& aTargetPlatform,
62 const std::vector<double>& aTargetParams,
63 const std::string& aImpactorPlatform,
64 const std::vector<double>& aImpactorParams);
65
67 const std::string& GetFragmentPlatformType() const { return mFragmentPlatformType; }
68
70 void SetFragmentPlatformType(const std::string& aPlatformType);
71
72protected:
82 virtual bool ModelExplosion(WsfPlatform& aPlatform, const std::vector<double>& aParams) = 0;
83
95 virtual bool ModelCollision(WsfPlatform& aTargetPlatform,
96 const std::vector<double>& aTargetParams,
97 WsfPlatform& aImpactorPlatform,
98 const std::vector<double>& aImpactorParams) = 0;
99
100 WsfSimulation& GetSimulation() const { return mSimulation; }
101
102private:
103 std::unique_ptr<WsfPlatform> GetDefaultFragmentPlatformTemplate() const;
104 std::unique_ptr<WsfPlatform> GetFragmentPlatformTemplate() const;
105 bool AddFragment(std::unique_ptr<WsfPlatform> aPlatformPtr,
106 const Fragment& aFragment,
107 const UtCalendar& aEpoch,
108 double aSimTime);
109 bool AddFragmentsToSimulation(double aSimTime);
110 void RemoveProgenitor(std::string aPlatformName, double aSimTime);
111
112 const WsfScenario& mScenario;
113 WsfSimulation& mSimulation;
114 std::string mFragmentPlatformType{};
115 bool mHasGenerated{false};
116};
117
118#endif // WSFSATELLITEBREAKUPMODEL_HPP
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
void SetFragmentPlatformType(const std::string &aPlatformType)
Set the type of the platform for any fragments created by this object.
Definition WsfSatelliteBreakupModel.cpp:142
virtual ~WsfSatelliteBreakupModel()=default
const std::string & GetFragmentPlatformType() const
Get the type of the platform for any fragments created by this object.
Definition WsfSatelliteBreakupModel.hpp:67
WsfSimulation & GetSimulation() const
Definition WsfSatelliteBreakupModel.hpp:100
bool CollisionalBreakup(double aSimTime, const std::string &aTargetPlatform, const std::vector< double > &aTargetParams, const std::string &aImpactorPlatform, const std::vector< double > &aImpactorParams)
Definition WsfSatelliteBreakupModel.cpp:95
virtual bool ModelExplosion(WsfPlatform &aPlatform, const std::vector< double > &aParams)=0
bool ExplosiveBreakup(double aSimTime, const std::string &aPlatformName, const std::vector< double > &aParams)
Definition WsfSatelliteBreakupModel.cpp:39
virtual size_t GetFragmentCount() const =0
Return the number of pieces of debris that were generated.
bool HasGenerated() const
Definition WsfSatelliteBreakupModel.hpp:35
virtual bool ModelCollision(WsfPlatform &aTargetPlatform, const std::vector< double > &aTargetParams, WsfPlatform &aImpactorPlatform, const std::vector< double > &aImpactorParams)=0
virtual Fragment GetFragment(size_t aIndex) const =0
Get the indicated fragment's details.
WsfSatelliteBreakupModel(WsfSimulation &aSimulation)
Definition WsfSatelliteBreakupModel.hpp:26
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
The standard information produced by breakup models for each fragment.
Definition WsfSatelliteBreakupModel.hpp:42
bool IsInitialized() const
The name of the fragment.
Definition WsfSatelliteBreakupModel.hpp:52
double mArea
The mass of the fragment [kg].
Definition WsfSatelliteBreakupModel.hpp:46
UtVec3d mLocationECI
The area of the fragment [m^2].
Definition WsfSatelliteBreakupModel.hpp:47
double mLength
Definition WsfSatelliteBreakupModel.hpp:43
double mAoverM
The size of the fragment [m].
Definition WsfSatelliteBreakupModel.hpp:44
UtVec3d mVelocityECI
The initial location of the fragment [m].
Definition WsfSatelliteBreakupModel.hpp:48
double mMass
The ratio of area to mass of the fragment [m^2/kg].
Definition WsfSatelliteBreakupModel.hpp:45
UtVec3d mDeltaV_ECI
The initial velocity of the fragment [m/s].
Definition WsfSatelliteBreakupModel.hpp:49
std::string mName
The change in velocity relative to the progenitor of this fragment [m/s].
Definition WsfSatelliteBreakupModel.hpp:50
Copyrights Multiple, All Rights Reserved