CRAAM
2.0.0
Robust and Approximate Markov Decision Processes
|
A class that manages creation and access to outcomes to be used by actions. More...
#include <Action.hpp>
Public Member Functions | |
OutcomeManagement () | |
Empty list of outcomes. | |
OutcomeManagement (const vector< Transition > &outcomes) | |
Initializes with a list of outcomes. | |
virtual | ~OutcomeManagement () |
Empty virtual destructor. | |
virtual Transition & | create_outcome (long outcomeid) |
Adds a sufficient number of empty outcomes for the outcomeid to be a valid identifier. More... | |
virtual Transition & | create_outcome () |
Creates a new outcome at the end. More... | |
const Transition & | get_outcome (long outcomeid) const |
Returns a transition for the outcome. More... | |
Transition & | get_outcome (long outcomeid) |
Returns a transition for the outcome. More... | |
const Transition & | operator[] (long outcomeid) const |
Returns a transition for the outcome. More... | |
Transition & | operator[] (long outcomeid) |
Returns a transition for the outcome. More... | |
size_t | outcome_count () const |
Returns number of outcomes. More... | |
size_t | size () const |
Returns number of outcomes. More... | |
void | add_outcome (long outcomeid, const Transition &t) |
Adds an outcome defined by the transition. More... | |
void | add_outcome (const Transition &t) |
Adds an outcome defined by the transition as the last outcome. More... | |
const vector< Transition > & | get_outcomes () const |
Returns the list of outcomes. | |
void | normalize () |
Normalizes transitions for outcomes. | |
bool | is_nature_correct (numvec oid) const |
Whether the provided outcomeid is correct. | |
void | to_string (string &result) const |
Appends a string representation to the argument. | |
Protected Attributes | |
vector< Transition > | outcomes |
List of possible outcomes. | |
A class that manages creation and access to outcomes to be used by actions.
|
inline |
Adds an outcome defined by the transition.
outcomeid | Id of the new outcome. Intermediate ids are created empty |
t | Transition that defines the outcome |
|
inline |
Adds an outcome defined by the transition as the last outcome.
t | Transition that defines the outcome |
|
inlinevirtual |
Adds a sufficient number of empty outcomes for the outcomeid to be a valid identifier.
This method is virtual to make overloading safer.
Makes the action valid.
Reimplemented in craam::WeightedOutcomeAction.
|
inlinevirtual |
Creates a new outcome at the end.
Similar to push_back.
|
inline |
Returns a transition for the outcome.
The transition must exist.
|
inline |
Returns a transition for the outcome.
The transition must exist.
|
inline |
Returns a transition for the outcome.
The transition must exist.
|
inline |
Returns a transition for the outcome.
The transition must exist.
|
inline |
Returns number of outcomes.
|
inline |
Returns number of outcomes.