Browse Source

simulating with rationals

tempestpy_adaptions
Sebastian Junges 4 years ago
parent
commit
f9ee3d10e4
  1. 4
      src/storm/models/ModelBase.cpp
  2. 7
      src/storm/models/ModelBase.h
  3. 5
      src/storm/models/sparse/Pomdp.cpp
  4. 2
      src/storm/models/sparse/Pomdp.h
  5. 4
      src/storm/simulator/DiscreteTimeSparseModelSimulator.cpp

4
src/storm/models/ModelBase.cpp

@ -35,6 +35,10 @@ namespace storm {
} }
return false; return false;
} }
bool ModelBase::isPartiallyObservable() const {
return false;
}
bool ModelBase::supportsParameters() const { bool ModelBase::supportsParameters() const {
return false; return false;

7
src/storm/models/ModelBase.h

@ -140,7 +140,12 @@ namespace storm {
* @return True iff the model is exact. * @return True iff the model is exact.
*/ */
virtual bool isExact() const; virtual bool isExact() const;
/*
* Checks whether the model is partially observable
*/
virtual bool isPartiallyObservable() const;
/*! /*!
* Converts the transition rewards of all reward models to state-based rewards. For deterministic models, * Converts the transition rewards of all reward models to state-based rewards. For deterministic models,
* this reduces the rewards to state rewards only. For nondeterminstic models, the reward models will * this reduces the rewards to state rewards only. For nondeterminstic models, the reward models will

5
src/storm/models/sparse/Pomdp.cpp

@ -125,6 +125,11 @@ namespace storm {
this->canonicFlag = newValue; this->canonicFlag = newValue;
} }
template<typename ValueType, typename RewardModelType>
bool Pomdp<ValueType, RewardModelType>::isPartiallyObservable() const {
return true;
}
template<typename ValueType, typename RewardModelType> template<typename ValueType, typename RewardModelType>
std::size_t Pomdp<ValueType, RewardModelType>::hash() const { std::size_t Pomdp<ValueType, RewardModelType>::hash() const {

2
src/storm/models/sparse/Pomdp.h

@ -90,6 +90,8 @@ namespace storm {
virtual std::size_t hash() const override; virtual std::size_t hash() const override;
virtual bool isPartiallyObservable() const override;
protected: protected:
/*! /*!
* Return a string that is additonally added to the state information in the dot stream. * Return a string that is additonally added to the state information in the dot stream.

4
src/storm/simulator/DiscreteTimeSparseModelSimulator.cpp

@ -18,7 +18,7 @@ namespace storm {
template<typename ValueType, typename RewardModelType> template<typename ValueType, typename RewardModelType>
void DiscreteTimeSparseModelSimulator<ValueType,RewardModelType>::setSeed(uint64_t seed) { void DiscreteTimeSparseModelSimulator<ValueType,RewardModelType>::setSeed(uint64_t seed) {
generator = storm::utility::RandomProbabilityGenerator<double>(seed);
generator = storm::utility::RandomProbabilityGenerator<ValueType>(seed);
} }
template<typename ValueType, typename RewardModelType> template<typename ValueType, typename RewardModelType>
@ -89,5 +89,7 @@ namespace storm {
} }
template class DiscreteTimeSparseModelSimulator<double>; template class DiscreteTimeSparseModelSimulator<double>;
template class DiscreteTimeSparseModelSimulator<storm::RationalNumber>;
} }
} }
Loading…
Cancel
Save