11template<
typename ValueType,
typename StateType = u
int32_t>
83 typename std::vector<Choice<ValueType, StateType>>::const_iterator
begin()
const;
88 typename std::vector<Choice<ValueType, StateType>>::const_iterator
end()
const;
93 std::span<Choice<ValueType, StateType>
const>
getChoices()
const;
98 std::span<Choice<ValueType, StateType>>
getChoices();
117 std::vector<Choice<ValueType, StateType>> choices;
120 std::size_t numberOfChoices;
123 std::vector<ValueType> stateRewards;
void addChoice(Choice< ValueType, StateType > &&choice)
Adds the given choice to the behavior of the state.
void addStateReward(ValueType const &stateReward)
Adds the given state reward to the behavior of the state.
void removeLastChoices(std::size_t numberOfChoices)
Removes the last given number of choices.
bool empty() const
Retrieves whether the behavior is empty in the sense that there are no available choices.
StateBehavior & operator=(StateBehavior const &other)
std::vector< Choice< ValueType, StateType > >::const_iterator end() const
Retrieves an iterator past the choices available in the behavior.
StateBehavior()
Creates an empty behavior, i.e.
std::span< Choice< ValueType, StateType > const > getChoices() const
Retrieves the choices.
std::vector< Choice< ValueType, StateType > >::const_iterator begin() const
Retrieves an iterator to the choices available in the behavior.
bool wasExpanded() const
Retrieves whether the state was expanded.
void clearChoices()
Removes all choices (but keeps the state rewards and the allocated memory of the choices for reuse).
void addStateRewards(std::vector< ValueType > &&stateRewards)
Adds the given state rewards to the behavior of the state.
std::vector< ValueType > const & getStateRewards() const
Retrieves the list of state rewards under selected reward models.
void clear()
Resets this to an empty behavior, i.e.
std::size_t getNumberOfChoices() const
Retrieves the number of choices in the behavior.
void setExpanded(bool newValue=true)
Sets whether the state was expanded.
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.