Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::generator::Choice< ValueType, StateType > Struct Template Reference

#include <Choice.h>

Public Member Functions

 Choice (uint_fast64_t actionIndex=0, bool markovian=false)
 
 Choice (Choice const &other)=default
 
Choiceoperator= (Choice const &other)=default
 
 Choice (Choice &&other)=default
 
Choiceoperator= (Choice &&other)=default
 
void add (Choice const &other)
 Adds the given choice to the current one.
 
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.
 
storm::storage::Distribution< ValueType, StateType >::const_iterator begin () const
 Returns an iterator to the distribution associated with this choice.
 
storm::storage::Distribution< ValueType, StateType >::iterator end ()
 Returns an iterator past the end of the distribution associated with this choice.
 
storm::storage::Distribution< ValueType, StateType >::const_iterator end () const
 Returns an iterator past the end of the distribution associated with this choice.
 
void addLabel (std::string const &label)
 Adds the given label to the labels 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 hasLabels () const
 Returns whether there are labels defined for this choice.
 
std::set< std::string > const & getLabels () const
 Retrieves the set of labels associated with this choice.
 
void setPlayerIndex (storm::storage::PlayerIndex const &playerIndex)
 Sets the players index.
 
bool hasPlayerIndex () const
 Returns whether there is an index for the player defined for this choice.
 
storm::storage::PlayerIndex const & getPlayerIndex () const
 Retrieves the players index associated with this choice.
 
void addOriginData (boost::any const &data)
 Adds the given data that specifies the origin of this choice w.r.t.
 
bool hasOriginData () const
 Returns whether there is origin data defined for this choice.
 
boost::any const & getOriginData () const
 Returns the origin data associated with this choice.
 
uint_fast64_t getActionIndex () const
 Retrieves the index of the action of this choice.
 
ValueType getTotalMass () const
 Retrieves the total mass of 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.
 
void addRewards (std::vector< ValueType > &&values)
 Adds the given choices rewards to this choice.
 
std::vector< ValueType > const & getRewards () const
 Retrieves the rewards for this choice under selected reward models.
 
bool isMarkovian () const
 Retrieves whether the choice is Markovian.
 
std::size_t size () const
 Retrieves the size of the distribution associated with this choice.
 
void reserve (std::size_t const &size)
 If the size is already known, reserves space in the underlying distribution.
 

Friends

template<typename ValueTypePrime , typename StateTypePrime >
std::ostream & operator<< (std::ostream &out, Choice< ValueTypePrime, StateTypePrime > const &choice)
 Inserts the contents of this object to the given output stream.
 

Detailed Description

template<typename ValueType, typename StateType = uint32_t>
struct storm::generator::Choice< ValueType, StateType >

Definition at line 19 of file Choice.h.

Constructor & Destructor Documentation

◆ Choice() [1/3]

template<typename ValueType , typename StateType >
storm::generator::Choice< ValueType, StateType >::Choice ( uint_fast64_t  actionIndex = 0,
bool  markovian = false 
)

Definition at line 16 of file Choice.cpp.

◆ Choice() [2/3]

template<typename ValueType , typename StateType = uint32_t>
storm::generator::Choice< ValueType, StateType >::Choice ( Choice< ValueType, StateType > const &  other)
default

◆ Choice() [3/3]

template<typename ValueType , typename StateType = uint32_t>
storm::generator::Choice< ValueType, StateType >::Choice ( Choice< ValueType, StateType > &&  other)
default

Member Function Documentation

◆ add()

template<typename ValueType , typename StateType >
void storm::generator::Choice< ValueType, StateType >::add ( Choice< ValueType, StateType > const &  other)

Adds the given choice to the current one.

Definition at line 22 of file Choice.cpp.

◆ addLabel()

template<typename ValueType , typename StateType >
void storm::generator::Choice< ValueType, StateType >::addLabel ( std::string const &  label)

Adds the given label to the labels associated with this choice.

Parameters
labelThe label to associate with this choice.

