12template<
typename StateType,
typename ValueType>
14 : unexploredMarker(unexploredMarker),
15 optimizationDirection(direction),
16 localPrecomputation(false),
17 numberOfExplorationStepsUntilPrecomputation(100000),
18 numberOfSampledPathsUntilPrecomputation(),
19 nextStateHeuristic(
storm::
settings::modules::ExplorationSettings::NextStateHeuristic::DifferenceProbabilitySum) {
21 localPrecomputation =
settings.isLocalPrecomputationSet();
22 numberOfExplorationStepsUntilPrecomputation =
settings.getNumberOfExplorationStepsUntilPrecomputation();
23 if (
settings.isNumberOfSampledPathsUntilPrecomputationSet()) {
24 numberOfSampledPathsUntilPrecomputation =
settings.getNumberOfSampledPathsUntilPrecomputation();
27 nextStateHeuristic =
settings.getNextStateHeuristic();
30template<
typename StateType,
typename ValueType>
32 StateType
const& state)
const {
33 return unexploredStates.find(state);
36template<
typename StateType,
typename ValueType>
38 return unexploredStates.end();
41template<
typename StateType,
typename ValueType>
43 unexploredStates.erase(it);
46template<
typename StateType,
typename ValueType>
48 stateToRowGroupMapping.push_back(unexploredMarker);
49 unexploredStates[stateId] = compressedState;
52template<
typename StateType,
typename ValueType>
54 stateToRowGroupMapping[state] = rowGroup;
57template<
typename StateType,
typename ValueType>
59 stateToRowGroupMapping[state] = rowGroupIndices.
size() - 1;
60 return stateToRowGroupMapping[state];
63template<
typename StateType,
typename ValueType>
65 return rowGroupIndices.size() - 1;
68template<
typename StateType,
typename ValueType>
70 rowGroupIndices.push_back(action);
73template<
typename StateType,
typename ValueType>
78template<
typename StateType,
typename ValueType>
80 rowGroupIndices.push_back(matrix.size());
83template<
typename StateType,
typename ValueType>
85 matrix.emplace_back(std::move(matrix[action]));
88template<
typename StateType,
typename ValueType>
93template<
typename StateType,
typename ValueType>
95 return unexploredStates.size();
98template<
typename StateType,
typename ValueType>
100 return stateToRowGroupMapping.size();
103template<
typename StateType,
typename ValueType>
105 return stateToRowGroupMapping[state];
108template<
typename StateType,
typename ValueType>
110 return unexploredMarker;
113template<
typename StateType,
typename ValueType>
115 return stateToRowGroupMapping[state] == unexploredMarker;
118template<
typename StateType,
typename ValueType>
120 return terminalStates.find(state) != terminalStates.end();
123template<
typename StateType,
typename ValueType>
125 StateType
const& group)
const {
126 return rowGroupIndices[group];
129template<
typename StateType,
typename ValueType>
131 return rowGroupIndices[group + 1] - rowGroupIndices[group];
134template<
typename StateType,
typename ValueType>
139template<
typename StateType,
typename ValueType>
141 terminalStates.insert(state);
144template<
typename StateType,
typename ValueType>
149template<
typename StateType,
typename ValueType>
155template<
typename StateType,
typename ValueType>
157 matrix.resize(matrix.size() + count);
160template<
typename StateType,
typename ValueType>
162 return optimizationDirection == storm::OptimizationDirection::Maximize;
165template<
typename StateType,
typename ValueType>
170template<
typename StateType,
typename ValueType>
172 std::size_t& numberExplorationStepsSinceLastPrecomputation)
const {
173 bool result = numberExplorationStepsSinceLastPrecomputation > numberOfExplorationStepsUntilPrecomputation;
175 numberExplorationStepsSinceLastPrecomputation = 0;
180template<
typename StateType,
typename ValueType>
182 if (!numberOfSampledPathsUntilPrecomputation) {
185 bool result = numberOfSampledPathsSinceLastPrecomputation > numberOfSampledPathsUntilPrecomputation.get();
187 numberOfSampledPathsSinceLastPrecomputation = 0;
193template<
typename StateType,
typename ValueType>
195 return localPrecomputation;
198template<
typename StateType,
typename ValueType>
203template<
typename StateType,
typename ValueType>
205 return nextStateHeuristic;
208template<
typename StateType,
typename ValueType>
213template<
typename StateType,
typename ValueType>
218template<
typename StateType,
typename ValueType>
223template<
typename StateType,
typename ValueType>
225 return optimizationDirection;
228template<
typename StateType,
typename ValueType>
230 optimizationDirection = direction;
This class represents the exploration settings.
@ DifferenceProbabilitySum
size_t size() const
Retrieves the number of bits this bit vector can store.
storm::storage::BitVector CompressedState
SettingsType const & getModule()
Get module.
solver::OptimizationDirection OptimizationDirection