11template<
typename PomdpType,
typename BeliefType>
16template<
typename PomdpType,
typename BeliefType>
18 auto const& rewardModel = pomdp.getRewardModel(rewardModelName);
19 actionRewards = rewardModel.getTotalRewardVector(pomdp.getTransitionMatrix());
22template<
typename PomdpType,
typename BeliefType>
24 return !actionRewards.empty();
27template<
typename PomdpType,
typename BeliefType>
29 actionRewards.clear();
32template<
typename PomdpType,
typename BeliefType>
35 pomdp.getInitialStates().getNumberOfSetBits() == 1, storm::exceptions::NotSupportedException,
36 "Only a single initial state is supported, but the given POMDP contains " << pomdp.getInitialStates().getNumberOfSetBits() <<
" initial states.");
40 builder.setObservation(pomdp.getObservation(init));
44template<
typename PomdpType,
typename BeliefType>
46 auto result = pomdp.getTransitionMatrix().getRowGroupSize(belief.representativeState());
49 return pomdp.getTransitionMatrix().getRowGroupSize(state) == result;
51 "Belief considers states with inconsistent number of choices.");
55template<
typename PomdpType,
typename BeliefType>
57 uint64_t
const& localActionIndex)
const {
58 using PomdpValueType =
typename PomdpType::ValueType;
59 using BeliefValueType =
typename BeliefType::ValueType;
64 auto const& actionIndices = pomdp.getTransitionMatrix().getRowGroupIndices();
65 belief.forEach([&localActionIndex, &actionIndices, &result,
this](
BeliefStateType const& state, BeliefValueType
const& val) {
66 uint64_t
const actionIndex = actionIndices[state] + localActionIndex;
72template<
typename PomdpType,
typename BeliefType>
74 uint64_t
const& localActionIndex)
const {
75 STORM_LOG_ASSERT(pomdp.hasChoiceLabeling(),
"Requested a choice label although no choice labeling was specified in the POMDP.");
77 return pomdp.getChoiceLabeling().getLabelsOfChoice(pomdp.getTransitionMatrix().getRowGroupIndices().at(belief.representativeState()) + localActionIndex);
Represents a belief of a Pomdp, i.e.
This class implements a first-state-next-state generator interface for exploring the belief MDP of a ...
FirstStateNextStateGenerator(PomdpType const &pomdp)
Creates a successor generator for pomdp.
PomdpType::ValueType getBeliefActionReward(BeliefType const &belief, uint64_t const &localActionIndex) const
bool hasRewardModel() const
void setRewardModel(std::string const &rewardModelName="")
Selects the reward model whose expected action rewards are queried; an empty name selects the default...
std::set< std::string > getBeliefActionChoiceLabels(BeliefType const &belief, uint64_t const &localActionIndex) const
uint64_t getBeliefNumberOfActions(BeliefType const &belief) const
BeliefType computeInitialBelief() const
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
uint64_t BeliefStateType
Shared identifiers and sparse-container types used by the belief subsystem.
TargetType convertNumber(SourceType const &number)