47 void ompl::base::GoalStates::clear()
71 void ompl::base::GoalStates::print(std::ostream &out) const
73 out << states_.size() << " goal states, threshold = " << threshold_ << ", memory address = " << this << std::endl;
84 throw Exception("There are no goals to sample");
90 // Increment the counter. Do NOT roll over incase a new state is added before sampleGoal is called again.
94 unsigned int ompl::base::GoalStates::maxSampleCount() const
112 throw Exception("Index " + std::to_string(index) + " out of range. Only " + std::to_string(states_.size()) +
117 std::size_t ompl::base::GoalStates::getStateCount() const
122 bool ompl::base::GoalStates::hasStates() const
virtual void clear()
Clear all goal states.
void print(std::ostream &out=std::cout) const override
Print information about the goal data structure to a stream.
void sampleGoal(State *st) const override
Sample a state in the goal region.
StateType * get()
Returns a pointer to the contained state.
double distanceGoal(const State *st) const override
Compute the distance to the goal (heuristic). This function is the one used in computing the distance...
virtual const State * getState(unsigned int index) const
Return a pointer to the indexth state in the state list.
virtual void addState(const State *st)
Add a goal state.
unsigned int maxSampleCount() const override
Return the maximum number of samples that can be asked for before repeating.
virtual std::size_t getStateCount() const
Return the number of valid goal states.
virtual bool hasStates() const
Check if there are any states in this goal region.