16 std::map<uint64_t, uint64_t> stateMap;
17 std::map<uint32_t, uint32_t> observationMap;
19 uint64_t nrNewStates = prob0States.
empty() ? 1 : 2;
24 std::vector<uint32_t> newObservations;
27 for (uint64_t iter : prob1States) {
30 std::set<std::string> labelSet =
pomdp.getStateLabeling().getLabelsOfState(iter);
31 for (
auto const &label : labelSet) {
39 for (uint64_t iter : prob0States) {
41 for (
auto const &label :
pomdp.getStateLabeling().getLabelsOfState(iter)) {
51 uint64_t newId = prob0States.
empty() ? 1 : 2;
52 uint64_t nextObservation = prob0States.
empty() ? 1 : 2;
53 for (uint64_t iter : unknownStates) {
54 stateMap[iter] = newId;
55 if (observationMap.count(
pomdp.getObservation(iter)) == 0) {
56 observationMap[
pomdp.getObservation(iter)] = nextObservation;
59 for (
auto const &label :
pomdp.getStateLabeling().getLabelsOfState(iter)) {
68 uint64_t currentRow = 0;
69 uint64_t currentRowGroup = 0;
74 newObservations.push_back(0);
77 if (!prob0States.
empty()) {
82 newObservations.push_back(1);
85 auto transitionMatrix =
pomdp.getTransitionMatrix();
87 for (uint64_t iter : unknownStates) {
91 for (uint64_t row = 0; row < transitionMatrix.getRowGroupSize(iter); ++row) {
92 std::map<uint64_t, ValueType> transitionsInAction;
93 for (
auto const &entry : transitionMatrix.getRow(iter, row)) {
95 transitionsInAction[stateMap[entry.getColumn()]] += entry.getValue();
97 for (
auto const &transition : transitionsInAction) {
98 smb.
addNextValue(currentRow, transition.first, transition.second);
103 newObservations.push_back(observationMap[
pomdp.getObservation(iter)]);
107 auto newTransitionMatrix = smb.
build(currentRow, currentRowGroup, currentRowGroup);
112 return std::make_shared<storm::models::sparse::Pomdp<ValueType>>(std::move(components),
true);