Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
ExplorationInformation.h
Go to the documentation of this file.
1#ifndef STORM_MODELCHECKER_EXPLORATION_EXPLORATION_DETAIL_EXPLORATIONINFORMATION_H_
2#define STORM_MODELCHECKER_EXPLORATION_EXPLORATION_DETAIL_EXPLORATIONINFORMATION_H_
3
4#include <limits>
5#include <unordered_map>
6#include <vector>
7
8#include <boost/optional.hpp>
9
11
13
16
18
19namespace storm {
20namespace modelchecker {
21namespace exploration_detail {
22template<typename StateType, typename ValueType>
24 public:
25 typedef StateType ActionType;
27 typedef std::unordered_map<StateType, storm::generator::CompressedState> IdToStateMap;
28 typedef typename IdToStateMap::const_iterator const_iterator;
29 typedef std::vector<std::vector<storm::storage::MatrixEntry<StateType, ValueType>>> MatrixType;
30
31 ExplorationInformation(storm::OptimizationDirection const& direction, ActionType const& unexploredMarker = std::numeric_limits<ActionType>::max());
32
33 const_iterator findUnexploredState(StateType const& state) const;
34
36
38
39 void addUnexploredState(StateType const& stateId, storm::generator::CompressedState const& compressedState);
40
41 void assignStateToRowGroup(StateType const& state, ActionType const& rowGroup);
42
43 StateType assignStateToNextRowGroup(StateType const& state);
44
45 StateType getNextRowGroup() const;
46
47 void newRowGroup(ActionType const& action);
48
49 void newRowGroup();
50
52
53 void moveActionToBackOfMatrix(ActionType const& action);
54
55 StateType getActionCount() const;
56
57 std::size_t getNumberOfUnexploredStates() const;
58
59 std::size_t getNumberOfDiscoveredStates() const;
60
61 StateType const& getRowGroup(StateType const& state) const;
62
63 StateType const& getUnexploredMarker() const;
64
65 bool isUnexplored(StateType const& state) const;
66
67 bool isTerminal(StateType const& state) const;
68
69 ActionType const& getStartRowOfGroup(StateType const& group) const;
70
71 std::size_t getRowGroupSize(StateType const& group) const;
72
73 bool onlyOneActionAvailable(StateType const& group) const;
74
75 void addTerminalState(StateType const& state);
76
77 std::vector<storm::storage::MatrixEntry<StateType, ValueType>>& getRowOfMatrix(ActionType const& row);
78
79 std::vector<storm::storage::MatrixEntry<StateType, ValueType>> const& getRowOfMatrix(ActionType const& row) const;
80
81 void addActionsToMatrix(std::size_t const& count);
82
83 bool maximize() const;
84
85 bool minimize() const;
86
87 bool performPrecomputationExcessiveExplorationSteps(std::size_t& numberExplorationStepsSinceLastPrecomputation) const;
88
89 bool performPrecomputationExcessiveSampledPaths(std::size_t& numberOfSampledPathsSinceLastPrecomputation) const;
90
91 bool useLocalPrecomputation() const;
92
93 bool useGlobalPrecomputation() const;
94
96
98
99 bool useProbabilityHeuristic() const;
100
101 bool useUniformHeuristic() const;
102
104
106
107 private:
108 MatrixType matrix;
109 std::vector<StateType> rowGroupIndices;
110
111 std::vector<StateType> stateToRowGroupMapping;
112 StateType unexploredMarker;
113 IdToStateMap unexploredStates;
114
115 storm::OptimizationDirection optimizationDirection;
116 StateSet terminalStates;
117
118 bool localPrecomputation;
119 std::size_t numberOfExplorationStepsUntilPrecomputation;
120 boost::optional<std::size_t> numberOfSampledPathsUntilPrecomputation;
121
123};
124} // namespace exploration_detail
125} // namespace modelchecker
126} // namespace storm
127
128#endif /* STORM_MODELCHECKER_EXPLORATION_EXPLORATION_DETAIL_EXPLORATIONINFORMATION_H_ */
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
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:18
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
LabParser.cpp.
Definition cli.cpp:18