
I verified the documentation changes for grid graph indexing calls and A*
visitors. Looks good.
Now doing edge weights with a static_property_map<>.
I've duplicated relevant information from the README at the top of maze.cpp,
so README doesn't need to be included in the Boost examples.
I found that I have to implement my own vertex index map, though I'm not
sure exactly why. If I remove all my vertex index map code and call A* with
the default map like so:
astar_search(m_barrier_grid,
source(),
heuristic,
boost::weight_map(weight).
predecessor_map(pred_pmap).
distance_map(dist_pmap).
visitor(visitor) );
I get the following error:
g++ -g -I/src/boost-trunk -Wall -Werror -O3 -c -o maze.o maze.cpp
/src/boost-trunk/boost/graph/graph_traits.hpp: In instantiation of
‘boost::vertex_property_type<grid>’:
/src/boost-trunk/boost/graph/filtered_graph.hpp:226: instantiated from
‘boost::vertex_property_type &) [with VertexListGraph = filtered_grid,
AStarHeuristic = euclidean_heuristic, P = astar_goal_visitor, T =
boost::graph_visitor_t, R =
boost::bgl_named_params &) [with VertexListGraph = filtered_grid,
AStarHeuristic = euclidean_heuristic, P = astar_goal_visitor, T =
boost::graph_visitor_t, R =
boost::bgl_named_params On Wed, 14 Jul 2010, W.P. McNeill wrote: A-Star-Maze solver is pretty much done. The filtered_graph does make the code a lot simpler. I used lexical_cast and Boost's random number
facilities, but decided the Boost command line processing code was overkill
for this example. The warnings you added about not subclassing BGL types
look good. OK. Two things that look like documentation errors: 1. On the A* search page, the examine_vertex prototype for the visitor is
listed as vis.examine_vertex(u, g), but you actually need it to be vis.examine_vertex(u, const g) in order for the code the build.
(This may be true for the other visitor functions as well.) This tripped
me up when
I first wrote my visitor class. I'm not sure if you want to specify
the constants here, or let them be assumed.
2. The grid graph indexing documentation incorrectly states that you get
a vertex index with get(boost::vertex_index, vertex_descriptor, const
Graph&). The order of the last two parameters is switched. The header actually
specifies get(boost::vertex_index, const Graph&, vertex_descriptor). This
appears to be the case in the documentation for a number of the
get(...) functions. I believe I fixed both of these now. Please check. BTW, you don't need to create your own weight map if the weights are all
the same; just use something like static_property_map<double>(1.) as the
weight map. Also, why do you need your own vertex index map? It appears to
just forward to the grid graph's version; why not just use that one
directly? It appears that filtered_graph forwards property map requests to
the underlying graph by default anyway, so you might just be able to remove
that argument from your call to astar_search. You also don't need to call
num_vertices() on the underlying graph; calling it on the filtered_graph
does the same thing. Does your random_int() function re-seed the RNG to get
a different answer each time? I think overall that your code is nearly ready to put in. What did you
want me to do with the README.md file? Put that in the documentation
somewhere, or is most of the content in there about building it outside
Boost (where it will build with the rest of the BGL examples using
Boost.Build)? -- Jeremiah Willcock
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users