20 template <
class Graph,
21 class HeuristicMap,
class PredecessorMap,
class DistanceMap,
22 class CostMap,
class ColorMap,
23 typename CompareFunction,
typename CombineFunction>
27 typedef typename boost::graph_traits<Graph>::vertex_descriptor Vertex;
28 typedef typename boost::graph_traits<Graph>::edge_descriptor Edge;
29 typedef typename boost::property_traits<DistanceMap>::value_type weight_type;
37 inline void initialize_vertex(Vertex u,
const Graph & g) {}
38 inline void discover_vertex(Vertex u,
const Graph & g) {}
39 inline void examine_vertex(Vertex u,
const Graph & g)
44 inline void examine_edge(Edge e,
const Graph & g) {}
45 inline void edge_relaxed(Edge e,
const Graph & g) {}
46 inline void edge_not_relaxed(Edge e,
const Graph & g) {}
47 inline void black_target(Edge e,
const Graph & g) {}
48 inline void finish_vertex(Vertex u,
const Graph & g) {}
54 HeuristicMap heuristic_map;
55 map_heuristic(HeuristicMap heuristic_map): heuristic_map(heuristic_map) {}
56 inline weight_type operator()(Vertex u)
58 return get(heuristic_map, u);
62 HeuristicMap heuristic_map;
63 PredecessorMap predecessor_map;
64 DistanceMap distance_map;
67 CompareFunction compare;
68 CombineFunction combine;
72 lazysp_incsp_astar(HeuristicMap heuristic_map, PredecessorMap predecessor_map, DistanceMap distance_map,
73 CostMap cost_map, ColorMap color_map,
74 CompareFunction compare, CombineFunction combine,
75 weight_type inf, weight_type zero):
76 heuristic_map(heuristic_map), predecessor_map(predecessor_map), distance_map(distance_map),
77 cost_map(cost_map), color_map(color_map),
78 compare(compare), combine(combine), inf(inf), zero(zero)
81 template <
typename WMap>
82 weight_type solve(
const Graph & g, Vertex v_start, Vertex v_goal,
83 WMap wmap, std::vector<Edge> & path)
90 map_heuristic(heuristic_map),
91 throw_visitor(v_goal),
96 get(boost::vertex_index, g),
98 compare, combine, inf, zero
101 catch (
const throw_visitor_exception & ex)
105 if (
get(distance_map,v_goal) == inf)
110 for (Vertex v_walk=v_goal; v_walk!=v_start;)
112 Vertex v_pred =
get(predecessor_map, v_walk);
113 std::pair<Edge,bool> ret = edge(v_pred, v_walk, g);
114 BOOST_ASSERT(ret.second);
115 path.push_back(ret.first);
118 std::reverse(path.begin(),path.end());
120 return get(distance_map, v_goal);
123 void update_notify(Edge e)
128 template <
class Graph,
class HeuristicMap,
class PredecessorMap,
class DistanceMap,
class CostMap,
class ColorMap,
typename CompareFunction,
typename CombineFunction>
129 lazysp_incsp_astar<Graph,HeuristicMap,PredecessorMap,DistanceMap,CostMap,ColorMap,CompareFunction,CombineFunction>
130 make_lazysp_incsp_astar(HeuristicMap heuristic_map, PredecessorMap predecessor_map, DistanceMap distance_map, CostMap cost_map, ColorMap color_map, CompareFunction compare, CombineFunction combine,
typename boost::property_traits<DistanceMap>::value_type inf,
typename boost::property_traits<DistanceMap>::value_type zero)
132 return lazysp_incsp_astar<Graph,HeuristicMap,PredecessorMap,DistanceMap,CostMap,ColorMap,CompareFunction,CombineFunction>(heuristic_map, predecessor_map, distance_map, cost_map, color_map, compare, combine, inf, zero);
Definition: lazysp_incsp_astar.h:32
Definition: lazysp_incsp_astar.h:51
Definition: lazysp_incsp_astar.h:31
Adaptor to use boost::astar_search as the inner sp algorithm for pr_bgl::lazysp.
Definition: lazysp_incsp_astar.h:24