Discretization.h
136 throw Exception("The fraction of time spent selecting border cells must be in the range (0,1]");
226 scell = rng_.uniform01() < std::max(selectBorderFraction_, grid_.fracExternal()) ? grid_.topExternal() :
282 void getPlannerData(base::PlannerData &data, int tag, bool start, const Motion *lastGoalMotion) const
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:120
void freeMemory()
Free the memory for the motions contained in a grid.
Definition: Discretization.h:178
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:249
The data held by a cell in the grid of motions.
Definition: Discretization.h:62
unsigned int selections
The number of times this cell has been selected for expansion.
Definition: Discretization.h:78
STL namespace.
Cell * getCell(const Coord &coord) const
Get the cell at a specified coordinate.
Definition: GridN.h:121
void getContent(std::vector< _T > &content) const
Get the data stored in the cells we are aware of.
Definition: Grid.h:255
double coverage
A measure of coverage for this cell. For this implementation, this is the sum of motion lengths...
Definition: Discretization.h:74
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:269
void update(Cell *cell)
Update the position in the heaps for a particular cell.
Definition: GridB.h:139
One-level discretization used for KPIECE.
Definition: Discretization.h:58
Cell * topExternal() const
Return the cell that is at the top of the heap maintaining external cells.
Definition: GridB.h:108
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:193
double getBorderFraction() const
Set the fraction of time for focusing on the border (between 0 and 1).
Definition: Discretization.h:142
std::vector< Motion * > motions
The set of motions contained in this grid cell.
Definition: Discretization.h:69
GridB< CellData *, OrderCellsByImportance > Grid
The datatype for the maintained grid datastructure.
Definition: Discretization.h:104
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:224
bool operator()(const CellData *const a, const CellData *const b) const
Order function.
Definition: Discretization.h:97
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:133
double score
A heuristic score computed based on distance to goal (if available), successes and failures at expand...
Definition: Discretization.h:83
Cell * topInternal() const
Return the cell that is at the top of the heap maintaining internal cells.
Definition: GridB.h:101
std::function< void(Motion *)> FreeMotionFn
The signature of a function that frees the memory for a motion.
Definition: Discretization.h:113
void setDimension(unsigned int dim)
Set the dimension of the grid to be maintained.
Definition: Discretization.h:148
double importance
The computed importance (based on other class members)
Definition: Discretization.h:89
Definintion of an operator passed to the Grid structure, to order cells by importance.
Definition: Discretization.h:94
virtual Cell * createCell(const Coord &coord, CellArray *nbh=nullptr)
Create a cell but do not add it to the grid; update neighboring cells however.
Definition: GridB.h:162