Open risicle opened 3 years ago
Let me attach the code for clarity.
m_vis.edge_relaxed(e, g);
put(m_cost, target(e, g),
m_combine(
get(m_distance, target(e, g)), m_h(target(e, g))));
put(m_cost, target(e, g),
m_combine(
get(m_distance, target(e, g)), m_h(target(e, g))));
m_Q.update(target(e, g));
m_vis.edge_relaxed(e, g);
m_vis.edge_relaxed(e, g);
put(m_cost, target(e, g),
m_combine(
get(m_distance, target(e, g)), m_h(target(e, g))));
m_Q.push(target(e, g));
put(m_color, target(e, g), Color::gray());
m_vis.black_target(e, g);
At the moment of edge_relaxed
event:
The queue should probably be updated after edge_relaxed
, to be consistent with “outer” breadth_first_visit.
The cost map should almost certainly be updated before edge_relaxed
.
Could one of you make a PR to fix it? @qbit86 I think you already have the code ready? :)
astar_bfs_visitor
callsm_vis.edge_relaxed
before setting the new cost map value intree_edge
andblack_target
(and inastar_search_no_init_tree
's main loop from the looks of it), but afterwards ingray_target
. This is very confusing if you want to look up the new cost value in your visitor method.