Class sdm::Space

Class List > sdm > Space

This class is an abstract interface that all spaces should inherite. More...

  • #include <space.hpp>

Inherits the following classes: std::enable_shared_from_this< Space >

Inherited by the following classes: sdm::DiscreteSpace, sdm::MultiSpace

Public Types

Type Name
typedef std::shared_ptr< ItemIterator > iterator_type

Public Functions

Type Name
virtual iterator_type begin () = 0
virtual iterator_type end () = 0
virtual std::vector< number > getDim () const = 0
Get the dimension of the space.
bool isContinuous () const
Check if the space is continous.
virtual bool isDiscrete () const = 0
Check if the space is discrete.
bool operator!= (const Space & sp) const
bool operator== (const Space & sp) const
virtual std::shared_ptr< Item > sample () const
Sample a random item from the space.
virtual std::string str () const = 0
Space as a string.
std::shared_ptr< DiscreteSpace > toDiscreteSpace ()
std::shared_ptr< MultiDiscreteSpace > toMultiDiscreteSpace ()
virtual ~Space ()

Detailed Description

It gives some useful general methods to use generic spaces in your algorithms.

Public Types Documentation

typedef iterator_type

using sdm::Space::iterator_type =  std::shared_ptr<ItemIterator>;

Public Functions Documentation

function begin

virtual iterator_type sdm::Space::begin () = 0

function end

virtual iterator_type sdm::Space::end () = 0

function getDim

virtual std::vector< number > sdm::Space::getDim () const = 0

function isContinuous

bool sdm::Space::isContinuous () const

function isDiscrete

virtual bool sdm::Space::isDiscrete () const = 0

function operator!=

bool sdm::Space::operator!= (
    const Space & sp
) const

function operator==

bool sdm::Space::operator== (
    const Space & sp
) const

function sample

inline virtual std::shared_ptr< Item > sdm::Space::sample () const

function str

virtual std::string sdm::Space::str () const = 0

function toDiscreteSpace

std::shared_ptr< DiscreteSpace > sdm::Space::toDiscreteSpace () 

function toMultiDiscreteSpace

std::shared_ptr< MultiDiscreteSpace > sdm::Space::toMultiDiscreteSpace () 

function ~Space

inline virtual sdm::Space::~Space () 

Friends Documentation

friend operator<<

inline friend std::ostream & sdm::Space::operator<< (
    std::ostream & os,
    const Space & sp
) 

The documentation for this class was generated from the following file src/sdm/core/space/space.hpp