Class sdm::QValueFunctionConditioning

template <class TCondition, class TState>

Class List > sdm > QValueFunctionConditioning

  • #include <qvalue_function_conditioning.hpp>

Inherits the following classes: sdm::QValueFunction

Inherited by the following classes: sdm::TabularQValueFunctionConditioning

Public Types

Type Name
typedef Pair< TCondition, TState > TInput
Initialization function. If defined, algorithms on value functions will get inital values using this function.

Public Types inherited from sdm::QValueFunction

See sdm::QValueFunction

Type Name
typedef Pair< TInput, std::shared_ptr< Action > > TGlobalInput
Initialization function. If defined, algorithms on value functions will get inital values using this function.

Public Functions

Type Name
QValueFunctionConditioning ()
QValueFunctionConditioning (number horizon)
Construct a new Incremental Value Function object.
virtual double getQValueAt (const TCondition &, const TState & state, const std::shared_ptr< Action > & action, number t) = 0
virtual double getQValueAt (const TInput & input, const std::shared_ptr< Action > & action, number t)
Get the q-value given state and action.
std::shared_ptr< QValueFunctionConditioning< TCondition, TState > > getptr ()
Get shared pointer on the current QValueFunctionConditioning<TCondition>
virtual void updateQValueAt (const TCondition &, const TState & state, const std::shared_ptr< Action > & action, number t=0) = 0
virtual void updateQValueAt (const TCondition &, const TState & state, const std::shared_ptr< Action > & action, number t, double delta) = 0
virtual void updateQValueAt (const TInput & input, const std::shared_ptr< Action > & action, number t=0)
Update the value at a given input.
virtual void updateQValueAt (const TInput & input, const std::shared_ptr< Action > & action, number t, double target)
Update the value at a given input (given a target)

Public Functions inherited from sdm::QValueFunction

See sdm::QValueFunction

Type Name
QValueFunction ()
QValueFunction (number horizon)
Construct a new Incremental Value Function object.
std::shared_ptr< Action > getBestAction (const TGlobalInput & input, number t)
Get the best action to do at a state.
virtual int getNumStates () const = 0
virtual double getQValueAt (const TInput & state, const std::shared_ptr< Action > & action, number t) = 0
Get the q-value given state and action.
virtual std::shared_ptr< VectorInterface< std::shared_ptr< Action >, double > > getQValuesAt (const TInput & state, number t) = 0
Get the q-values for all actions at a state.
double getValueAt (const TGlobalInput & input, number t=0)
Get the value at a given state.
std::shared_ptr< QValueFunction > getptr ()
Get shared pointer on the current QValueFunction .
virtual void initialize () = 0
Initialize the value function.
virtual void initialize (double v, number t=0) = 0
Initialize the value function with a default value.
virtual bool isNotSeen (const TInput & state, number t) = 0
virtual std::string str () const = 0
Define this function in order to be able to display the value function.
virtual void updateQValueAt (const TInput & state, const std::shared_ptr< Action > & action, number t=0) = 0
Update the value at a given state.
virtual void updateQValueAt (const TInput & state, const std::shared_ptr< Action > & action, number t, double target) = 0
Update the value at a given state (given a target)
void updateValueAt (const TGlobalInput & input, number t=0)
Update the value at a given state.

Public Functions inherited from sdm::BaseValueFunction

See sdm::BaseValueFunction

Type Name
BaseValueFunction ()
BaseValueFunction (number horizon)
BaseValueFunction (const BaseValueFunction & copy)
virtual std::shared_ptr< Action > getBestAction (const TInput & input, number t) = 0
Get the best action to do at a state.
number getHorizon () const
virtual double getValueAt (const TInput & input, number t=0) = 0
Get the value at a given state.
std::shared_ptr< BaseValueFunction< TInput > > getptr ()
Get a shared pointer on the current object.
virtual void initialize () = 0
Initialize the value function.
virtual void initialize (double v, number t=0) = 0
Initialize the value function with a default value.
bool isFiniteHorizon () const
bool isInfiniteHorizon () const
virtual void load (std::string)
Load a value function from a file. The extension of the file will indicate the type of formatage for reading ( .txt = text format, '.xml' = XML format, other = binary format).
virtual void save (std::string)
Save a value function into a file. The extension of the file will indicate the type of formatage for recording ( .txt = text format, '.xml' = XML format, other = binary format).
virtual std::string str () const = 0
Define this function in order to be able to display the value function.
virtual void updateValueAt (const TInput & input, number t=0) = 0
Get the q-value at a state.
virtual ~BaseValueFunction ()
Destroy the value function.

Protected Attributes inherited from sdm::BaseValueFunction

See sdm::BaseValueFunction

Type Name
number horizon_
The horizon for planning/learning.

Public Types Documentation

typedef TInput

using sdm::QValueFunctionConditioning< TCondition, TState >::TInput =  Pair<TCondition,TState>;

Public Functions Documentation

function QValueFunctionConditioning [1/2]

sdm::QValueFunctionConditioning::QValueFunctionConditioning () 

function QValueFunctionConditioning [2/2]

sdm::QValueFunctionConditioning::QValueFunctionConditioning (
    number horizon
) 

Parameters:

  • problem
  • default_value

function getQValueAt [1/2]

virtual double sdm::QValueFunctionConditioning::getQValueAt (
    const TCondition &,
    const TState & state,
    const std::shared_ptr< Action > & action,
    number t
) = 0

function getQValueAt [2/2]

virtual double sdm::QValueFunctionConditioning::getQValueAt (
    const TInput & input,
    const std::shared_ptr< Action > & action,
    number t
) 

Parameters:

  • state the state
  • action the action

Returns:

the q-value

function getptr

std::shared_ptr< QValueFunctionConditioning < TCondition, TState > > sdm::QValueFunctionConditioning::getptr () 

function updateQValueAt [1/4]

virtual void sdm::QValueFunctionConditioning::updateQValueAt (
    const TCondition &,
    const TState & state,
    const std::shared_ptr< Action > & action,
    number t=0
) = 0

function updateQValueAt [2/4]

virtual void sdm::QValueFunctionConditioning::updateQValueAt (
    const TCondition &,
    const TState & state,
    const std::shared_ptr< Action > & action,
    number t,
    double delta
) = 0

function updateQValueAt [3/4]

virtual void sdm::QValueFunctionConditioning::updateQValueAt (
    const TInput & input,
    const std::shared_ptr< Action > & action,
    number t=0
) 

function updateQValueAt [4/4]

virtual void sdm::QValueFunctionConditioning::updateQValueAt (
    const TInput & input,
    const std::shared_ptr< Action > & action,
    number t,
    double target
) 

The documentation for this class was generated from the following file src/sdm/utils/value_function/qvalue_function_conditioning.hpp