Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DftNextStateGenerator.h
Go to the documentation of this file.
1#pragma once
2
5
7
8namespace storm::dft {
9namespace generator {
10
14template<typename ValueType, typename StateType = uint32_t>
16 // TODO: inherit from NextStateGenerator
17
18 using DFTStatePointer = std::shared_ptr<storm::dft::storage::DFTState<ValueType>>;
19 using DFTElementPointer = std::shared_ptr<storm::dft::storage::elements::DFTElement<ValueType>>;
20 using DFTGatePointer = std::shared_ptr<storm::dft::storage::elements::DFTGate<ValueType>>;
21 using DFTRestrictionPointer = std::shared_ptr<storm::dft::storage::elements::DFTRestriction<ValueType>>;
22
23 public:
24 typedef std::function<StateType(DFTStatePointer const&)> StateToIdCallback;
25
27
28 bool isDeterministicModel() const;
29 std::vector<StateType> getInitialStates(StateToIdCallback const& stateToIdCallback);
30
31 void load(storm::storage::BitVector const& state);
32 void load(DFTStatePointer const& state);
33
40
49
55 DFTStatePointer createInitialState() const;
56
65 DFTStatePointer createSuccessorState(DFTStatePointer const origState, std::shared_ptr<storm::dft::storage::elements::DFTBE<ValueType> const> be) const;
66
79 DFTStatePointer createSuccessorState(DFTStatePointer const origState,
80 std::shared_ptr<storm::dft::storage::elements::DFTDependency<ValueType> const> dependency,
81 bool dependencySuccessful = true) const;
82
89 void propagateFailure(DFTStatePointer newState, std::shared_ptr<storm::dft::storage::elements::DFTBE<ValueType> const>& nextBE,
91
98 void propagateFailsafe(DFTStatePointer newState, std::shared_ptr<storm::dft::storage::elements::DFTBE<ValueType> const>& nextBE,
100
101 private:
111 storm::generator::StateBehavior<ValueType, StateType> exploreState(StateToIdCallback const& stateToIdCallback, bool exploreDependencies,
112 bool takeFirstDependency);
113
121 std::pair<StateType, bool> getNewStateId(DFTStatePointer state, StateToIdCallback const& stateToIdCallback) const;
122
123 // The dft used for the generation of next states.
125
126 // General information for the state generation.
127 storm::dft::storage::DFTStateGenerationInfo const& mStateGenerationInfo;
128
129 // Current state
130 DFTStatePointer state;
131
132 // Flag indicating whether all failed states should be merged into one unique failed state.
133 bool uniqueFailedState;
134
135 // Flag indicating whether the model is deterministic.
136 bool deterministicModel = false;
137
138 // Flag indicating whether only the first dependency (instead of all) should be explored.
139 bool mTakeFirstDependency = false;
140};
141
142} // namespace generator
143} // namespace storm::dft
void propagateFailure(DFTStatePointer newState, std::shared_ptr< storm::dft::storage::elements::DFTBE< ValueType > const > &nextBE, storm::dft::storage::DFTStateSpaceGenerationQueues< ValueType > &queues) const
Propagate the failures in a given state if the given BE fails.
storm::generator::StateBehavior< ValueType, StateType > expand(StateToIdCallback const &stateToIdCallback)
Expand and explore current state.
DFTStatePointer createSuccessorState(DFTStatePointer const origState, std::shared_ptr< storm::dft::storage::elements::DFTBE< ValueType > const > be) const
Create successor state from given state by letting the given BE fail next.
void load(storm::storage::BitVector const &state)
storm::generator::StateBehavior< ValueType, StateType > createMergeFailedState(StateToIdCallback const &stateToIdCallback)
Create unique failed state.
std::vector< StateType > getInitialStates(StateToIdCallback const &stateToIdCallback)
DFTStatePointer createInitialState() const
Create initial state.
std::function< StateType(DFTStatePointer const &)> StateToIdCallback
void propagateFailsafe(DFTStatePointer newState, std::shared_ptr< storm::dft::storage::elements::DFTBE< ValueType > const > &nextBE, storm::dft::storage::DFTStateSpaceGenerationQueues< ValueType > &queues) const
Propagate the failsafe state in a given state if the given BE fails.
Represents a Dynamic Fault Tree.
Definition DFT.h:52
Abstract base class for basic events (BEs) in DFTs.
Definition DFTBE.h:14
Dependency gate with probability p.
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18