43 Expander(p_calc, nx, ny), pending_(NULL), precise_(false) {
81 int cycles,
float* potential) {
95 int k =
toIndex(start_x, start_y);
99 double dx = start_x - (int)start_x, dy = start_y - (
int)start_y;
100 dx = floorf(dx * 100 + 0.5) / 100;
101 dy = floorf(dy * 100 + 0.5) / 100;
129 int startCell =
toIndex(end_x, end_y);
131 for (; cycle < cycles; cycle++)
172 if (potential[startCell] <
POT_HIGH)
190 #define INVSQRT2 0.707106781 203 if (pot < potential[n]) {
212 if (potential[n - 1] > pot + le)
214 if (potential[n + 1] > pot + re)
216 if (potential[n -
nx_] > pot + ue)
218 if (potential[n +
nx_] > pot + de)
222 if (potential[n - 1] > pot + le)
224 if (potential[n + 1] > pot + re)
226 if (potential[n -
nx_] > pot + ue)
228 if (potential[n +
nx_] > pot + de)
virtual float calculatePotential(float *potential, unsigned char cost, int n, float prev_potential=-1)
DijkstraExpansion(PotentialCalculator *p_calc, int nx, int ny)
virtual void setSize(int nx, int ny)
Sets or resets the size of the map.
void setSize(int nx, int ny)
Sets or resets the size of the map.
unsigned char lethal_cost_
void updateCell(unsigned char *costs, float *potential, int n)
Updates the cell at index n.
int toIndex(int x, int y)
float getCost(unsigned char *costs, int n)
unsigned char neutral_cost_
PotentialCalculator * p_calc_
bool calculatePotentials(unsigned char *costs, double start_x, double start_y, double end_x, double end_y, int cycles, float *potential)