Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
DistributionWithReward.cpp
Go to the documentation of this file.
2
5
6namespace storm {
7namespace storage {
8
9template<typename ValueType, typename StateType>
10DistributionWithReward<ValueType, StateType>::DistributionWithReward(ValueType const& reward) : Distribution<ValueType, StateType>(), reward(reward) {
11 // Intentionally left empty.
12}
13
14template<typename ValueType, typename StateType>
16 storm::utility::ConstantsComparator<ValueType> const& comparator) const {
17 if (this->reward != other.reward) {
18 return false;
19 }
20 return Distribution<ValueType, StateType>::equals(other, comparator);
21}
22
23template<typename ValueType, typename StateType>
25 storm::utility::ConstantsComparator<ValueType> const& comparator) const {
26 if (comparator.isLess(this->reward, other.reward)) {
27 return true;
28 } else if (comparator.isLess(other.reward, this->reward)) {
29 return false;
30 } else {
31 return Distribution<ValueType, StateType>::less(other, comparator);
32 }
33}
34
35template<typename ValueType, typename StateType>
37 this->reward = reward;
38}
39
40template<typename ValueType, typename StateType>
42 return reward;
43}
44
46
49
50} // namespace storage
51} // namespace storm
bool less(Distribution< ValueType, StateType > const &other, storm::utility::ConstantsComparator< ValueType > const &comparator) const
bool equals(Distribution< ValueType, StateType > const &other, storm::utility::ConstantsComparator< ValueType > const &comparator) const
Checks whether the two distributions specify the same probabilities to go to the same states.
DistributionWithReward(ValueType const &reward=storm::utility::zero< ValueType >())
Creates an empty distribution.
ValueType const & getReward() const
Retrieves the reward of this distribution.
bool less(DistributionWithReward< ValueType, StateType > const &other, storm::utility::ConstantsComparator< ValueType > const &comparator) const
bool equals(DistributionWithReward< ValueType, StateType > const &other, storm::utility::ConstantsComparator< ValueType > const &comparator) const
Checks whether the two distributions specify the same probabilities to go to the same states.
void setReward(ValueType const &reward)
Sets the reward of this distribution.
bool isLess(ValueType const &value1, ValueType const &value2) const