21 }
else if (in ==
"real") {
32 exportSATcalls = path;
36 return exportSATcalls;
40 return exportSATcalls !=
"";
48 return debugLevel > 0;
52 return debugLevel > 1;
56 return debugLevel > 2;
69 std::string exportSATcalls =
"";
70 uint64_t debugLevel = 0;
74 std::vector<storm::storage::BitVector>
actions;
78 void reset(uint64_t nrObservations, uint64_t nrActions) {
89 for (uint64_t obs = 0; obs < observations.
size(); ++obs) {
90 if (observations.
get(obs) || observationsAfterSwitch.
get(obs)) {
93 if (observations.
get(obs)) {
100 ss <<
" and switch.";
104 if (observationsAfterSwitch.
get(obs)) {
111template<
typename ValueType>
144 return outerIterations;
148 return graphBasedAnalysisWinOb;
152 graphBasedAnalysisWinOb++;
156 uint64_t satCalls = 0;
157 uint64_t outerIterations = 0;
158 uint64_t graphBasedAnalysisWinOb = 0;
164 std::shared_ptr<storm::utility::solver::SmtSolverFactory>& smtSolverFactory,
MemlessSearchOptions const& options);
170 STORM_LOG_TRACE(
"Questionmark states: " << (~surelyReachSinkStates & ~targetStates));
171 bool result =
analyze(k, ~surelyReachSinkStates & ~targetStates, pomdp.getInitialStates());
178 analyze(k, ~surelyReachSinkStates & ~targetStates);
183 return winningRegion;
196 STORM_LOG_INFO(
"Reset solver to restart with current winning region");
197 schedulerForObs.clear();
198 finalSchedulers.clear();
201 void printScheduler(std::vector<InternalObservationScheduler>
const&);
204 bool initialize(uint64_t k);
206 bool smtCheck(uint64_t iteration, std::set<storm::expressions::Expression>
const& assumptions = {});
208 std::unique_ptr<storm::solver::SmtSolver> smtSolver;
210 std::shared_ptr<storm::expressions::ExpressionManager> expressionManager;
211 uint64_t maxK = std::numeric_limits<uint64_t>::max();
215 std::vector<std::vector<uint64_t>> statesPerObservation;
217 std::vector<storm::expressions::Variable> schedulerVariables;
218 std::vector<storm::expressions::Expression> schedulerVariableExpressions;
219 std::vector<std::vector<storm::expressions::Expression>> actionSelectionVarExpressions;
220 std::vector<std::vector<storm::expressions::Variable>> actionSelectionVars;
222 std::vector<storm::expressions::Variable> reachVars;
223 std::vector<storm::expressions::Expression> reachVarExpressions;
224 std::vector<std::vector<storm::expressions::Expression>> reachVarExpressionsPerObservation;
226 std::vector<storm::expressions::Variable> observationUpdatedVariables;
227 std::vector<storm::expressions::Expression> observationUpdatedExpressions;
229 std::vector<storm::expressions::Variable> switchVars;
230 std::vector<storm::expressions::Expression> switchVarExpressions;
231 std::vector<storm::expressions::Variable> followVars;
232 std::vector<storm::expressions::Expression> followVarExpressions;
233 std::vector<storm::expressions::Variable> continuationVars;
234 std::vector<storm::expressions::Expression> continuationVarExpressions;
235 std::vector<std::vector<storm::expressions::Variable>> pathVars;
236 std::vector<std::vector<storm::expressions::Expression>> pathVarExpressions;
238 std::vector<InternalObservationScheduler> finalSchedulers;
239 std::vector<uint64_t> schedulerForObs;
240 WinningRegion winningRegion;
242 MemlessSearchOptions options;
245 std::shared_ptr<storm::utility::solver::SmtSolverFactory>& smtSolverFactory;
246 std::shared_ptr<WinningRegionQueryInterface<ValueType>> validator;
248 mutable bool useFindOffset =
false;
This class represents a partially observable Markov decision process.
storm::utility::Stopwatch updateNewStrategySolverTime
void incrementGraphBasedWinningObservations()
storm::utility::Stopwatch initializeSolverTimer
uint64_t getGraphBasedwinningObservations()
storm::utility::Stopwatch smtCheckTimer
storm::utility::Stopwatch evaluateExtensionSolverTime
storm::utility::Stopwatch graphSearchTime
void incrementOuterIterations()
storm::utility::Stopwatch encodeExtensionSolverTime
void incrementSmtChecks()
storm::utility::Stopwatch winningRegionUpdatesTimer
storm::utility::Stopwatch totalTimer
bool analyzeForInitialStates(uint64_t k)
void computeWinningRegion(uint64_t k)
uint64_t getOffsetFromObservation(uint64_t state, uint64_t observation) const
Statistics const & getStatistics() const
void finalizeStatistics()
WinningRegion const & getLastWinningRegion() const
bool analyze(uint64_t k, storm::storage::BitVector const &oneOfTheseStates, storm::storage::BitVector const &allOfTheseStates=storm::storage::BitVector())
bool computeInfoOutput() const
uint64_t extensionCallTimeout
std::string const & getExportSATCallsPath() const
bool computeDebugOutput() const
void setDebugLevel(uint64_t level=1)
void setExportSATCalls(std::string const &path)
bool computeTraceOutput() const
uint64_t localIterationMaximum
bool isExportSATSet() const
bool onlyDeterministicStrategies
MemlessSearchPathVariables pathVariableType
uint64_t restartAfterNIterations
A bit vector that is internally represented as a vector of 64-bit values.
void clear()
Removes all set bits from the bit vector.
size_t size() const
Retrieves the number of bits this bit vector can store.
bool get(uint64_t index) const
Retrieves the truth value of the bit at the given index and performs a bound check.
A class that provides convenience operations to display run times.
void start()
Start stopwatch (again) and start measuring time.
void stop()
Stop stopwatch and add measured time to total time.
#define STORM_LOG_INFO(message)
#define STORM_LOG_TRACE(message)
MemlessSearchPathVariables
MemlessSearchPathVariables pathVariableTypeFromString(std::string const &in)
std::vector< storm::storage::BitVector > actions
void printForObservations(storm::storage::BitVector const &observations, storm::storage::BitVector const &observationsAfterSwitch) const
std::vector< uint64_t > schedulerRef
void reset(uint64_t nrObservations, uint64_t nrActions)
storm::storage::BitVector switchObservations