Browse Source

simulating with rationals

tempestpy_adaptions
Sebastian Junges 4 years ago
parent
commit
f9ee3d10e4
  1. 4
      src/storm/models/ModelBase.cpp
  2. 5
      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

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

5
src/storm/models/ModelBase.h

@ -141,6 +141,11 @@ namespace storm {
*/
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,
* 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;
}
template<typename ValueType, typename RewardModelType>
bool Pomdp<ValueType, RewardModelType>::isPartiallyObservable() const {
return true;
}
template<typename ValueType, typename RewardModelType>
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 bool isPartiallyObservable() const override;
protected:
/*!
* 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>
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>
@ -89,5 +89,7 @@ namespace storm {
}
template class DiscreteTimeSparseModelSimulator<double>;
template class DiscreteTimeSparseModelSimulator<storm::RationalNumber>;
}
}
Loading…
Cancel
Save