1#ifndef STORM_STORAGE_DISTRIBUTION_H_
2#define STORM_STORAGE_DISTRIBUTION_H_
4#include <boost/container/flat_map.hpp>
15template<
typename ValueType,
typename StateType = u
int32_t>
19 typedef typename container_type::iterator
iterator;
57 void addProbability(StateType
const& state, ValueType
const& probability);
79 void shiftProbability(StateType
const& fromState, StateType
const& toState, ValueType
const& probability,
131 void scale(StateType
const& state);
136 std::size_t
size()
const;
168template<
typename ValueType,
typename StateType = u
int32_t>
175template<
typename ValueType>
176struct hash<
storm::storage::Distribution<ValueType>> {
178 return (distribution.getHash());
iterator end()
Retrieves an iterator past the elements in this distribution.
void reserve(uint64_t size)
void addProbability(StateType const &state, ValueType const &probability)
Assigns the given state the given probability under this distribution.
Distribution & operator=(Distribution &&other)=default
boost::container::flat_map< StateType, ValueType > container_type
const_iterator cend() const
Retrieves an iterator past the elements in this distribution.
bool less(Distribution< ValueType, StateType > const &other, storm::utility::ConstantsComparator< ValueType > const &comparator) const
void shiftProbability(StateType const &fromState, StateType const &toState, ValueType const &probability, storm::utility::ConstantsComparator< ValueType > const &comparator=storm::utility::ConstantsComparator< ValueType >())
Removes the probability mass from one state and adds it to another.
Distribution(Distribution const &other)=default
void normalize()
Normalizes the distribution such that the values sum up to one.
Distribution(Distribution &&other)=default
bool equals(Distribution< ValueType, StateType > const &other, storm::utility::ConstantsComparator< ValueType > const &comparator=storm::utility::ConstantsComparator< ValueType >()) const
Checks whether the two distributions specify the same probabilities to go to the same states.
container_type::const_iterator const_iterator
const_iterator cbegin() const
Retrieves an iterator to the elements in this distribution.
void removeProbability(StateType const &state, ValueType const &probability, storm::utility::ConstantsComparator< ValueType > const &comparator=storm::utility::ConstantsComparator< ValueType >())
Removes the given probability mass of going to the given state.
std::size_t size() const
Retrieves the size of the distribution, i.e.
StateType sampleFromDistribution(ValueType const &quantile) const
Given a value q, find the event in the ordered distribution that corresponds to this prob.
iterator begin()
Retrieves an iterator to the elements in this distribution.
ValueType getProbability(StateType const &state) const
Returns the probability of the given state.
Distribution()
Creates an empty distribution.
container_type::iterator iterator
void add(Distribution const &other)
Adds the given distribution to the current one.
void scale(StateType const &state)
Scales the distribution by multiplying all the probabilities with 1/p where p is the probability of m...
Distribution & operator=(Distribution const &other)=default
std::ostream & operator<<(std::ostream &out, ParameterRegion< ParametricType > const ®ion)