Class sdm::TabularQValueFunctionConditioning

template <class TCondition class TCondition, class TState class TState>

Class List > sdm > TabularQValueFunctionConditioning

  • #include <tabular_qvalue_function_conditioning.hpp>

Inherits the following classes: sdm::TabularQValueFunction, sdm::QValueFunctionConditioning

Public Types

Type Name
typedef typename TabularQValueFunction< Pair< TCondition, TState > >::Container Container
typedef typename QValueFunctionConditioning< TCondition, TState >::TInput TInput

Public Types inherited from sdm::TabularQValueFunction

See sdm::TabularQValueFunction

Type Name
typedef MappedMatrix< TInput, std::shared_ptr< Action >, double > Container

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 Types inherited from sdm::QValueFunctionConditioning

See sdm::QValueFunctionConditioning

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
TabularQValueFunctionConditioning (number horizon, double learning_rate, std::shared_ptr< QInitializer< TInput >> initializer, bool active_learning=true)
TabularQValueFunctionConditioning (number horizon=0, double learning_rate=0.1, double default_value=0., bool active_learning=true)
virtual double getQValueAt (const TInput & state, const std::shared_ptr< Action > & action, number t)
Get the q-value given state and action.
virtual double getQValueAt (const TCondition &, const TState & state, const std::shared_ptr< Action > & action, number t)
std::shared_ptr< VectorInterface< std::shared_ptr< Action >, double > > getQValuesAt (const TInput & state, number t)
Get the q-value at a state.
virtual void updateQValueAt (const TInput & state, const std::shared_ptr< Action > & action, number t=0)
Update the value at a given state.
virtual void updateQValueAt (const TInput & state, const std::shared_ptr< Action > & action, number t, double delta)
Update the value at a given state (given a delta)
virtual void updateQValueAt (const TCondition &, const TState & state, const std::shared_ptr< Action > & action, number t=0)
virtual void updateQValueAt (const TCondition &, const TState & state, const std::shared_ptr< Action > & action, number t, double delta)

Public Functions inherited from sdm::TabularQValueFunction

See sdm::TabularQValueFunction

Type Name
TabularQValueFunction (number horizon, double learning_rate, std::shared_ptr< QInitializer< TInput >> initializer, bool active_learning=true)
TabularQValueFunction (number horizon=0, double learning_rate=0.1, double default_value=0., bool active_learning=true)
virtual int getNumStates () const
virtual double getQValueAt (const TInput & state, const std::shared_ptr< Action > & action, number t)
Get the q-value given state and action.
virtual std::shared_ptr< VectorInterface< std::shared_ptr< Action >, double > > getQValuesAt (const TInput & state, number t)
Get the q-value at a state.
virtual void initialize ()
Initialize the value function.
virtual void initialize (double v, number t=0)
Initialize the value function with a default value.
virtual bool isNotSeen (const TInput & state, number t)
virtual std::string str () const
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)
Update the value at a given state.
virtual void updateQValueAt (const TInput & state, const std::shared_ptr< Action > & action, number t, double delta)
Update the value at a given state (given a delta)

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.

Public Functions inherited from sdm::QValueFunctionConditioning

See sdm::QValueFunctionConditioning

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::TabularQValueFunction

See sdm::TabularQValueFunction

Type Name
bool active_learning_
std::shared_ptr< QInitializer< TInput > > initializer_
The initializer to use for this value function.
double learning_rate_
std::vector< Container > representation
The Q value function represention. The default representation is a MappedVector but every class implementingVectorInterface interface can be used.

Protected Attributes inherited from sdm::BaseValueFunction

See sdm::BaseValueFunction

Type Name
number horizon_
The horizon for planning/learning.

Protected Attributes inherited from sdm::BaseValueFunction

See sdm::BaseValueFunction

Type Name
number horizon_
The horizon for planning/learning.

Public Types Documentation

typedef Container

using sdm::TabularQValueFunctionConditioning< TCondition, TState >::Container =  typename TabularQValueFunction<Pair<TCondition,TState> >::Container;

typedef TInput

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

Public Functions Documentation

function TabularQValueFunctionConditioning [1/2]

sdm::TabularQValueFunctionConditioning::TabularQValueFunctionConditioning (
    number horizon,
    double learning_rate,
    std::shared_ptr< QInitializer < TInput >> initializer,
    bool active_learning=true
) 

function TabularQValueFunctionConditioning [2/2]

sdm::TabularQValueFunctionConditioning::TabularQValueFunctionConditioning (
    number horizon=0,
    double learning_rate=0.1,
    double default_value=0.,
    bool active_learning=true
) 

function getQValueAt [1/2]

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

Parameters:

  • state the state
  • action the action

Returns:

the q-value

Implements sdm::QValueFunctionConditioning::getQValueAt

function getQValueAt [2/2]

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

Implements sdm::QValueFunctionConditioning::getQValueAt

function getQValuesAt

std::shared_ptr< VectorInterface < std::shared_ptr< Action >, double > > sdm::TabularQValueFunctionConditioning::getQValuesAt (
    const TInput & state,
    number t
) 

Parameters:

  • state the state

Returns:

the action value vector

function updateQValueAt [1/4]

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

Implements sdm::QValueFunctionConditioning::updateQValueAt

function updateQValueAt [2/4]

virtual void sdm::TabularQValueFunctionConditioning::updateQValueAt (
    const TInput & state,
    const std::shared_ptr< Action > & action,
    number t,
    double delta
) 

Implements sdm::QValueFunctionConditioning::updateQValueAt

function updateQValueAt [3/4]

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

Implements sdm::QValueFunctionConditioning::updateQValueAt

function updateQValueAt [4/4]

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

Implements sdm::QValueFunctionConditioning::updateQValueAt


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