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

#include <StateBehavior.h>

Public Member Functions

 StateBehavior ()
 Creates an empty behavior, i.e.
 StateBehavior (StateBehavior const &other)
 StateBehavior (StateBehavior &&other) noexcept
 Moves the content of other into this.
StateBehavior & operator= (StateBehavior const &other)
StateBehavior & operator= (StateBehavior &&other) noexcept
void clear ()
 Resets this to an empty behavior, i.e.
void clearChoices ()
 Removes all choices (but keeps the state rewards and the allocated memory of the choices for reuse).
void addChoice (Choice< ValueType, StateType > &&choice)
 Adds the given choice to the behavior of the state.
Choice< ValueType, StateType > & startNewChoice (uint_fast64_t actionIndex=0, bool markovian=false)
 Adds a new empty choice with the given action index and returns a reference to it.
void removeLastChoices (std::size_t numberOfChoices)
 Removes the last given number of choices.
void addStateReward (ValueType const &stateReward)
 Adds the given state reward to the behavior of the state.
void addStateRewards (std::vector< ValueType > &&stateRewards)
 Adds the given state rewards to the behavior of the state.
void setExpanded (bool newValue=true)
 Sets whether the state was expanded.
bool wasExpanded () const
 Retrieves whether the state was expanded.
bool empty () const
 Retrieves whether the behavior is empty in the sense that there are no available choices.
std::vector< Choice< ValueType, StateType > >::const_iterator begin () const
 Retrieves an iterator to the choices available in the behavior.
std::vector< Choice< ValueType, StateType > >::const_iterator end () const
 Retrieves an iterator past the choices available in the behavior.
std::span< Choice< ValueType, StateType > const > getChoices () const
 Retrieves the choices.
std::span< Choice< ValueType, StateType > > getChoices ()
 Retrieves the choices.
std::vector< ValueType > const & getStateRewards () const
 Retrieves the list of state rewards under selected reward models.
std::vector< ValueType > & getStateRewards ()
 Retrieves the list of state rewards under selected reward models.
std::size_t getNumberOfChoices () const
 Retrieves the number of choices in the behavior.

Detailed Description

template<typename ValueType, typename StateType = uint32_t>
class storm::generator::StateBehavior< ValueType, StateType >

Definition at line 12 of file StateBehavior.h.

Constructor & Destructor Documentation

◆ StateBehavior() [1/3]

template<typename ValueType, typename StateType>
storm::generator::StateBehavior< ValueType, StateType >::StateBehavior ( )

Creates an empty behavior, i.e.

the state was not yet expanded.

Definition at line 15 of file StateBehavior.cpp.

◆ StateBehavior() [2/3]

template<typename ValueType, typename StateType>
storm::generator::StateBehavior< ValueType, StateType >::StateBehavior ( StateBehavior< ValueType, StateType > const & other)

Definition at line 20 of file StateBehavior.cpp.

◆ StateBehavior() [3/3]

template<typename ValueType, typename StateType>
storm::generator::StateBehavior< ValueType, StateType >::StateBehavior ( StateBehavior< ValueType, StateType > && other)
noexcept

Moves the content of other into this.

Afterwards, other is an empty behavior (as if it was cleared).

Definition at line 29 of file StateBehavior.cpp.

Member Function Documentation

◆ addChoice()

template<typename ValueType, typename StateType>
void storm::generator::StateBehavior< ValueType, StateType >::addChoice ( Choice< ValueType, StateType > && choice)

Adds the given choice to the behavior of the state.

Definition at line 80 of file StateBehavior.cpp.

◆ addStateReward()

template<typename ValueType, typename StateType>
void storm::generator::StateBehavior< ValueType, StateType >::addStateReward ( ValueType const & stateReward)

Adds the given state reward to the behavior of the state.

Definition at line 106 of file StateBehavior.cpp.

◆ addStateRewards()

template<typename ValueType, typename StateType>
void storm::generator::StateBehavior< ValueType, StateType >::addStateRewards ( std::vector< ValueType > && stateRewards)

Adds the given state rewards to the behavior of the state.

Definition at line 111 of file StateBehavior.cpp.

◆ begin()

