Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DFTTraceSimulator.h
Go to the documentation of this file.
1#pragma once
2
7
9
10namespace storm::dft {
11namespace simulator {
12
18
24
31template<typename ValueType>
33 using DFTStatePointer = std::shared_ptr<storm::dft::storage::DFTState<ValueType>>;
34
35 public:
44 boost::mt19937& randomGenerator);
45
51 void setRandomNumberGenerator(boost::mt19937& randomNumberGenerator);
52
56 void resetToInitial();
57
61 void resetToState(DFTStatePointer state);
62
66 void setTime(double time);
67
73 DFTStatePointer getCurrentState() const;
74
80 double getCurrentTime() const;
81
90 SimulationStepResult step(storm::dft::storage::FailableElements::const_iterator nextFailElement, bool dependencySuccessful = true);
91
99 std::tuple<storm::dft::storage::FailableElements::const_iterator, double, bool> randomNextFailure();
100
107
116 SimulationTraceResult simulateNextStep(double timebound);
117
130
131 protected:
132 // The DFT used for the generation of next states.
134
135 // General information for the state generation.
137
138 // Generator for creating next state in DFT
140
141 // Current state
142 DFTStatePointer state;
143
144 // Currently elapsed time
145 double time;
146
147 // Random number generator
148 boost::mt19937& randomGenerator;
149};
150
151} // namespace simulator
152} // namespace storm::dft
SimulationStepResult step(storm::dft::storage::FailableElements::const_iterator nextFailElement, bool dependencySuccessful=true)
Perform one simulation step by letting the next element fail.
void resetToState(DFTStatePointer state)
Set the current state back to the given state.
std::tuple< storm::dft::storage::FailableElements::const_iterator, double, bool > randomNextFailure()
Randomly pick an element which fails next (either a BE or a dependency which triggers a BE) and the t...
storm::dft::storage::DFT< ValueType > const & dft
SimulationTraceResult simulateNextStep(double timebound)
Simulate the (randomly chosen) next step and return the outcome of the current (partial) trace.
storm::dft::generator::DftNextStateGenerator< ValueType > generator
storm::dft::storage::DFTStateGenerationInfo const & stateGenerationInfo
void setTime(double time)
Set the elapsed time so far.
double getCurrentTime() const
Get the total elapsed time so far.
SimulationStepResult randomStep()
Perform a random step by using the random number generator.
SimulationTraceResult simulateCompleteTrace(double timebound)
Perform a complete simulation of a failure trace by using the random number generator.
void resetToInitial()
Set the current state back to the initial state in order to start a new simulation.
void setRandomNumberGenerator(boost::mt19937 &randomNumberGenerator)
Set the random number generator.
DFTStatePointer getCurrentState() const
Get the current DFT state.
Represents a Dynamic Fault Tree.
Definition DFT.h:52
SimulationStepResult
Result of a single simulation step.
SimulationTraceResult
Result of a simulation trace.