20 changed files with 194 additions and 43 deletions
			
			
		- 
					2src/storm/builder/ExplicitModelBuilder.cpp
 - 
					5src/storm/generator/JaniNextStateGenerator.cpp
 - 
					1src/storm/generator/JaniNextStateGenerator.h
 - 
					4src/storm/generator/NextStateGenerator.h
 - 
					6src/storm/generator/PrismNextStateGenerator.cpp
 - 
					1src/storm/generator/PrismNextStateGenerator.h
 - 
					3src/storm/models/sparse/Mdp.cpp
 - 
					35src/storm/models/sparse/Pomdp.cpp
 - 
					61src/storm/models/sparse/Pomdp.h
 - 
					24src/storm/parser/PrismParser.cpp
 - 
					39src/storm/parser/PrismParser.h
 - 
					4src/storm/storage/prism/BooleanVariable.cpp
 - 
					2src/storm/storage/prism/BooleanVariable.h
 - 
					4src/storm/storage/prism/IntegerVariable.cpp
 - 
					2src/storm/storage/prism/IntegerVariable.h
 - 
					6src/storm/storage/prism/Program.cpp
 - 
					7src/storm/storage/prism/Program.h
 - 
					8src/storm/storage/prism/Variable.cpp
 - 
					14src/storm/storage/prism/Variable.h
 - 
					3src/storm/utility/builder.cpp
 
@ -0,0 +1,35 @@ | 
			
		|||||
 | 
				#include "storm/models/sparse/Pomdp.h"
 | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				namespace storm { | 
			
		||||
 | 
				    namespace models { | 
			
		||||
 | 
				        namespace sparse { | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				            template <typename ValueType, typename RewardModelType> | 
			
		||||
 | 
				            Pomdp<ValueType, RewardModelType>::Pomdp(storm::storage::SparseMatrix<ValueType> const &transitionMatrix, storm::models::sparse::StateLabeling const &stateLabeling, std::unordered_map <std::string, RewardModelType> const &rewardModels) : Mdp<ValueType, RewardModelType>(transitionMatrix, stateLabeling, rewardModels) { | 
			
		||||
 | 
				                // Intentionally left blank.
 | 
			
		||||
 | 
				            } | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				            template <typename ValueType, typename RewardModelType> | 
			
		||||
 | 
				            Pomdp<ValueType, RewardModelType>::Pomdp(storm::storage::SparseMatrix<ValueType> &&transitionMatrix, storm::models::sparse::StateLabeling &&stateLabeling, std::unordered_map <std::string, RewardModelType> &&rewardModels) : Mdp<ValueType, RewardModelType>(transitionMatrix, stateLabeling, rewardModels) { | 
			
		||||
 | 
				                // Intentionally left empty.
 | 
			
		||||
 | 
				            } | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				            template <typename ValueType, typename RewardModelType> | 
			
		||||
 | 
				            Pomdp<ValueType, RewardModelType>::Pomdp(storm::storage::sparse::ModelComponents<ValueType, RewardModelType> const &components) : Mdp<ValueType, RewardModelType>(components) { | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				            } | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				            template <typename ValueType, typename RewardModelType> | 
			
		||||
 | 
				            Pomdp<ValueType, RewardModelType>::Pomdp(storm::storage::sparse::ModelComponents<ValueType, RewardModelType> &&components): Mdp<ValueType, RewardModelType>(components) { | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				            } | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				            template class Pomdp<double>; | 
			
		||||
 | 
				            template class Pomdp<storm::RationalNumber>; | 
			
		||||
 | 
				            template class Pomdp<double, storm::models::sparse::StandardRewardModel<storm::Interval>>; | 
			
		||||
 | 
				            template class Pomdp<storm::RationalFunction>; | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				        } | 
			
		||||
 | 
				    } | 
			
		||||
 | 
				} | 
			
		||||
@ -0,0 +1,61 @@ | 
			
		|||||
 | 
				#pragma once | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				#include "storm/models/sparse/Mdp.h" | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				#include "storm/models/sparse/StandardRewardModel.h" | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				namespace storm { | 
			
		||||
 | 
				    namespace models { | 
			
		||||
 | 
				        namespace sparse { | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				            /*! | 
			
		||||
 | 
				             * This class represents a partially observable Markov decision process. | 
			
		||||
 | 
				             */ | 
			
		||||
 | 
				            template<class ValueType, typename RewardModelType = StandardRewardModel <ValueType>> | 
			
		||||
 | 
				            class Pomdp : public Mdp<ValueType, RewardModelType> { | 
			
		||||
 | 
				            public: | 
			
		||||
 | 
				                /*! | 
			
		||||
 | 
				                 * Constructs a model from the given data. | 
			
		||||
 | 
				                 * | 
			
		||||
 | 
				                 * @param transitionMatrix The matrix representing the transitions in the model. | 
			
		||||
 | 
				                 * @param stateLabeling The labeling of the states. | 
			
		||||
 | 
				                 * @param rewardModels A mapping of reward model names to reward models. | 
			
		||||
 | 
				                 */ | 
			
		||||
 | 
				                Pomdp(storm::storage::SparseMatrix<ValueType> const &transitionMatrix, | 
			
		||||
 | 
				                      storm::models::sparse::StateLabeling const &stateLabeling, | 
			
		||||
 | 
				                      std::unordered_map <std::string, RewardModelType> const &rewardModels = std::unordered_map<std::string, RewardModelType>()); | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				                /*! | 
			
		||||
 | 
				                 * Constructs a model by moving the given data. | 
			
		||||
 | 
				                 * | 
			
		||||
 | 
				                 * @param transitionMatrix The matrix representing the transitions in the model. | 
			
		||||
 | 
				                 * @param stateLabeling The labeling of the states. | 
			
		||||
 | 
				                 * @param rewardModels A mapping of reward model names to reward models. | 
			
		||||
 | 
				                 */ | 
			
		||||
 | 
				                Pomdp(storm::storage::SparseMatrix<ValueType> &&transitionMatrix, | 
			
		||||
 | 
				                      storm::models::sparse::StateLabeling &&stateLabeling, | 
			
		||||
 | 
				                      std::unordered_map <std::string, RewardModelType> &&rewardModels = std::unordered_map<std::string, RewardModelType>()); | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				                /*! | 
			
		||||
 | 
				                 * Constructs a model from the given data. | 
			
		||||
 | 
				                 * | 
			
		||||
 | 
				                 * @param components The components for this model. | 
			
		||||
 | 
				                 */ | 
			
		||||
 | 
				                Pomdp(storm::storage::sparse::ModelComponents<ValueType, RewardModelType> const &components); | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				                Pomdp(storm::storage::sparse::ModelComponents<ValueType, RewardModelType> &&components); | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				                Pomdp(Pomdp <ValueType, RewardModelType> const &other) = default; | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				                Pomdp &operator=(Pomdp <ValueType, RewardModelType> const &other) = default; | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				                Pomdp(Pomdp <ValueType, RewardModelType> &&other) = default; | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				                Pomdp &operator=(Pomdp <ValueType, RewardModelType> &&other) = default; | 
			
		||||
 | 
				
 | 
			
		||||
 | 
				            protected: | 
			
		||||
 | 
				                StateLabeling observations; | 
			
		||||
 | 
				            }; | 
			
		||||
 | 
				        } | 
			
		||||
 | 
				    } | 
			
		||||
 | 
				} | 
			
		||||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue