Class sdm::BasePointSetValueFunction
template <class Hash, class KeyEqual>
Class List > sdm > BasePointSetValueFunction
#include <point_set_value_function.hpp>
Inherits the following classes: sdm::BaseTabularValueFunction
Public Types
Type | Name |
---|---|
typedef typename BaseTabularValueFunction< Hash, KeyEqual >::Container | Container |
Public Types inherited from sdm::BaseTabularValueFunction
See sdm::BaseTabularValueFunction
Type | Name |
---|---|
typedef MappedVector< std::shared_ptr< State >, double, Hash, KeyEqual > | Container |
Public Types inherited from sdm::BinaryFunction
Type | Name |
---|---|
typedef std::pair< TInput1, TInput2 > | input_type |
typedef TOutput | output_type |
Public Types inherited from sdm::Function
See sdm::Function
Type | Name |
---|---|
typedef TInput | input_type |
typedef TOutput | output_type |
Public Attributes inherited from sdm::ValueFunction
Type | Name |
---|---|
std::shared_ptr< BackupInterfaceForValueFunction > | backup_ The backup operator. |
double | time_get_value_at = = 0 |
double | time_pruning = =0 |
double | time_update_value = =0 |
double | total_time_evaluate = =0 |
double | total_time_exist = =0 |
double | total_time_update_backup = =0 |
double | total_time_update_best_action = =0 |
Public Functions
Type | Name |
---|---|
BasePointSetValueFunction (number horizon, const std::shared_ptr< Initializer > & initializer, const std::shared_ptr< BackupInterfaceForValueFunction > & backup, const std::shared_ptr< ActionVFInterface > & action_vf, int freq_prunning=-1, TypeOfSawtoothPrunning type_of_sawtooth_prunning=TypeOfSawtoothPrunning::NONE) | |
BasePointSetValueFunction (number horizon, double default_value=0., const std::shared_ptr< BackupInterfaceForValueFunction > & backup=nullptr, const std::shared_ptr< ActionVFInterface > & action_vf=nullptr, int freq_prunning=-1, TypeOfSawtoothPrunning type_of_sawtooth_prunning=TypeOfSawtoothPrunning::NONE) | |
virtual void | do_pruning (number t) |
virtual Pair< std::shared_ptr< State >, double > | evaluate (const std::shared_ptr< State > & state, number t) Evaluate the element given. |
virtual double | getValueAt (const std::shared_ptr< State > & state, number t) Evaluate the value at a state. |
void | serialize (Archive & archive, const unsigned int) |
virtual std::string | str () const Define this function in order to be able to display the value function. |
Public Functions inherited from sdm::BaseTabularValueFunction
See sdm::BaseTabularValueFunction
Type | Name |
---|---|
BaseTabularValueFunction (number horizon, const std::shared_ptr< Initializer > & initializer, const std::shared_ptr< BackupInterfaceForValueFunction > & backup, const std::shared_ptr< ActionVFInterface > & action_vf, bool is_upper_bound) | |
BaseTabularValueFunction (number horizon=0, double default_value=0., const std::shared_ptr< BackupInterfaceForValueFunction > & backup=nullptr, const std::shared_ptr< ActionVFInterface > & action_vf=nullptr, bool is_upper_bound=false) | |
BaseTabularValueFunction (const BaseTabularValueFunction & copy) | |
virtual void | do_pruning (number t) |
virtual Pair< std::shared_ptr< State >, double > | evaluate (const std::shared_ptr< State > & state, number t) Evaluate the element given. |
double | getDefaultAt (number t) |
Container | getRepresentation (number t) |
virtual size_t | getSize (number t) const Get the size of the value function at timestep t. |
virtual std::vector< std::shared_ptr< State > > | getSupport (number t) Return the possible indexes of the value function. |
virtual double | getValueAt (const std::shared_ptr< State > & state, number t=0) Evaluate the value at a state. |
virtual void | initialize () Initialize the value function by using initializer. |
virtual void | initialize (double default_value, number t=0) Set all values of the vector to a default value. |
virtual void | load (std::string filename) 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 filename) 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). |
void | serialize (Archive & archive, const unsigned int &) |
virtual std::string | str () const Define this function in order to be able to display the value function. |
virtual void | updateValueAt (const std::shared_ptr< State > & state, number t=0) Update the value at a specific state and timestep. |
virtual void | updateValueAt (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, number t=0) Update the value at a given state knowing an action. |
void | updateValueAt (const std::shared_ptr< State > & state, number t, double target) Update the value function at state s and timestep t to the target value. |
Public Functions inherited from sdm::ValueFunction
Type | Name |
---|---|
void | StartTime () |
ValueFunction () | |
ValueFunction (number horizon=0, const std::shared_ptr< Initializer > & intializer=nullptr, const std::shared_ptr< BackupInterfaceForValueFunction > & backup=nullptr, const std::shared_ptr< ActionVFInterface > & action=nullptr) Construct a new Incremental Value Function object. | |
ValueFunction (const ValueFunction & copy) | |
TData | backup (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, number t) Do the backup operator. |
virtual void | do_pruning (number t) = 0 |
virtual Pair< std::shared_ptr< State >, double > | evaluate (const std::shared_ptr< State > & state, number t) = 0 Evaluate the element given. |
std::shared_ptr< Action > | getBestAction (const std::shared_ptr< State > & state, number t) Select the best Action for a precise state and a time step. |
Pair< std::shared_ptr< Action >, double > | getBestActionAndValue (const std::shared_ptr< State > & state, number t) Select the best Action and the value associated for a precise state and a time step. |
std::shared_ptr< BinaryFunction< std::shared_ptr< State >, number, double > > | getInitFunction () Get the Init Function . |
virtual size_t | getSize (number t) const = 0 Get the size of the value function at timestep t. |
size_t | getSize () const Get the total size of the value function. |
virtual std::vector< std::shared_ptr< State > > | getSupport (number t) = 0 Return the possible indexes of the value function. |
double | getTime (std::string information) |
virtual double | getValueAt (const std::shared_ptr< State > & state, number t=0) = 0 Get the value at a given state. |
std::shared_ptr< ValueFunction > | 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. |
void | initialize (const std::shared_ptr< BinaryFunction< std::shared_ptr< State >, number, double >> & init_function) Set a function as a interactive way to get initial values for state that are not already initialized. |
virtual double | operator() (const std::shared_ptr< State > & state, const number & t=0) |
virtual std::string | str () const = 0 Define this function in order to be able to display the value function. |
void | updateTime (std::chrono::high_resolution_clock::time_point start_time, std::string information) |
virtual void | updateValueAt (const std::shared_ptr< State > & state, number t=0) = 0 Update the value at a given state. |
virtual void | updateValueAt (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, number t=0) = 0 Update the value at a given state knowing an action. |
virtual | ~ValueFunction () Destroy the value function. |
Public Functions inherited from 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::BinaryFunction
Type | Name |
---|---|
virtual output_type | operator() (const TInput1 &, const TInput2 &) = 0 |
virtual output_type | operator() (const input_type & p_input) |
virtual | ~BinaryFunction () |
Public Functions inherited from sdm::Function
See sdm::Function
Type | Name |
---|---|
virtual output_type | operator() (const input_type &) = 0 |
virtual | ~Function () |
Protected Attributes
Type | Name |
---|---|
double | epsilon_prunning epsilon value used for the prunning |
number | freq_pruning_ Frequency before prunning. |
bool | is_sawtooth_lp = = false |
number | last_prunning = = 0 The last time the prunning took place. |
TypeOfSawtoothPrunning | type_of_sawtooth_prunning_ |
Protected Attributes inherited from sdm::BaseTabularValueFunction
See sdm::BaseTabularValueFunction
Type | Name |
---|---|
bool | is_upper_bound_ |
std::vector< Container > | representation The value function represention. The default representation is a MappedVector but every class implementingVectorInterface interface can be used. |
Protected Attributes inherited from sdm::ValueFunction
Type | Name |
---|---|
std::shared_ptr< ActionVFInterface > | action_ The evaluate operator. |
std::shared_ptr< BinaryFunction< std::shared_ptr< State >, number, double > > | init_function_ = = nullptr Initialization function. If defined, algorithms on value functions will get inital values using this function. |
std::shared_ptr< Initializer > | initializer_ The initializer to use for this value function. |
Protected Attributes inherited from sdm::BaseValueFunction
Type | Name |
---|---|
number | horizon_ The horizon for planning/learning. |
Protected Functions
Type | Name |
---|---|
double | computeRatio (const std::shared_ptr< State > & state, const std::shared_ptr< State > & point, number t) COmpute the sawtooth ratio for the evaluate function. |
Pair< std::unordered_map< std::shared_ptr< State >, std::vector< std::shared_ptr< State > > >, std::map< int, std::vector< std::shared_ptr< State > > > > | iterative_pruning (number t) |
void | prune (number t=0) Point-wise pruning. |
double | ratioBelief (const std::shared_ptr< State > & state, const std::shared_ptr< State > & point) Ratio specialized for the case Beleif (used for the evaluate function) |
double | ratioOccupancy (const std::shared_ptr< State > & state, const std::shared_ptr< State > & point, number t) Ratio specialized for the case Occupancy (used for the evaluate function) |
Public Types Documentation
typedef Container
using sdm::BasePointSetValueFunction< Hash, KeyEqual >::Container = typename BaseTabularValueFunction<Hash, KeyEqual>::Container;
Public Functions Documentation
function BasePointSetValueFunction [1/2]
sdm::BasePointSetValueFunction::BasePointSetValueFunction (
number horizon,
const std::shared_ptr< Initializer > & initializer,
const std::shared_ptr< BackupInterfaceForValueFunction > & backup,
const std::shared_ptr< ActionVFInterface > & action_vf,
int freq_prunning=-1,
TypeOfSawtoothPrunning type_of_sawtooth_prunning=TypeOfSawtoothPrunning::NONE
)
function BasePointSetValueFunction [2/2]
sdm::BasePointSetValueFunction::BasePointSetValueFunction (
number horizon,
double default_value=0.,
const std::shared_ptr< BackupInterfaceForValueFunction > & backup=nullptr,
const std::shared_ptr< ActionVFInterface > & action_vf=nullptr,
int freq_prunning=-1,
TypeOfSawtoothPrunning type_of_sawtooth_prunning=TypeOfSawtoothPrunning::NONE
)
function do_pruning
virtual void sdm::BasePointSetValueFunction::do_pruning (
number t
)
Implements sdm::ValueFunction::do_pruning
function evaluate
virtual Pair < std::shared_ptr< State >, double > sdm::BasePointSetValueFunction::evaluate (
const std::shared_ptr< State > & state,
number t
)
Parameters:
state
: ELement to evaluatet
Returns:
Pair<std::shared_ptr<State>, double>
Implements sdm::BaseTabularValueFunction::evaluate
function getValueAt
virtual double sdm::BasePointSetValueFunction::getValueAt (
const std::shared_ptr< State > & state,
number t
)
Parameters:
state
the state where we want to evaluate the function
Returns:
the value
Implements sdm::ValueFunction::getValueAt
function serialize
template<class Archive class Archive>
inline void sdm::BasePointSetValueFunction::serialize (
Archive & archive,
const unsigned int
)
function str
virtual std::string sdm::BasePointSetValueFunction::str () const
Implements sdm::ValueFunction::str
Protected Attributes Documentation
variable epsilon_prunning
double sdm::BasePointSetValueFunction< Hash, KeyEqual >::epsilon_prunning;
variable freq_pruning_
number sdm::BasePointSetValueFunction< Hash, KeyEqual >::freq_pruning_;
variable is_sawtooth_lp
bool sdm::BasePointSetValueFunction< Hash, KeyEqual >::is_sawtooth_lp;
variable last_prunning
number sdm::BasePointSetValueFunction< Hash, KeyEqual >::last_prunning;
variable type_of_sawtooth_prunning_
TypeOfSawtoothPrunning sdm::BasePointSetValueFunction< Hash, KeyEqual >::type_of_sawtooth_prunning_;
Protected Functions Documentation
function computeRatio
double sdm::BasePointSetValueFunction::computeRatio (
const std::shared_ptr< State > & state,
const std::shared_ptr< State > & point,
number t
)
Parameters:
state
point
t
Returns:
double
function iterative_pruning
Pair < std::unordered_map< std::shared_ptr< State >, std::vector< std::shared_ptr< State > > >, std::map< int, std::vector< std::shared_ptr< State > > > > sdm::BasePointSetValueFunction::iterative_pruning (
number t
)
function prune
void sdm::BasePointSetValueFunction::prune (
number t=0
)
function ratioBelief
double sdm::BasePointSetValueFunction::ratioBelief (
const std::shared_ptr< State > & state,
const std::shared_ptr< State > & point
)
Parameters:
state
: Element to evaluatepoint
:Point in the Point Set
Returns:
Pair<std::shared_ptr<State>,double>
function ratioOccupancy
double sdm::BasePointSetValueFunction::ratioOccupancy (
const std::shared_ptr< State > & state,
const std::shared_ptr< State > & point,
number t
)
Parameters:
state
:Element to evaluatepoint
: Point in the Point Set
Returns:
Pair<std::shared_ptr<State>,double>
## Friends Documentation
friend access
friend class sdm::BasePointSetValueFunction::access ()
friend operator<<
inline friend std::ostream & sdm::BasePointSetValueFunction::operator<< (
std::ostream & os,
BasePointSetValueFunction & vf
)
The documentation for this class was generated from the following file src/sdm/utils/value_function/point_set_value_function.hpp