Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
ExplorationInformation.h
Go to the documentation of this file.
1#pragma once
2
3#include <limits>
4#include <unordered_map>
5#include <vector>
6
7#include <boost/optional.hpp>
8
10
12
15
17
18namespace storm {
19namespace modelchecker {
20namespace exploration_detail {
21template<typename StateType, typename ValueType>
23 public:
24 typedef StateType ActionType;
26 typedef std::unordered_map<StateType, storm::generator::CompressedState> IdToStateMap;
27 typedef typename IdToStateMap::const_iterator const_iterator;
28 typedef std::vector<std::vector<storm::storage::MatrixEntry<StateType, ValueType>>> MatrixType;
29
30 ExplorationInformation(storm::OptimizationDirection const& direction, ActionType const& unexploredMarker = std::numeric_limits<ActionType>::max());
31
32 const_iterator findUnexploredState(StateType const& state) const;
33
35
37
38 void addUnexploredState(StateType const& stateId, storm::generator::CompressedState const& compressedState);
39
40 void assignStateToRowGroup(StateType const& state, ActionType const& rowGroup);
41
42 StateType assignStateToNextRowGroup(StateType const& state);
43
44 StateType getNextRowGroup() const;
45
46 void newRowGroup(ActionType const& action);
47
48 void newRowGroup();
49
51
52 void moveActionToBackOfMatrix(ActionType const& action);
53
54 StateType getActionCount() const;
55
56 std::size_t getNumberOfUnexploredStates() const;
57
58 std::size_t getNumberOfDiscoveredStates() const;
59
60 StateType const& getRowGroup(StateType const& state) const;
61
62 StateType const& getUnexploredMarker() const;
63
64 bool isUnexplored(StateType const& state) const;
65
66 bool isTerminal(StateType const& state) const;
67
68 ActionType const& getStartRowOfGroup(StateType const& group) const;
69
70 std::size_t getRowGroupSize(StateType const& group) const;
71
72 bool onlyOneActionAvailable(StateType const& group) const;
73
74 void addTerminalState(StateType const& state);
75
76 std::vector<storm::storage::MatrixEntry<StateType, ValueType>>& getRowOfMatrix(ActionType const& row);
77
78 std::vector<storm::storage::MatrixEntry<StateType, ValueType>> const& getRowOfMatrix(ActionType const& row) const;
79
80 void addActionsToMatrix(std::size_t const& count);
81
82 bool maximize() const;
83
84 bool minimize() const;
85
86 bool performPrecomputationExcessiveExplorationSteps(std::size_t& numberExplorationStepsSinceLastPrecomputation) const;
87
88 bool performPrecomputationExcessiveSampledPaths(std::size_t& numberOfSampledPathsSinceLastPrecomputation) const;
89
90 bool useLocalPrecomputation() const;
91
92 bool useGlobalPrecomputation() const;
93
95
97
98 bool useProbabilityHeuristic() const;
99
100 bool useUniformHeuristic() const;
101
103
105
106 private:
107 MatrixType matrix;
108 std::vector<StateType> rowGroupIndices;
109
110 std::vector<StateType> stateToRowGroupMapping;
111 StateType unexploredMarker;
112 IdToStateMap unexploredStates;
113
114 storm::OptimizationDirection optimizationDirection;
115 StateSet terminalStates;
116
117 bool localPrecomputation;
118 std::size_t numberOfExplorationStepsUntilPrecomputation;
119 boost::optional<std::size_t> numberOfSampledPathsUntilPrecomputation;
120
122};
123} // namespace exploration_detail
124} // namespace modelchecker
125} // namespace storm
ExplorationInformation(storm::OptimizationDirection const &direction, ActionType const &unexploredMarker=std::numeric_limits< ActionType >::max())
void addUnexploredState(StateType const &stateId, storm::generator::CompressedState const &compressedState)
std::vector< storm::storage::MatrixEntry< StateType, ValueType > > & getRowOfMatrix(ActionType const &row)
void setOptimizationDirection(storm::OptimizationDirection const &direction)
storm::settings::modules::ExplorationSettings::NextStateHeuristic const & getNextStateHeuristic() const
bool performPrecomputationExcessiveSampledPaths(std::size_t &numberOfSampledPathsSinceLastPrecomputation) const
std::vector< std::vector< storm::storage::MatrixEntry< StateType, ValueType > > > MatrixType
void assignStateToRowGroup(StateType const &state, ActionType const &rowGroup)
storm::OptimizationDirection const & getOptimizationDirection() const
bool performPrecomputationExcessiveExplorationSteps(std::size_t &numberExplorationStepsSinceLastPrecomputation) const
ActionType const & getStartRowOfGroup(StateType const &group) const
std::unordered_map< StateType, storm::generator::CompressedState > IdToStateMap
storm::storage::BitVector CompressedState
boost::container::flat_set< Key, std::less< Key >, boost::container::new_allocator< Key > > FlatSet
Redefinition of flat_set was needed, because from Boost 1.70 on the default allocator is set to void.
Definition BoostTypes.h:13
solver::OptimizationDirection OptimizationDirection