29 using DFTStatePointer = std::shared_ptr<storm::dft::storage::DFTState<ValueType>>;
31 using ExplorationHeuristicPointer = std::shared_ptr<ExplorationHeuristic>;
34 struct ModelComponents {
48 std::vector<ValueType> exitRates;
51 boost::optional<storm::models::sparse::ChoiceLabeling> choiceLabeling;
54 bool deterministicModel;
61 MatrixBuilder(
bool canHaveNondeterminism);
68 void setRemapping(StateType
id) {
69 STORM_LOG_ASSERT(
id < stateRemapping.size(),
"Invalid index for remapping.");
70 stateRemapping[id] = currentRowGroup;
77 if (canHaveNondeterminism) {
78 builder.newRowGroup(currentRow);
89 void addTransition(StateType index, ValueType value) {
90 builder.addNextValue(currentRow, index, value);
104 builder.replaceColumns(stateRemapping, mappingOffset);
112 StateType getCurrentRowGroup() {
113 return currentRowGroup;
123 StateType getRemapping(StateType
id) {
124 STORM_LOG_ASSERT(
id < stateRemapping.size(),
"Invalid index for remapping.");
125 return stateRemapping[id];
132 size_t mappingOffset;
136 std::vector<uint_fast64_t> stateRemapping;
140 StateType currentRowGroup;
143 StateType currentRow;
146 bool canHaveNondeterminism;
165 void buildModel(
size_t iteration,
double approximationThreshold = 0.0,
173 std::shared_ptr<storm::models::sparse::Model<ValueType>>
getModel();
183 std::shared_ptr<storm::models::sparse::Model<ValueType>>
getModelApproximation(
bool lowerBound,
bool expectedTime);
191 void exploreStateSpace(
double approximationThreshold);
196 void initializeNextIteration();
201 void buildLabeling();
210 StateType getOrAddStateIndex(DFTStatePointer
const& state);
217 void setMarkovian(
bool markovian);
234 ValueType getLowerBound(DFTStatePointer
const& state)
const;
243 ValueType getUpperBound(DFTStatePointer
const& state)
const;
253 ValueType computeMTTFAnd(std::vector<ValueType>
const& rates,
size_t size)
const;
263 bool isPriorityGreater(StateType idA, StateType idB)
const;
265 void printNotExplored()
const;
275 std::shared_ptr<storm::models::sparse::Model<ValueType>> createModel(
bool copy);
278 const size_t INITIAL_BITVECTOR_SIZE = 20000;
280 const StateType OFFSET_PSEUDO_STATE = std::numeric_limits<StateType>::max() / 2;
287 std::shared_ptr<storm::dft::storage::DFTStateGenerationInfo> stateGenerationInfo;
297 bool uniqueFailedState =
false;
300 size_t initialStateIndex = 0;
306 ModelComponents modelComponents;
309 MatrixBuilder matrixBuilder;
318 std::map<StateType, std::pair<DFTStatePointer, ExplorationHeuristicPointer>> statesNotExplored;
324 std::map<StateType, std::pair<DFTStatePointer, ExplorationHeuristicPointer>> skippedStates;
327 std::vector<std::vector<size_t>> subtreeBEs;