template<typename ValueType, typename StateType>
std::vector< Choice< ValueType, StateType > >::const_iterator storm::generator::StateBehavior< ValueType, StateType >::begin ( ) const

Retrieves an iterator to the choices available in the behavior.

Definition at line 131 of file StateBehavior.cpp.

◆ clear()

template<typename ValueType, typename StateType>
void storm::generator::StateBehavior< ValueType, StateType >::clear ( )

Resets this to an empty behavior, i.e.

the state was not yet expanded. The allocated memory (including that of the choices) is kept for reuse.

Definition at line 68 of file StateBehavior.cpp.

◆ clearChoices()

template<typename ValueType, typename StateType>
void storm::generator::StateBehavior< ValueType, StateType >::clearChoices ( )

Removes all choices (but keeps the state rewards and the allocated memory of the choices for reuse).

Definition at line 75 of file StateBehavior.cpp.

◆ empty()

template<typename ValueType, typename StateType>
bool storm::generator::StateBehavior< ValueType, StateType >::empty ( ) const

Retrieves whether the behavior is empty in the sense that there are no available choices.

Definition at line 126 of file StateBehavior.cpp.

◆ end()

template<typename ValueType, typename StateType>
std::vector< Choice< ValueType, StateType > >::const_iterator storm::generator::StateBehavior< ValueType, StateType >::end ( ) const

Retrieves an iterator past the choices available in the behavior.

Definition at line 136 of file StateBehavior.cpp.

◆ getChoices() [1/2]

template<typename ValueType, typename StateType>
std::span< Choice< ValueType, StateType > > storm::generator::StateBehavior< ValueType, StateType >::getChoices ( )

Retrieves the choices.

Definition at line 146 of file StateBehavior.cpp.

◆ getChoices() [2/2]

template<typename ValueType, typename StateType>
std::span< Choice< ValueType, StateType > const > storm::generator::StateBehavior< ValueType, StateType >::getChoices ( ) const

Retrieves the choices.

Definition at line 141 of file StateBehavior.cpp.

◆ getNumberOfChoices()

template<typename ValueType, typename StateType>
std::size_t storm::generator::StateBehavior< ValueType, StateType >::getNumberOfChoices ( ) const

Retrieves the number of choices in the behavior.

Definition at line 161 of file StateBehavior.cpp.

◆ getStateRewards() [1/2]

template<typename ValueType, typename StateType>
std::vector< ValueType > & storm::generator::StateBehavior< ValueType, StateType >::getStateRewards ( )

Retrieves the list of state rewards under selected reward models.

The rewards can be modified in place.

Definition at line 156 of file StateBehavior.cpp.

◆ getStateRewards() [2/2]

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

Retrieves the list of state rewards under selected reward models.

Definition at line 151 of file StateBehavior.cpp.

◆ operator=() [1/2]

template<typename ValueType, typename StateType>
StateBehavior< ValueType, StateType > & storm::generator::StateBehavior< ValueType, StateType >::operator= ( StateBehavior< ValueType, StateType > && other)
noexcept

Definition at line 40 of file StateBehavior.cpp.

◆ operator=() [2/2]

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

Definition at line 53 of file StateBehavior.cpp.

◆ removeLastChoices()

template<typename ValueType, typename StateType>
void storm::generator::StateBehavior< ValueType, StateType >::removeLastChoices ( std::size_t numberOfChoices)

Removes the last given number of choices.

Definition at line 100 of file StateBehavior.cpp.

◆ setExpanded()

template<typename ValueType, typename StateType>
void storm::generator::StateBehavior< ValueType, StateType >::setExpanded ( bool newValue = true)

Sets whether the state was expanded.

Definition at line 116 of file StateBehavior.cpp.

◆ startNewChoice()

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

Adds a new empty choice with the given action index and returns a reference to it.

The memory of previously removed choices is reused if possible.

Note
The returned reference is invalidated when another choice is added.

Definition at line 90 of file StateBehavior.cpp.

◆ wasExpanded()

template<typename ValueType, typename StateType>
bool storm::generator::StateBehavior< ValueType, StateType >::wasExpanded ( ) const

Retrieves whether the state was expanded.

Definition at line 121 of file StateBehavior.cpp.


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