Browse Source

State Annotation and subMDP also restrichts choicelabelling now

Former-commit-id: 0df7a93f3b
tempestpy_adaptions
sjunges 9 years ago
parent
commit
eacdec3939
  1. 9
      src/models/sparse/Mdp.cpp
  2. 16
      src/models/sparse/StateAnnotation.h

9
src/models/sparse/Mdp.cpp

@ -2,6 +2,7 @@
#include "src/exceptions/InvalidArgumentException.h"
#include "src/utility/constants.h"
#include "src/utility/vector.h"
#include "src/adapters/CarlAdapter.h"
#include "src/models/sparse/StandardRewardModel.h"
@ -81,7 +82,13 @@ namespace storm {
for (auto const& rewardModel : this->getRewardModels()) {
newRewardModels.emplace(rewardModel.first, rewardModel.second.restrictActions(enabledChoices));
}
return Mdp<ValueType, RewardModelType>(restrictedTransitions, this->getStateLabeling(), newRewardModels, this->getOptionalChoiceLabeling());
if(this->hasChoiceLabeling()) {
return Mdp<ValueType, RewardModelType>(restrictedTransitions, this->getStateLabeling(), newRewardModels, boost::optional<std::vector<LabelSet>>(storm::utility::vector::filterVector(this->getChoiceLabeling(), enabledChoices)));
} else {
return Mdp<ValueType, RewardModelType>(restrictedTransitions, this->getStateLabeling(), newRewardModels, boost::optional<std::vector<LabelSet>>());
}
}
template<typename ValueType, typename RewardModelType>

16
src/models/sparse/StateAnnotation.h

@ -0,0 +1,16 @@
#ifndef STORM_STATEANNOTATION_H
#define STORM_STATEANNOTATION_H
namespace storm {
namespace models {
namespace sparse {
class StateAnnotation {
public:
virtual std::string stateInfo(uint_fast64_t s) const = 0;
};
}
}
}
#endif //STORM_STATEANNOTATION_H
Loading…
Cancel
Save