On 07/24/2013 10:12 PM, Guillaume Lemaître wrote:
> test_graph_tool.py
> <http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/file/n4025093/test_graph_tool.py>
>
> I think this should show you the discrepancy. I currently have no other
> version than 2.2.17 available, but I am pretty sure this example is
> demonstrative enough.

Thanks for the example. I've fixed this in the git version (commit
d2b60b9985).

Note that I had to change your Distance2D class to contain the less than
operator:

     def __lt__(self, other):
        return self.euclidian_distance() < other.euclidian_distance()

The default comparison function of astar_search() is 'a < b'. Optionally
you could have overridden the comparison as well. The output I got was:

    Minimal distance : 3.41 meters
    (2, 2) <- (2, 1) <- (1, 1) <- (0, 0)

Which I assume is correct.

Cheers,
Tiago

-- 
Tiago de Paula Peixoto <[email protected]>

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
graph-tool mailing list
[email protected]
http://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to