WSF
WsfCyberRandom.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 2016 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 WSFCYBERRANDOM_HPP
13#define WSFCYBERRANDOM_HPP
14
15#include <map>
16
17#include "WsfCyberAttack.hpp"
19class WsfSimulation;
20
21namespace wsf
22{
23namespace cyber
24{
25namespace random // Extended from "WsfCyberAttack.hpp"
26{
38
44{
45public:
48 struct DrawData
49 {
50 double mDraw{-1.0};
51 double mDrawTime{-1.0};
52 };
53
61 struct DrawCache
62 {
63 double mSimulationDraw{-1.0};
64 std::map<std::string, double> mTargetDraw{};
66 std::map<std::string, DrawData> mTargetIntervalDraw{};
67 };
68
81
82 using AttackCacheMap = std::map<std::string, AttackDistributionCache>;
83
84 RandomManager(WsfSimulation* aSimulation);
85
91 double Draw(const std::string& aAttackType, const std::string& aTarget, ProbabilityType aType);
92
93 const AttackCacheMap& GetCacheMap() const { return mAttackDrawCache; }
94
95private:
97
98
99 double pDraw(const std::string& aAttackType, ProbabilityType aType);
100
102 double pDraw(const std::string& aAttackType, const std::string& aTargetName, ProbabilityType aType);
103
105 double pDraw(const std::string& aAttackType, ProbabilityType aType, WsfRandomVariable& aInterval);
106
108 double pDraw(const std::string& aAttackType,
109 const std::string& aTargetName,
110 ProbabilityType aType,
111 WsfRandomVariable& aInterval);
113
115 AttackCacheMap mAttackDrawCache{};
116 WsfSimulation* mSimulation{nullptr};
117};
118
119} // namespace random
120} // namespace cyber
121} // namespace wsf
122
123#endif
Definition WsfRandomVariable.hpp:33
The main controller for a simulation.
Definition WsfSimulation.hpp:109
const AttackCacheMap & GetCacheMap() const
Definition WsfCyberRandom.hpp:93
RandomManager(WsfSimulation *aSimulation)
Definition WsfCyberRandom.cpp:147
std::map< std::string, AttackDistributionCache > AttackCacheMap
Definition WsfCyberRandom.hpp:82
double Draw(const std::string &aAttackType, const std::string &aTarget, ProbabilityType aType)
Definition WsfCyberRandom.cpp:153
Definition WsfCyberAttack.hpp:32
ProbabilityType
Enumerated probability types that can be drawn for in Cyber.
Definition WsfCyberRandom.hpp:29
@ cSCAN_ATTRIBUTION
Definition WsfCyberRandom.hpp:31
@ cATTACK_ATTRIBUTION
Definition WsfCyberRandom.hpp:35
@ cSTATUS_REPORT
Definition WsfCyberRandom.hpp:33
@ cATTACK_DETECTION
Definition WsfCyberRandom.hpp:34
@ cSCAN_DETECTION
Definition WsfCyberRandom.hpp:30
@ cFUTURE_IMMUNITY
Definition WsfCyberRandom.hpp:36
@ cATTACK_SUCCESS
Definition WsfCyberRandom.hpp:32
Definition WsfCyberApplicationExtension.cpp:24
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
DrawCache mScanAttributionCache
Definition WsfCyberRandom.hpp:74
DrawCache mAttackSuccessCache
Definition WsfCyberRandom.hpp:75
DrawCache mStatusReportCache
Definition WsfCyberRandom.hpp:76
DrawCache mFutureImmunityCache
Definition WsfCyberRandom.hpp:79
DrawCache mAttackAttributionCache
Definition WsfCyberRandom.hpp:78
DrawCache mAttackDetectionCache
Definition WsfCyberRandom.hpp:77
DrawCache mScanDetectionCache
Definition WsfCyberRandom.hpp:73
Definition WsfCyberRandom.hpp:62
std::map< std::string, double > mTargetDraw
cONCE_PER_SIMULATION
Definition WsfCyberRandom.hpp:64
DrawData mSimulationIntervalDraw
cONCE_PER_TARGET
Definition WsfCyberRandom.hpp:65
double mSimulationDraw
Definition WsfCyberRandom.hpp:63
std::map< std::string, DrawData > mTargetIntervalDraw
cINTERVAL_PER_SIMULATION
Definition WsfCyberRandom.hpp:66
Definition WsfCyberRandom.hpp:49
double mDrawTime
Definition WsfCyberRandom.hpp:51
double mDraw
Definition WsfCyberRandom.hpp:50
Copyrights Multiple, All Rights Reserved