40 double cell_pass_through_time =
DBL_MAX;
44 double max_vel = (1 - (double) cost / 256) * 1.0;
45 cell_pass_through_time = 1 / max_vel;
50 return cell_pass_through_time;
62 for(
unsigned int i = 0; i <
width_; ++i) {
68 for(
unsigned int x = 0; x <
width_; ++x) {
73 for(
unsigned int y = 0; y <
height_; ++y) {
82 double min_cell_cost = 1;
83 for(
unsigned int x = 1; x <
width_ - 1; ++x) {
84 for(
unsigned int y = 1; y <
height_ - 1; ++y) {
95 for (
unsigned int i = 0; i < mx_start.
size(); ++i)
97 if (mx_start[i] > 0 && mx_start[i] <
width_-1 && my_start[i] > 0 && my_start[i] <
height_-1)
108 double best_score = 1e9;
110 while(!Q.
empty() && !goal_cell) {
116 if (
c->x_ == mx_goal &&
c->y_ == my_goal) {
121 if (
c->h_ < best_score) {
153 }
else if (best_heuristic) {
177 int x_goal,
int y_goal,
double min_cell_cost,
184 double g_child =
c->g_ +
getCost(x, y) * cost_factor;
185 if (g_child < visited_map[x][y]) {
194 double dx = (double)(x_goal - x);
195 double dy = (double)(y_goal - y);
196 return sqrt(dx * dx + dy * dy) * min_cell_cost;
200 for(
unsigned int i = 0; i <
width_; ++i) {