37 #include "ompl/base/spaces/DiscreteStateSpace.h"
38 #include "ompl/util/Exception.h"
51 const int d = (int)floor(distance + 0.5);
55 space_->enforceBounds(state);
62 space_->enforceBounds(state);
77 return upperBound_ - lowerBound_;
155 virtual unsigned int getDimension(
void)
const
160 virtual void defaultCellSizes(
void)
162 cellSizes_.resize(1);
172 registerDefaultProjection(
ProjectionEvaluatorPtr(dynamic_cast<ProjectionEvaluator*>(
new DiscreteDefaultProjection(
this))));
177 if (lowerBound_ > upperBound_)
178 throw Exception(
"Lower bound cannot be larger than upper bound for a discrete space");
184 out <<
"DiscreteState [";
189 out <<
']' << std::endl;
194 out <<
"Discrete state space '" << getName() <<
"' with bounds [" << lowerBound_ <<
", " << upperBound_ <<
"]" << std::endl;