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 (
auto const iter : prob1States) {
30 std::set<std::string> labelSet =
pomdp.getStateLabeling().getLabelsOfState(iter);
31 for (
auto const &label : labelSet) {
39 for (
auto const 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 (
auto const 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)) {
70 uint64_t currentRow = 0;
71 uint64_t currentRowGroup = 0;
76 newObservations.push_back(0);
79 if (!prob0States.
empty()) {
84 newObservations.push_back(1);
87 auto transitionMatrix =
pomdp.getTransitionMatrix();
89 for (
auto const iter : unknownStates) {
93 for (uint64_t row = 0; row < transitionMatrix.getRowGroupSize(iter); ++row) {
94 std::map<uint64_t, ValueType> transitionsInAction;
95 for (
auto const &entry : transitionMatrix.getRow(iter, row)) {
97 transitionsInAction[stateMap[entry.getColumn()]] += entry.getValue();
99 for (
auto const &transition : transitionsInAction) {
100 smb.
addNextValue(currentRow, transition.first, transition.second);
105 newObservations.push_back(observationMap[
pomdp.getObservation(iter)]);
108 auto newTransitionMatrix = smb.
build(currentRow, newNrOfStates, currentRowGroup);
113 return std::make_shared<storm::models::sparse::Pomdp<ValueType>>(std::move(components),
true);