Definition at line 74 of file Choice.cpp.

◆ addLabels()

template<typename ValueType , typename StateType >
void storm::generator::Choice< ValueType, StateType >::addLabels ( std::set< std::string > const &  labels)

Adds the given label set to the labels associated with this choice.

Parameters
labelSetThe label set to associate with this choice.

Definition at line 82 of file Choice.cpp.

◆ addOriginData()

template<typename ValueType , typename StateType >
void storm::generator::Choice< ValueType, StateType >::addOriginData ( boost::any const &  data)

Adds the given data that specifies the origin of this choice w.r.t.

the model specification

Definition at line 116 of file Choice.cpp.

◆ addProbability()

template<typename ValueType , typename StateType >
void storm::generator::Choice< ValueType, StateType >::addProbability ( StateType const &  state,
ValueType const &  value 
)

Adds the given probability value to the given state in the underlying distribution.

Definition at line 158 of file Choice.cpp.

◆ addReward()

template<typename ValueType , typename StateType >
void storm::generator::Choice< ValueType, StateType >::addReward ( ValueType const &  value)

Adds the given value to the reward associated with this choice.

Definition at line 164 of file Choice.cpp.

◆ addRewards()

template<typename ValueType , typename StateType >
void storm::generator::Choice< ValueType, StateType >::addRewards ( std::vector< ValueType > &&  values)

Adds the given choices rewards to this choice.

Definition at line 169 of file Choice.cpp.

◆ begin() [1/2]

template<typename ValueType , typename StateType >
storm::storage::Distribution< ValueType, StateType >::iterator storm::generator::Choice< ValueType, StateType >::begin ( )

Returns an iterator to the distribution associated with this choice.

Returns
An iterator to the first element of the distribution.

Definition at line 54 of file Choice.cpp.

◆ begin() [2/2]

template<typename ValueType , typename StateType >
storm::storage::Distribution< ValueType, StateType >::const_iterator storm::generator::Choice< ValueType, StateType >::begin ( ) const

Returns an iterator to the distribution associated with this choice.

Returns
An iterator to the first element of the distribution.

Definition at line 59 of file Choice.cpp.

◆ end() [1/2]

template<typename ValueType , typename StateType >
storm::storage::Distribution< ValueType, StateType >::iterator storm::generator::Choice< ValueType, StateType >::end ( )

Returns an iterator past the end of the distribution associated with this choice.

Returns
An iterator past the end of the distribution.

Definition at line 64 of file Choice.cpp.

◆ end() [2/2]

template<typename ValueType , typename StateType >
storm::storage::Distribution< ValueType, StateType >::const_iterator storm::generator::Choice< ValueType, StateType >::end ( ) const

Returns an iterator past the end of the distribution associated with this choice.

Returns
An iterator past the end of the distribution.

Definition at line 69 of file Choice.cpp.

◆ getActionIndex()

template<typename ValueType , typename StateType >
uint_fast64_t storm::generator::Choice< ValueType, StateType >::getActionIndex ( ) const

Retrieves the index of the action of this choice.

Returns
The index of the action of this choice.

Definition at line 148 of file Choice.cpp.

◆ getLabels()

template<typename ValueType , typename StateType >
std::set< std::string > const & storm::generator::Choice< ValueType, StateType >::getLabels ( ) const

Retrieves the set of labels associated with this choice.

Returns
The set of labels associated with this choice.

Definition at line 96 of file Choice.cpp.

◆ getOriginData()

template<typename ValueType , typename StateType >
boost::any const & storm::generator::Choice< ValueType, StateType >::getOriginData ( ) const

Returns the origin data associated with this choice.

Definition at line 143 of file Choice.cpp.

◆ getPlayerIndex()

template<typename ValueType , typename StateType >
storm::storage::PlayerIndex const & storm::generator::Choice< ValueType, StateType >::getPlayerIndex ( ) const

Retrieves the players index associated with this choice.

