Boost logo

Boost Users :

Subject: [Boost-users] issues with cost_map is a_star algo
From: Mangal (mangalmanish_at_[hidden])
Date: 2010-03-27 15:27:58


I have a working modified Dijkstras algo using boost.
My graph has an edge_property called my_edge_property.
The type of distance_map is time_duration.
I provide a distance_combine class which has a function with signature
 time_duration my_distance_combine::operator()(const time_duration
&timeAtVertex, const my_edge_property &weight)
 {
        //My Implementation
 }
 distance_infinity has a value pos_infin.

This modified version of Disjkstra algorithm works fine and runs correctly.

Now I want to use a_star algorithm instead of dijisktra.
So I provided a hueristic class with a function
time_duration myhuersticClass::operator() (vertex_descriptor u)
{
        //My Implementation
}
and pass that as the hueristic function to a_star algorithm.

I expected this should be enough for everything to work but I get compile
errors.
 the error is in file astar_search.hpp (line 289)
put(cost, *ui, inf);// compile error at this line

error C2679: binary '=' : no operator found which takes a right-hand operand
of type 'const boost::date_time::special_values' (or there is no acceptable
conversion)

Now in the same file one line above that statement
put(distance, *ui, inf);
compiles fine.

The documentation says that the type of cost_map and distance_map are be the
same.
If that is the case then why does assiging pos_inifn to cost_map does not
work??

Looking at it closely I see that

CostInf=boost::date_time::special_values, (which is correct)
CostZero=my_edge_property (???? do not understand)

Also why is the type of CostZero= my_edge_property (if I try to pass
distance_zero as minutes(0) compiler does not like it and complains that
time_duration cannot be converted to
my_edge_property)

Looks like cost_map is vector<my_edge_property> and not
vector<time_duration> which is what the distance_map is.
I don't see any way to passthe cost_map to a_star function.
Any ideas??

-- 
View this message in context: http://old.nabble.com/issues-with-cost_map-is-a_star-algo-tp28054643p28054643.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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