Class sdm::HyperplanValueFunction
Class List > sdm > HyperplanValueFunction
#include <hyperplan_value_function.hpp>
Inherits the following classes: sdm::ValueFunction
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 Static Attributes
Type | Name |
---|---|
double | PRECISION |
Public Functions
Type | Name |
---|---|
HyperplanValueFunction (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, TypeOfMaxPlanPrunning type_of_maxplan_prunning=TypeOfMaxPlanPrunning::PAIRWISE) | |
HyperplanValueFunction (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, TypeOfMaxPlanPrunning type_of_maxplan_prunning=TypeOfMaxPlanPrunning::PAIRWISE) | |
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 | getDefaultValue (number) Get the Default Value at time step 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) |
virtual double | getValueAt (const std::shared_ptr< State > &, number=0) Get the Value at state x. |
virtual void | initialize () Initialize the value function. |
virtual void | initialize (double v, number t=0) Initialize the value function with a default value. |
void | prune (number=0) Prune unecessary vectors. |
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 > &, number=0) Update the max plan representation by adding a new hyperplan. |
virtual void | updateValueAt (const std::shared_ptr< State > & state, const std::shared_ptr< Action > & action, number t=0) Update the max plan representation by adding a new hyperplan knowing the action. |
~HyperplanValueFunction () |
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 Types
Type | Name |
---|---|
typedef std::vector< std::shared_ptr< State > > | HyperplanSet |
Protected Attributes
Type | Name |
---|---|
std::vector< std::unordered_set< std::shared_ptr< State > > > | all_state_updated_so_far |
std::vector< double > | default_values_per_horizon the default values, one for each decision epoch. |
number | freq_pruning_ Frequency before prunning. |
number | last_prunning = = 0 The last time the prunning took place. |
std::vector< HyperplanSet > | representation The value function represention. The default representation is a MappedVector but every class implementingVectorInterface interface can be used. |
TypeOfMaxPlanPrunning | type_of_maxplan_prunning_ |
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 |
---|---|
void | bounded_prune (number=0) this method prunes dominated points, known as bounded pruning by Trey Smith. This approach stores the number of frequency states, among those already visited, that are maximal at a hyperplan. And prune hyperplan with a number of maximal frequency states zero. |
void | createDefault (const std::shared_ptr< State > & state, number t) Create a Default object. |
bool | exist (const std::shared_ptr< BeliefInterface > &, number t, double precision=PRECISION) Determine if the state is already stocked. |
std::pair< double, std::shared_ptr< State > > | getMaxAt (const std::shared_ptr< State > &, number) Get the maximum value and hyperplan at a specific state. |
void | pairwise_prune (number t) this method prunes dominated vectors, known as Pairwise pruning. |
Public Static Attributes Documentation
variable PRECISION
double sdm::HyperplanValueFunction::PRECISION;
Public Functions Documentation
function HyperplanValueFunction [1/2]
sdm::HyperplanValueFunction::HyperplanValueFunction (
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,
TypeOfMaxPlanPrunning type_of_maxplan_prunning=TypeOfMaxPlanPrunning::PAIRWISE
)
function HyperplanValueFunction [2/2]
sdm::HyperplanValueFunction::HyperplanValueFunction (
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,
TypeOfMaxPlanPrunning type_of_maxplan_prunning=TypeOfMaxPlanPrunning::PAIRWISE
)
function do_pruning
virtual void sdm::HyperplanValueFunction::do_pruning (
number t
)
Implements sdm::ValueFunction::do_pruning
function evaluate
virtual Pair < std::shared_ptr< State >, double > sdm::HyperplanValueFunction::evaluate (
const std::shared_ptr< State > & state,
number t
)
Parameters:
state
: ELement to evaluatet
Returns:
Pair<std::shared_ptr<State>, double>
Implements sdm::ValueFunction::evaluate
function getDefaultValue
double sdm::HyperplanValueFunction::getDefaultValue (
number
)
Parameters:
number
: timestep
Returns:
double
function getSize
virtual size_t sdm::HyperplanValueFunction::getSize (
number t
) const
Implements sdm::ValueFunction::getSize
function getSupport
virtual std::vector< std::shared_ptr< State > > sdm::HyperplanValueFunction::getSupport (
number
)
Returns:
std::string
Implements sdm::ValueFunction::getSupport
function getValueAt
virtual double sdm::HyperplanValueFunction::getValueAt (
const std::shared_ptr< State > &,
number=0
)
Parameters:
state
the state
Returns:
double
Implements sdm::ValueFunction::getValueAt
function initialize [1/2]
virtual void sdm::HyperplanValueFunction::initialize ()
Implements sdm::ValueFunction::initialize
function initialize [2/2]
virtual void sdm::HyperplanValueFunction::initialize (
double v,
number t=0
)
Implements sdm::ValueFunction::initialize
function prune
void sdm::HyperplanValueFunction::prune (
number=0
)
function str
virtual std::string sdm::HyperplanValueFunction::str () const
Implements sdm::ValueFunction::str
function updateValueAt [1/2]
virtual void sdm::HyperplanValueFunction::updateValueAt (
const std::shared_ptr< State > &,
number=0
)
Implements sdm::ValueFunction::updateValueAt
function updateValueAt [2/2]
virtual void sdm::HyperplanValueFunction::updateValueAt (
const std::shared_ptr< State > & state,
const std::shared_ptr< Action > & action,
number t=0
)
Implements sdm::ValueFunction::updateValueAt
function ~HyperplanValueFunction
sdm::HyperplanValueFunction::~HyperplanValueFunction ()
Protected Types Documentation
typedef HyperplanSet
using sdm::HyperplanValueFunction::HyperplanSet = std::vector<std::shared_ptr<State> >;
Protected Attributes Documentation
variable all_state_updated_so_far
std::vector<std::unordered_set<std::shared_ptr<State> > > sdm::HyperplanValueFunction::all_state_updated_so_far;
variable default_values_per_horizon
std::vector<double> sdm::HyperplanValueFunction::default_values_per_horizon;
variable freq_pruning_
number sdm::HyperplanValueFunction::freq_pruning_;
variable last_prunning
number sdm::HyperplanValueFunction::last_prunning;
variable representation
std::vector<HyperplanSet> sdm::HyperplanValueFunction::representation;
variable type_of_maxplan_prunning_
TypeOfMaxPlanPrunning sdm::HyperplanValueFunction::type_of_maxplan_prunning_;
Protected Functions Documentation
function bounded_prune
void sdm::HyperplanValueFunction::bounded_prune (
number=0
)
function createDefault
void sdm::HyperplanValueFunction::createDefault (
const std::shared_ptr< State > & state,
number t
)
Parameters:
state
t
function exist
bool sdm::HyperplanValueFunction::exist (
const std::shared_ptr< BeliefInterface > &,
number t,
double precision=PRECISION
)
Parameters:
t
precision
function getMaxAt
std::pair< double, std::shared_ptr< State > > sdm::HyperplanValueFunction::getMaxAt (
const std::shared_ptr< State > &,
number
)
Parameters:
state
a specific state
Returns:
the maximum value and hyperplan at a specific state (std::pair<double, std::shared_ptr<State>>)
function pairwise_prune
void sdm::HyperplanValueFunction::pairwise_prune (
number t
)
Parameters:
number
: timestep
The documentation for this class was generated from the following file src/sdm/utils/value_function/hyperplan_value_function.hpp