1#ifndef STORM_GENERATOR_CHOICE_H_
2#define STORM_GENERATOR_CHOICE_H_
8#include <boost/any.hpp>
9#include <boost/optional.hpp>
18template<
typename ValueType,
typename StateType = u
int32_t>
21 Choice(uint_fast64_t actionIndex = 0,
bool markovian =
false);
77 template<
typename ValueTypePrime,
typename StateTypePrime>
85 void addLabel(std::string
const& label);
92 void addLabels(std::set<std::string>
const& labels);
104 std::set<std::string>
const&
getLabels()
const;
157 void addProbability(StateType
const& state, ValueType
const& value);
167 void addRewards(std::vector<ValueType>&& values);
172 std::vector<ValueType>
const&
getRewards()
const;
182 std::size_t
size()
const;
194 uint_fast64_t actionIndex;
203 std::vector<ValueType> rewards;
206 boost::optional<boost::any> originData;
209 boost::optional<std::set<std::string>> labels;
212 boost::optional<storm::storage::PlayerIndex> playerIndex;
215template<
typename ValueType,
typename StateType>
container_type::const_iterator const_iterator
container_type::iterator iterator
std::ostream & operator<<(std::ostream &out, Choice< ValueType, StateType > const &choice)
bool hasLabels() const
Returns whether there are labels defined for this choice.
Choice(Choice const &other)=default
bool isMarkovian() const
Retrieves whether the choice is Markovian.
boost::any const & getOriginData() const
Returns the origin data associated with this choice.
void addLabel(std::string const &label)
Adds the given label to the labels associated with this choice.
uint_fast64_t getActionIndex() const
Retrieves the index of the action of this choice.
storm::storage::Distribution< ValueType, StateType >::iterator end()
Returns an iterator past the end of the distribution associated with this choice.
std::vector< ValueType > const & getRewards() const
Retrieves the rewards for this choice under selected reward models.
std::set< std::string > const & getLabels() const
Retrieves the set of labels associated with this choice.
void add(Choice const &other)
Adds the given choice to the current one.
ValueType getTotalMass() const
Retrieves the total mass of this choice.
void addOriginData(boost::any const &data)
Adds the given data that specifies the origin of this choice w.r.t.
void setPlayerIndex(storm::storage::PlayerIndex const &playerIndex)
Sets the players index.
friend std::ostream & operator<<(std::ostream &out, Choice< ValueTypePrime, StateTypePrime > const &choice)
Inserts the contents of this object to the given output stream.
storm::storage::PlayerIndex const & getPlayerIndex() const
Retrieves the players index associated with this choice.
void addLabels(std::set< std::string > const &labels)
Adds the given label set to the labels associated with this choice.
bool hasOriginData() const
Returns whether there is origin data defined for this choice.
void addRewards(std::vector< ValueType > &&values)
Adds the given choices rewards to this choice.
Choice(Choice &&other)=default
StateType sampleFromDistribution(ValueType const &quantile) const
Given a value q, find the event in the ordered distribution that corresponds to this prob.
storm::storage::Distribution< ValueType, StateType >::iterator begin()
Returns an iterator to the distribution associated with this choice.
Choice & operator=(Choice const &other)=default
void reserve(std::size_t const &size)
If the size is already known, reserves space in the underlying distribution.
bool hasPlayerIndex() const
Returns whether there is an index for the player defined for this choice.
std::size_t size() const
Retrieves the size of the distribution associated with this choice.
void addProbability(StateType const &state, ValueType const &value)
Adds the given probability value to the given state in the underlying distribution.
void addReward(ValueType const &value)
Adds the given value to the reward associated with this choice.
Choice & operator=(Choice &&other)=default