Returns
The player index associated with this choice.

Definition at line 111 of file Choice.cpp.

◆ getRewards()

template<typename ValueType , typename StateType >
std::vector< ValueType > const & storm::generator::Choice< ValueType, StateType >::getRewards ( ) const

Retrieves the rewards for this choice under selected reward models.

Definition at line 174 of file Choice.cpp.

◆ getTotalMass()

template<typename ValueType , typename StateType >
ValueType storm::generator::Choice< ValueType, StateType >::getTotalMass ( ) const

Retrieves the total mass of this choice.

Returns
The total mass.

Definition at line 153 of file Choice.cpp.

◆ hasLabels()

template<typename ValueType , typename StateType >
bool storm::generator::Choice< ValueType, StateType >::hasLabels ( ) const

Returns whether there are labels defined for this choice.

Definition at line 91 of file Choice.cpp.

◆ hasOriginData()

template<typename ValueType , typename StateType >
bool storm::generator::Choice< ValueType, StateType >::hasOriginData ( ) const

Returns whether there is origin data defined for this choice.

Definition at line 138 of file Choice.cpp.

◆ hasPlayerIndex()

template<typename ValueType , typename StateType >
bool storm::generator::Choice< ValueType, StateType >::hasPlayerIndex ( ) const

Returns whether there is an index for the player defined for this choice.

Definition at line 106 of file Choice.cpp.

◆ isMarkovian()

template<typename ValueType , typename StateType >
bool storm::generator::Choice< ValueType, StateType >::isMarkovian ( ) const

Retrieves whether the choice is Markovian.

Definition at line 179 of file Choice.cpp.

◆ operator=() [1/2]

template<typename ValueType , typename StateType = uint32_t>
Choice & storm::generator::Choice< ValueType, StateType >::operator= ( Choice< ValueType, StateType > &&  other)
default

◆ operator=() [2/2]

template<typename ValueType , typename StateType = uint32_t>
Choice & storm::generator::Choice< ValueType, StateType >::operator= ( Choice< ValueType, StateType > const &  other)
default

◆ reserve()

template<typename ValueType , typename StateType >
void storm::generator::Choice< ValueType, StateType >::reserve ( std::size_t const &  size)

If the size is already known, reserves space in the underlying distribution.

Definition at line 189 of file Choice.cpp.

◆ sampleFromDistribution()

template<typename ValueType , typename StateType >
StateType storm::generator::Choice< ValueType, StateType >::sampleFromDistribution ( ValueType const &  quantile) const

Given a value q, find the event in the ordered distribution that corresponds to this prob.

Example: Given a (sub)distribution { x -> 0.4, y -> 0.3, z -> 0.2 }, A value q in [0,0.4] yields x, q in [0.4, 0.7] yields y, and q in [0.7, 0.9] yields z. Any other value for q yields undefined behavior.

Parameters
quantileq, a value in the CDF.
Returns
A state

Definition at line 49 of file Choice.cpp.

◆ setPlayerIndex()

template<typename ValueType , typename StateType >
void storm::generator::Choice< ValueType, StateType >::setPlayerIndex ( storm::storage::PlayerIndex const &  playerIndex)

Sets the players index.

Parameters
Theplayer index associated with this choice.

Definition at line 101 of file Choice.cpp.

◆ size()

template<typename ValueType , typename StateType >
std::size_t storm::generator::Choice< ValueType, StateType >::size ( ) const

Retrieves the size of the distribution associated with this choice.

Definition at line 184 of file Choice.cpp.

Friends And Related Symbol Documentation

◆ operator<<

template<typename ValueType , typename StateType = uint32_t>
template<typename ValueTypePrime , typename StateTypePrime >
std::ostream & operator<< ( std::ostream &  out,
Choice< ValueTypePrime, StateTypePrime > const &  choice 
)
friend

Inserts the contents of this object to the given output stream.

Parameters
outThe stream in which to insert the contents.

The documentation for this struct was generated from the following files: