12#ifndef WSFCYBERENGAGEMENT_HPP
13#define WSFCYBERENGAGEMENT_HPP
15#include "wsf_cyber_export.h"
19#include "UtCloneablePtr.hpp"
20#include "UtScriptAccessible.hpp"
21#include "UtScriptBasicTypes.hpp"
22#include "UtScriptClass.hpp"
36class WSF_CYBER_EXPORT
Engagement :
public UtScriptAccessible
58 std::string aVictimPlatform,
59 std::string aNamedAttack,
75 const std::string&
GetVictim()
const {
return mVictim; }
78 size_t GetKey()
const {
return mKey; }
90 bool GetStatusReportSuccess()
const;
135 void SetAttackStartTime();
136 void SetScanStartTime();
137 void SetTimeAttackDiscovered();
138 void SetTimeAttackRecovery();
151 bool IsVictimImmune()
const;
163 virtual void Reset(
bool aScanReset =
false);
167 void ReleaseAttackerConstraints();
172 bool MeetsAttackerConstraints();
178 bool MakeConstraintReservations();
182 bool ExistingConstraintReservations();
194 void SetDefiningCyberObject();
200 void SetInitialValues();
202 std::string mAttacker{};
203 size_t mAttackerIndex{0U};
204 std::string mVictim{};
205 size_t mVictimIndex{0U};
206 std::string mNamedAttack{};
210 double mTimeAttackStart{std::numeric_limits<double>::max()};
211 double mDuration{-1.0};
212 double mAttackSuccessThreshold{1.0};
213 double mAttackDraw{-1.0};
214 double mCyberResourceUsage{0.0};
215 double mStatusReportThreshold{1.0};
216 double mStatusReportDraw{-1.0};
217 double mTimeAttackDetection{-1.0};
218 double mTimeAttackDetectionDelay{std::numeric_limits<double>::max()};
219 double mAttackDetectionThreshold{0.0};
220 double mAttackDetectionDraw{-1.0};
221 double mAttackAttributionThreshold{0.0};
222 double mAttackAttributionDraw{-1.0};
223 double mTimeAttackRecovery{-1.0};
224 double mTimeAttackRecoveryDelay{std::numeric_limits<double>::max()};
225 bool mRecover{
false};
226 CyberAttackFailure mAttackFailure{cATTACK_NONE};
227 double mTimeDeliveryDelay{0.0};
228 bool mAttackInProgress{
false};
229 bool mAttackSuccess{
false};
232 double mTimeScanStart{std::numeric_limits<double>::max()};
233 double mScanDetectionThreshold{0.0};
234 double mScanDetectionDraw{-1.0};
235 double mScanAttributionThreshold{0.0};
236 double mScanAttributionDraw{-1.0};
237 CyberScanFailure mScanFailure{cSCAN_NONE};
238 double mTimeScanDelay{0.0};
239 bool mScanSuccess{
false};
242 double mImmunityThreshold{0.0};
243 double mImmunityDraw{-1.0};
245 bool mUseProtectDefinition{
false};
247 WsfSimulation& mSimulation;
248 Protect* mProtectTypePtr{
nullptr};
249 Constraint* mConstraintPtr{
nullptr};
250 std::vector<std::string> mAttackEffectTypes{};
256 UtCloneablePtr<Attack> mAttackPtr{
nullptr};
264 ScriptEngagement(
const std::string& aClassName, UtScriptTypes* aScriptTypesPtr);
The main controller for a simulation.
Definition WsfSimulation.hpp:109
Definition WsfCyberAttack.hpp:55
Definition WsfCyberConstraint.hpp:39
A class that represents the cyber engagements between two platforms.
Definition WsfCyberEngagement.hpp:37
double GetStatusReportDraw() const
Definition WsfCyberEngagement.hpp:86
void SetAttackInProgress(bool aInProgress)
Definition WsfCyberEngagement.hpp:141
double GetScanDetectionThreshold() const
Definition WsfCyberEngagement.hpp:99
double GetAttackAttributionThreshold() const
Definition WsfCyberEngagement.hpp:94
void SetAttackFailureReason(CyberAttackFailure aAttackFailure)
Definition WsfCyberEngagement.hpp:129
size_t GetKey() const
Definition WsfCyberEngagement.hpp:78
bool GetAttackInProgress() const
Definition WsfCyberEngagement.hpp:106
const std::string & GetAttackType() const
Definition WsfCyberEngagement.hpp:77
size_t GetAttackerIndex() const
Definition WsfCyberEngagement.hpp:74
Engagement(Engagement &&aSrc)=default
double GetScanDelayTime() const
Definition WsfCyberEngagement.hpp:103
Attack * GetAttack() const
Definition WsfCyberEngagement.hpp:80
double GetAttackDetectionThreshold() const
Definition WsfCyberEngagement.hpp:92
void SetAttackSuccess(bool aSuccess)
Definition WsfCyberEngagement.hpp:142
void SetScanFailureReason(CyberScanFailure aScanFailure)
Definition WsfCyberEngagement.hpp:130
const std::string & GetAttacker() const
Definition WsfCyberEngagement.hpp:73
double GetTimeAttackRecovery() const
Definition WsfCyberEngagement.hpp:96
double GetDuration() const
Definition WsfCyberEngagement.hpp:81
double GetAttackSuccessThreshold() const
Definition WsfCyberEngagement.hpp:83
Engagement(std::string aAttackingPlatform, std::string aVictimPlatform, std::string aNamedAttack, WsfSimulation &aSimulation, size_t aKey)
No default constructor usage - parameters required for instantiation.
Definition WsfCyberEngagement.cpp:35
double GetImmunityDraw() const
Definition WsfCyberEngagement.hpp:112
const char * GetScriptClassName() const override
Definition WsfCyberEngagement.hpp:69
size_t GetVictimIndex() const
Definition WsfCyberEngagement.hpp:76
double GetAttackStartTime() const
Definition WsfCyberEngagement.hpp:82
WsfSimulation & GetSimulation() const
Definition WsfCyberEngagement.hpp:184
double GetTimeAttackDiscovered() const
Definition WsfCyberEngagement.hpp:91
bool GetAttackSuccess() const
Definition WsfCyberEngagement.hpp:107
double GetAttackAttributionDraw() const
Definition WsfCyberEngagement.hpp:95
double GetAttackDetectionDelayTime() const
Definition WsfCyberEngagement.hpp:109
CyberAttackFailure GetAttackFailureReason() const
Definition WsfCyberEngagement.hpp:121
double GetAttackDraw() const
Definition WsfCyberEngagement.hpp:84
const Engagement & operator=(const Engagement &aRhs)=delete
bool GetScanSuccess() const
Definition WsfCyberEngagement.hpp:105
Protect * GetUsedProtection()
Definition WsfCyberEngagement.hpp:116
CyberScanFailure GetScanFailureReason() const
Definition WsfCyberEngagement.hpp:122
CyberScanFailure
Definition WsfCyberEngagement.hpp:49
@ cSCAN_NOT_VULNERABLE
Definition WsfCyberEngagement.hpp:52
@ cSCAN_NONE
Definition WsfCyberEngagement.hpp:53
@ cSCAN_DETECTED
Definition WsfCyberEngagement.hpp:51
@ cSCAN_IMMUNITY
Definition WsfCyberEngagement.hpp:50
CyberAttackFailure
Definition WsfCyberEngagement.hpp:40
@ cATTACK_IMMUNITY
Definition WsfCyberEngagement.hpp:42
@ cATTACK_RANDOM_DRAW
Definition WsfCyberEngagement.hpp:41
@ cATTACK_INSUFFICIENT_RESOURCES
Definition WsfCyberEngagement.hpp:44
@ cATTACK_NONE
Definition WsfCyberEngagement.hpp:45
@ cATTACK_NOT_VULNERABLE
Definition WsfCyberEngagement.hpp:43
Engagement(const Engagement &aSrc)=delete
const std::string & GetVictim() const
Definition WsfCyberEngagement.hpp:75
double GetDeliveryDelayTime() const
Definition WsfCyberEngagement.hpp:104
double GetStatusReportThreshold() const
Definition WsfCyberEngagement.hpp:85
bool GetRecovery() const
Definition WsfCyberEngagement.hpp:97
double GetAttackDetectionDraw() const
Definition WsfCyberEngagement.hpp:93
void SetScanSuccess(bool aSuccess)
Definition WsfCyberEngagement.hpp:140
double GetImmunityThreshold() const
Definition WsfCyberEngagement.hpp:111
const std::vector< std::string > & GetAttackEffects() const
Definition WsfCyberEngagement.hpp:108
double GetScanAttributionThreshold() const
Definition WsfCyberEngagement.hpp:101
double GetScanStartTime() const
Definition WsfCyberEngagement.hpp:98
double GetScanDetectionDraw() const
Definition WsfCyberEngagement.hpp:100
double GetAttackRecoveryDelayTime() const
Definition WsfCyberEngagement.hpp:110
double GetScanAttributionDraw() const
Definition WsfCyberEngagement.hpp:102
Definition WsfCyberProtect.hpp:40
UT_DECLARE_SCRIPT_METHOD(ScanInProgress)
UT_DECLARE_SCRIPT_METHOD(TimeScanInitiated)
Accessor methods for scan status.
UT_DECLARE_SCRIPT_METHOD(ScanDetectionDraw)
UT_DECLARE_SCRIPT_METHOD(AttackType)
UT_DECLARE_SCRIPT_METHOD(AttackDetectionDraw)
UT_DECLARE_SCRIPT_METHOD(AttackSuccessDraw)
UT_DECLARE_SCRIPT_METHOD(AttackerPlatform)
UT_DECLARE_SCRIPT_METHOD(AttackInProgress)
UT_DECLARE_SCRIPT_METHOD(ScanDelayTime)
UT_DECLARE_SCRIPT_METHOD(TimeAttackInitiated)
Accessor methods for attack status.
UT_DECLARE_SCRIPT_METHOD(StatusReportThreshold)
UT_DECLARE_SCRIPT_METHOD(ScanAttributionDraw)
UT_DECLARE_SCRIPT_METHOD(Victim)
UT_DECLARE_SCRIPT_METHOD(ScanAttributionThreshold)
UT_DECLARE_SCRIPT_METHOD(Attacker)
Accessor methods for general (sim) data.
UT_DECLARE_SCRIPT_METHOD(AttackAttributionDraw)
UT_DECLARE_SCRIPT_METHOD(AttackDetectionThreshold)
UT_DECLARE_SCRIPT_METHOD(AttackFailureReason)
UT_DECLARE_SCRIPT_METHOD(TimeAttackDiscovered)
UT_DECLARE_SCRIPT_METHOD(AttackSuccess)
UT_DECLARE_SCRIPT_METHOD(ScanFailureReason)
UT_DECLARE_SCRIPT_METHOD(ScanDetectionThreshold)
UT_DECLARE_SCRIPT_METHOD(AttackDeliveryDelayTime)
UT_DECLARE_SCRIPT_METHOD(AttackSuccessThreshold)
UT_DECLARE_SCRIPT_METHOD(ScanSuccess)
UT_DECLARE_SCRIPT_METHOD(Recovery)
UT_DECLARE_SCRIPT_METHOD(StatusReportDraw)
UT_DECLARE_SCRIPT_METHOD(AttackAttributionThreshold)
UT_DECLARE_SCRIPT_METHOD(AttackDetectionDelayTime)
UT_DECLARE_SCRIPT_METHOD(AttackRecoveryDelayTime)
UT_DECLARE_SCRIPT_METHOD(TimeAttackRecovery)
UT_DECLARE_SCRIPT_METHOD(VictimPlatform)
ScriptEngagement(const std::string &aClassName, UtScriptTypes *aScriptTypesPtr)
Definition WsfCyberEngagement.cpp:407
ProbabilityType
Enumerated probability types that can be drawn for in Cyber.
Definition WsfCyberRandom.hpp:29
Definition WsfCyberApplicationExtension.cpp:24
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32