Discretization.h
122 Discretization(const FreeMotionFn &freeMotion) : grid_(0), size_(0), iteration_(1), recentCell_(NULL),
143 throw Exception("The fraction of time spent selecting border cells must be in the range (0,1]");
243 for (typename std::vector<CellData*>::iterator it = content.begin() ; it != content.end() ; ++it)
289 void getPlannerData(base::PlannerData &data, int tag, bool start, const Motion *lastGoalMotion) const
Object containing planner generated vertex and edge data. It is assumed that all vertices are unique...
Definition: PlannerData.h:164
boost::function< void(Motion *)> FreeMotionFn
The signature of a function that frees the memory for a motion.
Definition: Discretization.h:120
void log(const char *file, int line, LogLevel level, const char *m,...)
Root level logging function. This should not be invoked directly, but rather used via a logging macro...
Definition: Console.cpp:104
void freeMemory()
Free the memory for the motions contained in a grid.
Definition: Discretization.h:185
unsigned int addGoalVertex(const PlannerDataVertex &v)
Adds the given vertex to the graph data, and marks it as a start vertex. The vertex index is returned...
Definition: PlannerData.cpp:434
The data held by a cell in the grid of motions.
Definition: Discretization.h:64
unsigned int selections
The number of times this cell has been selected for expansion.
Definition: Discretization.h:84
double coverage
A measure of coverage for this cell. For this implementation, this is the sum of motion lengths...
Definition: Discretization.h:80
Base class for a vertex in the PlannerData structure. All derived classes must implement the clone an...
Definition: PlannerData.h:60
Random number generation. An instance of this class cannot be used by multiple threads at once (membe...
Definition: RandomNumbers.h:54
One-level discretization used for KPIECE.
Definition: Discretization.h:59
double getBorderFraction() const
Set the fraction of time for focusing on the border (between 0 and 1).
Definition: Discretization.h:149
unsigned int addMotion(Motion *motion, const Coord &coord, double dist=0.0)
Add a motion to the grid containing motions. As a hint, dist specifies the distance to the goal from ...
Definition: Discretization.h:200
bool operator()(const CellData *const a, const CellData *const b) const
Order function.
Definition: Discretization.h:104
virtual bool addEdge(unsigned int v1, unsigned int v2, const PlannerDataEdge &edge=PlannerDataEdge(), Cost weight=Cost(1.0))
Adds a directed edge between the given vertex indexes. An optional edge structure and weight can be s...
Definition: PlannerData.cpp:444
unsigned int addStartVertex(const PlannerDataVertex &v)
Adds the given vertex to the graph data, and marks it as a start vertex. The vertex index is returned...
Definition: PlannerData.cpp:425
std::vector< Motion * > motions
The set of motions contained in this grid cell.
Definition: Discretization.h:75
void selectMotion(Motion *&smotion, Cell *&scell)
Select a motion and the cell it is part of from the grid of motions. This is where preference is give...
Definition: Discretization.h:231
void setBorderFraction(double bp)
Set the fraction of time for focusing on the border (between 0 and 1). This is the minimum fraction u...
Definition: Discretization.h:140
double score
A heuristic score computed based on distance to goal (if available), successes and failures at expand...
Definition: Discretization.h:89
GridB< CellData *, OrderCellsByImportance > Grid
The datatype for the maintained grid datastructure.
Definition: Discretization.h:111
void setDimension(unsigned int dim)
Set the dimension of the grid to be maintained.
Definition: Discretization.h:155
double importance
The computed importance (based on other class members)
Definition: Discretization.h:95
Definintion of an operator passed to the Grid structure, to order cells by importance.
Definition: Discretization.h:100