← Documentation
ADS-IDAC Engine 5.0.0
HumanFailureEventsBBN.h
Go to the documentation of this file.
1#include <iostream>
2#include <typeinfo>
3#pragma once
4
5#ifdef ENABLE_HCL
6#include "../../HCL/smile/network.h"
7#else
8#include <array>
9#include <cstdint>
10#include <memory>
11namespace bncore {
12class Graph;
13class JunctionTree;
15}
16#endif
17#include <boost/serialization/serialization.hpp>
18#include <boost/serialization/export.hpp>
19
21 public:
24 void NetworkInitiation();
31 void setExpertise(double expertise);
32 void setStress(double stress);
33 void setFatigue(double fatigue);
50 private:
51 // PSFs
58 double expertise;
59 double stress;
60 double fatigue;
62 // HFEs
67 double diagnosis;
77#ifdef ENABLE_HCL
78 // The Network
79 DSL_network net;
80 int systemCriticalityNode;
81 int informationLoadNode;
82 int timeConstraintLoadNode;
83 int cognitiveTaskLoadNode;
84 int passiveAlarmLoadNode;
85 int taskComplexityNode;
86 int expertiseNode;
87 int stressNode;
88 int fatigueNode;
89 int problemSolvingStyleNode;
90 int gatherStateInfoNode;
91 int gatherInfoModeNode;
92 int perceiveStateInfoNode;
93 int gatherNewInfoNode;
94 int diagnosisNode;
95 int strategySelectionNode;
96 int goalSelectionNode;
97 int strategyCommunicationNode;
98 int goalCommunicationNode;
99 int procedureTransferNode;
100 int mentalProcedureNode;
101 int procedureInterpretationNode;
102 int procedureStepNode;
103 int maneuverActionNode;
104 // SMILE Utils
105 int CreateCptNode(DSL_network &net, const char *id, const char *name, const char *outcomes[], int xPos, int yPos);
106 int CreateNoisyMaxNode(DSL_network &net, const char *id, const char *name, const char *outcomes[], int xPos, int yPos);
107 double getFailurePosteriorProbability(DSL_network &net, int handle);
108#else
109 // BNCore network (forward-declared; full headers in .cpp only)
110 std::unique_ptr<bncore::Graph> graph_;
111 std::unique_ptr<bncore::JunctionTree> jt_;
112 std::unique_ptr<bncore::BatchExecutionEngine> engine_;
113 std::array<std::uint32_t, 10> psf_ids_; // bncore::NodeId = uint32_t
114 std::array<std::uint32_t, 14> hfe_ids_;
116 void updateAllPosteriors();
117#endif
118 // Re-syncs the inference engine's soft evidence with the PSF members and
119 // marks posteriors dirty. Called from copy and from the serialize load path.
121 // Boost Serialization
123 template<class Archive>
124 void serialize(Archive & ar, const unsigned int version) {
125// std::cout << "Serializing class: " << typeid(*this).name() << std::endl;
127 ar & information_load;
131 ar & task_complexity;
132 ar & expertise;
133 ar & stress;
134 ar & fatigue;
136 // Note: only the PSF state is archived; the network is rebuilt by the
137 // constructor. After a load the engine still carries constructor
138 // evidence, so re-sync it and force re-inference.
139 if constexpr (Archive::is_loading::value) {
141 }
142 }
143};
void setTaskComplexity(double task_complexity)
std::unique_ptr< bncore::JunctionTree > jt_
double getProcedureInterpretationFailureProbability()
void setCognitiveTaskLoad(double cognitive_task_load)
void setSystemCriticality(double system_criticality)
void setTimeConstraintLoad(double time_constraint_load)
std::unique_ptr< bncore::Graph > graph_
void copyHumanFailureEventsBBN(HumanFailureEventsBBN &)
void setExpertise(double expertise)
void serialize(Archive &ar, const unsigned int version)
void setProblemSolvingStyle(double problem_solving_style)
std::unique_ptr< bncore::BatchExecutionEngine > engine_
void setPassiveAlarmLoad(double passive_alarm_load)
friend class boost::serialization::access
void setInformationLoad(double information_load)
void setFatigue(double fatigue)
std::array< std::uint32_t, 14 > hfe_ids_
std::array< std::uint32_t, 10 > psf_ids_
Runs junction tree inference for a batch of evidence rows.
Definition: engine.hpp:41
Directed graphical model over discrete variables.
Definition: graph.hpp:28
Cliques and separators compiled from one Graph.