diff --git a/src/storm-pomdp/builder/BeliefMdpExplorer.cpp b/src/storm-pomdp/builder/BeliefMdpExplorer.cpp index 8fc481852..d9179b295 100644 --- a/src/storm-pomdp/builder/BeliefMdpExplorer.cpp +++ b/src/storm-pomdp/builder/BeliefMdpExplorer.cpp @@ -2,11 +2,20 @@ namespace storm { namespace builder { + template + BeliefMdpExplorer::SuccessorObservationInformation::SuccessorObservationInformation(ValueType const &obsProb, ValueType const &maxProb, uint64_t const &count) : observationProbability(obsProb), maxProbabilityToSuccessorWithObs(maxProb), successorWithObsCount(count) { + // Intentionally left empty. + } + + template + void BeliefMdpExplorer::SuccessorObservationInformation::join(SuccessorObservationInformation other) { /// Does not join support (for performance reasons) + observationProbability += other.observationProbability; + maxProbabilityToSuccessorWithObs = std::max(maxProbabilityToSuccessorWithObs, other.maxProbabilityToSuccessorWithObs); + successorWithObsCount += other.successorWithObsCount; + } template - BeliefMdpExplorer::BeliefMdpExplorer(std::shared_ptr beliefManager, - storm::pomdp::modelchecker::TrivialPomdpValueBounds const &pomdpValueBounds) : beliefManager( - beliefManager), pomdpValueBounds(pomdpValueBounds), status(Status::Uninitialized) { + BeliefMdpExplorer::BeliefMdpExplorer(std::shared_ptr beliefManager,storm::pomdp::modelchecker::TrivialPomdpValueBounds const &pomdpValueBounds) : beliefManager(beliefManager), pomdpValueBounds(pomdpValueBounds), status(Status::Uninitialized) { // Intentionally left empty } diff --git a/src/storm-pomdp/builder/BeliefMdpExplorer.h b/src/storm-pomdp/builder/BeliefMdpExplorer.h index 8643142fa..5b8b33bb5 100644 --- a/src/storm-pomdp/builder/BeliefMdpExplorer.h +++ b/src/storm-pomdp/builder/BeliefMdpExplorer.h @@ -32,6 +32,15 @@ namespace storm { typedef typename BeliefManagerType::BeliefId BeliefId; typedef uint64_t MdpStateType; + struct SuccessorObservationInformation { + SuccessorObservationInformation(ValueType const &obsProb, ValueType const &maxProb, uint64_t const &count); + void join(SuccessorObservationInformation other); + ValueType observationProbability; /// The probability we move to the corresponding observation. + ValueType maxProbabilityToSuccessorWithObs; /// The maximal probability to move to a successor with the corresponding observation. + uint64_t successorWithObsCount; /// The number of successor beliefstates with this observation + typename BeliefManagerType::BeliefSupportType support; + }; + enum class Status { Uninitialized, Exploring, @@ -150,25 +159,6 @@ namespace storm { MdpStateType getBeliefId(MdpStateType exploredMdpState) const; - struct SuccessorObservationInformation { - SuccessorObservationInformation(ValueType const &obsProb, ValueType const &maxProb, uint64_t const &count) : observationProbability(obsProb), - maxProbabilityToSuccessorWithObs(maxProb), - successorWithObsCount(count) { - // Intentionally left empty. - } - - void join(SuccessorObservationInformation other) { /// Does not join support (for performance reasons) - observationProbability += other.observationProbability; - maxProbabilityToSuccessorWithObs = std::max(maxProbabilityToSuccessorWithObs, other.maxProbabilityToSuccessorWithObs); - successorWithObsCount += other.successorWithObsCount; - } - - ValueType observationProbability; /// The probability we move to the corresponding observation. - ValueType maxProbabilityToSuccessorWithObs; /// The maximal probability to move to a successor with the corresponding observation. - uint64_t successorWithObsCount; /// The number of successor beliefstates with this observation - typename BeliefManagerType::BeliefSupportType support; - }; - void gatherSuccessorObservationInformationAtCurrentState(uint64_t localActionIndex, std::map &gatheredSuccessorObservations); void gatherSuccessorObservationInformationAtMdpChoice(uint64_t mdpChoice, std::map &gatheredSuccessorObservations);