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
Cell * topExternal() const
Return the cell that is at the top of the heap maintaining external cells.
Definition: GridB.h:117
virtual void destroyCell(Cell *cell) const
Clear the memory occupied by a cell; do not call this function unless remove() was called first...
Definition: Grid.h:258
Cell * topInternal() const
Return the cell that is at the top of the heap maintaining internal cells.
Definition: GridB.h:110
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
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
int halfNormalInt(int r_min, int r_max, double focus=3.0)
Generate a random integer using a half-normal distribution. The value is within specified bounds ([r_...
Definition: RandomNumbers.cpp:167
void update(Cell *cell)
Update the position in the heaps for a particular cell.
Definition: GridB.h:148
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
std::vector< Motion * > motions
The set of motions contained in this grid cell.
Definition: Discretization.h:75
virtual Cell * createCell(const Coord &coord, CellArray *nbh=NULL)
Create a cell but do not add it to the grid; update neighboring cells however.
Definition: GridB.h:171
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
Cell * getCell(const Coord &coord) const
Get the cell at a specified coordinate.
Definition: GridN.h:132
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 getContent(std::vector< _T > &content) const
Get the data stored in the cells we are aware of.
Definition: Grid.h:264
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