ompl::base::DiscreteStateSpace Class Reference

A space representing discrete states; i.e. there are a small number of discrete states the system can be in. States are represented as integers [lowerBound, upperBound], where lowerBound and upperBound are inclusive. States do not wrap around; i.e. the distance between state lowerBound and state upperBound is upperBound-lowerBound, NOT 1. More...

#include <DiscreteStateSpace.h>

Inheritance diagram for ompl::base::DiscreteStateSpace:
Inheritance graph
[legend]

List of all members.

Classes

class  StateType
 The definition of a discrete state. More...

Public Member Functions

virtual StateallocState (void) const
 Allocate a state that can store a point in the described space.
virtual StateSamplerPtr allocStateSampler (void) const
 Allocate an instance of a uniform state sampler for this space.
virtual void copyState (State *destination, const State *source) const
 Copy a state to another. The memory of source and destination should NOT overlap.
 DiscreteStateSpace (int lowerBound, int upperBound)
 Construct a discrete space in wich states can take values in the set [lowerBound, upperBound].
virtual double distance (const State *state1, const State *state2) const
 Computes distance to between two states. This function satisfies the properties of a metric and its return value will always be between 0 and getMaximumExtent().
virtual void enforceBounds (State *state) const
 Bring the state within the bounds of the state space. For unbounded spaces this function can be a no-op.
virtual bool equalStates (const State *state1, const State *state2) const
 Checks whether two states are equal.
virtual void freeState (State *state) const
 Free the memory of the allocated state.
virtual unsigned int getDimension (void) const
 Get the dimension of the space (not the dimension of the surrounding ambient space).
int getLowerBound (void) const
 Returns the lowest possible state.
virtual double getMaximumExtent (void) const
 Get the maximum value a call to distance() can return (or an upper bound). For unbounded state spaces, this function can return infinity.
unsigned int getStateCount (void) const
 Returns the number of states possible.
int getUpperBound (void) const
 Returns the highest possible state.
virtual void interpolate (const State *from, const State *to, const double t, State *state) const
 Computes the state that lies at time t in [0, 1] on the segment that connects from state to to state. The memory location of state is not required to be different from the memory of either from or to.
virtual bool isDiscrete (void) const
 Check if the set of states is discrete.
virtual void printSettings (std::ostream &out) const
 Print the settings for this state space to a stream.
virtual void printState (const State *state, std::ostream &out) const
 Print a state to a stream.
virtual void registerProjections (void)
 Register the projections for this state space. Usually, this is at least the default projection. These are implicit projections, set by the implementation of the state space. This is called by setup().
virtual bool satisfiesBounds (const State *state) const
 Check if a state is inside the bounding box. For unbounded spaces this function can always return true.
