AIToolbox
A library that offers tools for AI problem solving.
AIToolbox::POMDP::LinearSupport Class Reference

This class represents the LinearSupport algorithm. More...

#include <AIToolbox/POMDP/Algorithms/LinearSupport.hpp>

Public Member Functions

 LinearSupport (unsigned horizon, double tolerance)
 Basic constructor. More...
 
void setTolerance (double tolerance)
 This function sets the tolerance parameter. More...
 
void setHorizon (unsigned h)
 This function allows setting the horizon parameter. More...
 
double getTolerance () const
 This function will return the currently set tolerance parameter. More...
 
unsigned getHorizon () const
 This function returns the currently set horizon parameter. More...
 
template<IsModel M>
std::tuple< double, ValueFunctionoperator() (const M &model)
 This function solves a POMDP::Model completely. More...
 

Detailed Description

This class represents the LinearSupport algorithm.

This method is similar in spirit to Witness. The idea is that we look at certain belief points, and we try to find the best alphavectors in those points. Rather than looking for them though, the idea here is that we know where they are, if there are any at all.

As the ValueFunction is piecewise linear and convex, if there's any other hyperplane that we can add to improve it, the improvements are going to be maximal at one of the vertices of the original surface.

The idea thus is the following: first we compute the set of alphavectors for the corners, so we can be sure about them. Then we find all vertices that those alphavectors create, and we compute the error between the true ValueFunction and their current values.

If the error is greater than a certain amount, we allow their supporting alphavector to join the ValueFunction, and we increase the size of the vertex set by adding all new vertices that are created by adding the new surface (and removing the ones that are made useless by it).

We repeat until we have checked all available vertices, and at that point we are done.

While this can be a very inefficient algorithm, the fact that vertices are checked in an orderly fashion, from highest error to lowest, allows if one needs it to convert this algorithm into an anytime algorithm. Even if there is limited time to compute the solution, the algorithm is guaranteed to work in the areas with high error first, allowing one to compute good approximations even without a lot of resources.

Constructor & Destructor Documentation

◆ LinearSupport()

AIToolbox::POMDP::LinearSupport::LinearSupport ( unsigned  horizon,
double  tolerance 
)

Basic constructor.

This constructor sets the default horizon used to solve a POMDP::Model.

The tolerance parameter must be >= 0.0, otherwise the constructor will throw an std::runtime_error. The tolerance parameter sets the convergence criterion. A tolerance of 0.0 forces LinearSupport to perform a number of iterations equal to the horizon specified. Otherwise, LinearSupport will stop as soon as the difference between two iterations is less than the tolerance specified.

Parameters
horizonThe horizon chosen.
toleranceThe tolerance factor to stop the value iteration loop.

Member Function Documentation

◆ getHorizon()

unsigned AIToolbox::POMDP::LinearSupport::getHorizon ( ) const

This function returns the currently set horizon parameter.

Returns
The current horizon.

◆ getTolerance()

double AIToolbox::POMDP::LinearSupport::getTolerance ( ) const

This function will return the currently set tolerance parameter.

Returns
The currently set tolerance parameter.

◆ operator()()

template<IsModel M>
std::tuple< double, ValueFunction > AIToolbox::POMDP::LinearSupport::operator() ( const M &  model)

This function solves a POMDP::Model completely.

This function is pretty expensive (as are possibly all POMDP solvers). It evaluates all vertices in the ValueFunction surface in order to determine whether it is complete, otherwise it improves it incrementally.

Template Parameters
MThe type of POMDP model that needs to be solved.
Parameters
modelThe POMDP model that needs to be solved.
Returns
A tuple containing the maximum variation for the ValueFunction and the computed ValueFunction.

◆ setHorizon()

void AIToolbox::POMDP::LinearSupport::setHorizon ( unsigned  h)

This function allows setting the horizon parameter.

Parameters
hThe new horizon parameter.

◆ setTolerance()

void AIToolbox::POMDP::LinearSupport::setTolerance ( double  tolerance)

This function sets the tolerance parameter.

The tolerance parameter must be >= 0.0, otherwise the constructor will throw an std::runtime_error. The tolerance parameter sets the convergence criterion. A tolerance of 0.0 forces LinearSupport to perform a number of iterations equal to the horizon specified. Otherwise, LinearSupport will stop as soon as the difference between two iterations is less than the tolerance specified.

Parameters
toleranceThe new tolerance parameter.

The documentation for this class was generated from the following file: