Boost logo

Boost Users :

Subject: Re: [Boost-users] Default weight map doesn't work for weighted grid graph in A-star search
From: W.P. McNeill (billmcn_at_[hidden])
Date: 2010-07-01 13:56:44


Compiling with
https://svn.boost.org/svn/boost/trunk/boost/graph/astar_search.hpp (r63472).
 Looks like the same error. I included a little more of the error spew in
case it helps.

One thing I'm confused about: what
should weighted_grid::vertex_property_type be? I didn't see anything in the
a-star documentation about this type, but I had to add it in order to get
things to compile this far. Right now I've got it set to vertex_descriptor,
though I get the same error if it's vertices_size_type.

g++ -g -I/opt/local/include -c -o main.o main.cpp
/opt/local/include/boost/graph/named_function_params.hpp: In static member
function ‘static typename boost::detail::choose_default_param::bind_<P,
Graph, Tag>::const_result_type
boost::detail::choose_default_param::const_apply(const P&, const Graph&,
Tag) [with P = boost::detail::error_property_not_found, Graph =
boost::weighted_grid, Tag = boost::vertex_index_t]’:
/opt/local/include/boost/graph/named_function_params.hpp:304: instantiated
from ‘typename boost::detail::choose_pmap_helper<Param, Graph,
Tag>::const_result_type boost::choose_const_pmap(const Param&, const Graph&,
PropertyTag) [with Param = boost::detail::error_property_not_found, Graph =
boost::weighted_grid, PropertyTag = boost::vertex_index_t]’
astar_search.hpp:370: instantiated from ‘void
boost::astar_search(VertexListGraph&, typename
boost::graph_traits<G>::vertex_descriptor, AStarHeuristic, const
boost::bgl_named_params<P, T, R>&) [with VertexListGraph =
boost::weighted_grid, AStarHeuristic = boost::euclidean_heuristic, P =
boost::astar_goal_visitor, T = boost::graph_visitor_t, R =
boost::no_property]’
main.cpp:23: instantiated from here
/opt/local/include/boost/graph/named_function_params.hpp:253: error:
conversion from ‘boost::grid_graph_index_map<boost::grid_graph<2ul, size_t,
size_t>, boost::array<size_t, 2ul>, size_t>’ to non-scalar type
‘boost::typed_identity_property_map<size_t>’ requested
/opt/local/include/boost/property_map/property_map.hpp: In function ‘void
boost::put(const boost::put_get_helper<Reference, PropertyMap>&, K, const
V&) [with PropertyMap =
boost::vector_property_map<boost::default_color_type,
boost::typed_identity_property_map<size_t> >, Reference =
boost::default_color_type&, K = boost::array<size_t, 2ul>, V =
boost::default_color_type]’:
astar_search.hpp:288: instantiated from ‘void
boost::astar_search(VertexListGraph&, typename
boost::graph_traits<G>::vertex_descriptor, AStarHeuristic, AStarVisitor,
PredecessorMap, CostMap, DistanceMap, WeightMap, VertexIndexMap, ColorMap,
CompareFunction, CombineFunction, CostInf, CostZero) [with VertexListGraph =
boost::weighted_grid, AStarHeuristic = boost::euclidean_heuristic,
AStarVisitor = boost::astar_goal_visitor, PredecessorMap =
boost::dummy_property_map, CostMap = boost::vector_property_map<float,
boost::typed_identity_property_map<size_t> >, DistanceMap =
boost::vector_property_map<float, boost::typed_identity_property_map<size_t>
>, WeightMap = boost::edge_weight_map, VertexIndexMap =
boost::typed_identity_property_map<size_t>, ColorMap =
boost::vector_property_map<boost::default_color_type,
boost::typed_identity_property_map<size_t> >, CompareFunction =
std::less<float>, CombineFunction = boost::closed_plus<float>, CostInf =
float, CostZero = float]’
astar_search.hpp:319: instantiated from ‘void
boost::detail::astar_dispatch2(VertexListGraph&, typename
boost::graph_traits<G>::vertex_descriptor, AStarHeuristic, CostMap,
DistanceMap, WeightMap, IndexMap, ColorMap, const Params&) [with
VertexListGraph = boost::weighted_grid, AStarHeuristic =
boost::euclidean_heuristic, CostMap = boost::vector_property_map<float,
boost::typed_identity_property_map<size_t> >, DistanceMap =
boost::vector_property_map<float, boost::typed_identity_property_map<size_t>
>, WeightMap = boost::edge_weight_map, IndexMap =
boost::typed_identity_property_map<size_t>, ColorMap =
boost::vector_property_map<boost::default_color_type,
boost::typed_identity_property_map<size_t> >, Params =
boost::bgl_named_params<boost::astar_goal_visitor, boost::graph_visitor_t,
boost::no_property>]’
astar_search.hpp:348: instantiated from ‘void
boost::detail::astar_dispatch1(VertexListGraph&, typename
boost::graph_traits<G>::vertex_descriptor, AStarHeuristic, CostMap,
DistanceMap, WeightMap, IndexMap, ColorMap, const Params&) [with
VertexListGraph = boost::weighted_grid, AStarHeuristic =
boost::euclidean_heuristic, CostMap =
boost::detail::error_property_not_found, DistanceMap =
boost::detail::error_property_not_found, WeightMap = boost::edge_weight_map,
IndexMap = boost::typed_identity_property_map<size_t>, ColorMap =
boost::detail::error_property_not_found, Params =
boost::bgl_named_params<boost::astar_goal_visitor, boost::graph_visitor_t,
boost::no_property>]’
astar_search.hpp:370: instantiated from ‘void
boost::astar_search(VertexListGraph&, typename
boost::graph_traits<G>::vertex_descriptor, AStarHeuristic, const
boost::bgl_named_params<P, T, R>&) [with VertexListGraph =
boost::weighted_grid, AStarHeuristic = boost::euclidean_heuristic, P =
boost::astar_goal_visitor, T = boost::graph_visitor_t, R =
boost::no_property]’
main.cpp:23: instantiated from here
/opt/local/include/boost/property_map/property_map.hpp:325: error: no match
for ‘operator[]’ in ‘(const
boost::vector_property_map<boost::default_color_type,
boost::typed_identity_property_map<size_t> >&)((const
boost::vector_property_map<boost::default_color_type,
boost::typed_identity_property_map<size_t> >*)(& pa))[k]’

On Thu, Jul 1, 2010 at 7:04 AM, Jeremiah Willcock <jewillco_at_[hidden]>wrote:

> On Thu, 1 Jul 2010, W.P. McNeill wrote:
>
> The new grid_graph.hpp header gets me a little farther.
>>
>> The trivial program complies when I use the grid_graph.hpp (r63333)
>> version you pointed me too.
>> I still can't compile my weighted_grid graph program with the new
>> grid_graph header, but I do think I'm getting further along. After making
>> various minor changes
>> (documented on github), I am trying to compile
>>
>> dimension_array dimensions = { {3, 4} };
>> weighted_grid g(dimensions);
>> vertex_descriptor source = vertex(0, g), goal = vertex(3, g);
>> astar_search(g,
>> source,
>> euclidean_heuristic(goal),
>> visitor(astar_goal_visitor(goal)) );
>>
>> The top of the error spew looks like this
>>
>> g++ -g -I/opt/local/include -c -o main.o main.cpp
>> /opt/local/include/boost/graph/named_function_params.hpp: In static member
>> function ‘static typename boost::detail::choose_default_param::bind_<P,
>> Graph,
>> Tag>::const_result_type
>> boost::detail::choose_default_param::const_apply(const P&, const Graph&,
>> Tag) [with P = boost::detail::error_property_not_found, Graph =
>> boost::weighted_grid, Tag = boost::vertex_index_t]’:
>> /opt/local/include/boost/graph/named_function_params.hpp:304:
>> instantiated from ‘typename boost::detail::choose_pmap_helper<Param, Graph,
>> Tag>::const_result_type boost::choose_const_pmap(const Param&, const
>> Graph&, PropertyTag) [with Param = boost::detail::error_property_not_found,
>> Graph =
>> boost::weighted_grid, PropertyTag = boost::vertex_index_t]’
>> /opt/local/include/boost/graph/astar_search.hpp:372: instantiated from
>> ‘void boost::astar_search(VertexListGraph&, typename
>> boost::graph_traits<G>::vertex_descriptor, AStarHeuristic, const
>> boost::bgl_named_params<P, T, R>&) [with VertexListGraph =
>> boost::weighted_grid, AStarHeuristic =
>> boost::euclidean_heuristic, P = boost::astar_goal_visitor, T =
>> boost::graph_visitor_t, R = boost::no_property]’
>> main.cpp:23: instantiated from here
>> /opt/local/include/boost/graph/named_function_params.hpp:253: error:
>> conversion from ‘boost::grid_graph_index_map<boost::grid_graph<2ul, size_t,
>> size_t>,
>> boost::array<size_t, 2ul>, size_t>’ to non-scalar type
>> ‘boost::typed_identity_property_map<size_t>’ requested
>>
>> The named_function_params.hpp is calling get(), I think to acquire a
>> vertex_index_map. The default vertex_index_map is being created
>> incorrectly, but I can't
>> figure out how.
>>
>> Note that I can acquire and use the vertex index. For example, the
>> following call in main() function
>>
>> get(vertex_index, g)[source]
>>
>> returns (size_t) 0 as it should.
>>
>
> Could you please try with the trunk version of astar_search.hpp? That will
> allow me to line up your line numbers with my copy.
>
> -- Jeremiah Willcock
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net