void setBounds (int lowerBound, int upperBound)
 Set the bounds for the states in this space (the states will be in the set [lowerBound, upperBound].
virtual void setup (void)
 Perform final setup steps. This function is automatically called by the SpaceInformation. If any default projections are to be registered, this call will set them. It is safe to call this function multiple times.
virtual ~DiscreteStateSpace (void)

Protected Attributes

int lowerBound_
 The lowest integer state.
int upperBound_
 The highest integer state.

Detailed Description

A space representing discrete states; i.e. there are a small number of discrete states the system can be in. States are represented as integers [lowerBound, upperBound], where lowerBound and upperBound are inclusive. States do not wrap around; i.e. the distance between state lowerBound and state upperBound is upperBound-lowerBound, NOT 1.

Definition at line 68 of file DiscreteStateSpace.h.


Constructor & Destructor Documentation

ompl::base::DiscreteStateSpace::DiscreteStateSpace ( int  lowerBound,
int  upperBound 
) [inline]

Construct a discrete space in wich states can take values in the set [lowerBound, upperBound].

Definition at line 82 of file DiscreteStateSpace.h.

virtual ompl::base::DiscreteStateSpace::~DiscreteStateSpace ( void   )  [inline, virtual]

Definition at line 88 of file DiscreteStateSpace.h.


Member Function Documentation

virtual State* ompl::base::DiscreteStateSpace::allocState ( void   )  const [virtual]

Allocate a state that can store a point in the described space.

Implements ompl::base::StateSpace.

virtual StateSamplerPtr ompl::base::DiscreteStateSpace::allocStateSampler ( void   )  const [virtual]

Allocate an instance of a uniform state sampler for this space.

Implements ompl::base::StateSpace.

virtual void ompl::base::DiscreteStateSpace::copyState ( State destination,
const State source 
) const [virtual]

Copy a state to another. The memory of source and destination should NOT overlap.

Implements ompl::base::StateSpace.

virtual double ompl::base::DiscreteStateSpace::distance ( const State state1,
const State state2 
) const [virtual]

Computes distance to between two states. This function satisfies the properties of a metric and its return value will always be between 0 and getMaximumExtent().

Implements ompl::base::StateSpace.

virtual void ompl::base::DiscreteStateSpace::enforceBounds ( State state  )  const [virtual]

Bring the state within the bounds of the state space. For unbounded spaces this function can be a no-op.

Implements ompl::base::StateSpace.

virtual bool ompl::base::DiscreteStateSpace::equalStates ( const State state1,
const State state2 
) const [virtual]

Checks whether two states are equal.

Implements ompl::base::StateSpace.

virtual void ompl::base::DiscreteStateSpace::freeState ( State state  )  const [virtual]

Free the memory of the allocated state.

Implements ompl::base::StateSpace.

virtual unsigned int ompl::base::DiscreteStateSpace::getDimension ( void   )  const [virtual]

Get the dimension of the space (not the dimension of the surrounding ambient space).

Implements ompl::base::StateSpace.

int ompl::base::DiscreteStateSpace::getLowerBound ( void   )  const [inline]

Returns the lowest possible state.

Definition at line 129 of file DiscreteStateSpace.h.

virtual double ompl::base::DiscreteStateSpace::getMaximumExtent ( void   )  const [virtual]

Get the maximum value a call to distance() can return (or an upper bound). For unbounded state spaces, this function can return infinity.

Note:
Tight upper bounds are preferred because the value of the extent is used in the automatic computation of parameters for planning. If the bounds are less tight, the automatically computed parameters will be less useful.

Implements ompl::base::StateSpace.

unsigned int ompl::base::DiscreteStateSpace::getStateCount ( void   )  const [inline]

Returns the number of states possible.

Definition at line 123 of file DiscreteStateSpace.h.

int ompl::base::DiscreteStateSpace::getUpperBound ( void   )  const [inline]

Returns the highest possible state.

Definition at line 135 of file DiscreteStateSpace.h.

virtual void ompl::base::DiscreteStateSpace::interpolate ( const State from,
const State to,
const double  t,
State state 
) const [virtual]

Computes the state that lies at time t in [0, 1] on the segment that connects from state to to state. The memory location of state is not required to be different from the memory of either from or to.

Implements ompl::base::StateSpace.

virtual bool ompl::base::DiscreteStateSpace::isDiscrete ( void   )  const [virtual]

Check if the set of states is discrete.

Note:
In fact, because of limited numerical precision, the representation of all spaces is discrete; this function returns true if the corresponding mathematical object is a discrete one.

Reimplemented from ompl::base::StateSpace.

virtual void ompl::base::DiscreteStateSpace::printSettings ( std::ostream &  out  )  const [virtual]

Print the settings for this state space to a stream.

Reimplemented from ompl::base::StateSpace.

virtual void ompl::base::DiscreteStateSpace::printState ( const State state,
std::ostream &  out 
) const [virtual]

Print a state to a stream.

Reimplemented from ompl::base::StateSpace.

virtual void ompl::base::DiscreteStateSpace::registerProjections ( void   )  [virtual]

Register the projections for this state space. Usually, this is at least the default projection. These are implicit projections, set by the implementation of the state space. This is called by setup().

Reimplemented from ompl::base::StateSpace.

virtual bool ompl::base::DiscreteStateSpace::satisfiesBounds ( const State state  )  const [virtual]

Check if a state is inside the bounding box. For unbounded spaces this function can always return true.

Implements ompl::base::StateSpace.

void ompl::base::DiscreteStateSpace::setBounds ( int  lowerBound,
int  upperBound 
) [inline]

Set the bounds for the states in this space (the states will be in the set [lowerBound, upperBound].

Definition at line 141 of file DiscreteStateSpace.h.

virtual void ompl::base::DiscreteStateSpace::setup ( void   )  [virtual]

Perform final setup steps. This function is automatically called by the SpaceInformation. If any default projections are to be registered, this call will set them. It is safe to call this function multiple times.

Reimplemented from ompl::base::StateSpace.


Member Data Documentation

The lowest integer state.

Definition at line 152 of file DiscreteStateSpace.h.

The highest integer state.

Definition at line 155 of file DiscreteStateSpace.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


ompl
Author(s): Ioan Sucan/isucan@rice.edu, Mark Moll/mmoll@rice.edu, Lydia Kavraki/kavraki@rice.edu
autogenerated on Fri Jan 11 11:37:46 2013