NODE
- public class AStarHeapComparator<NODE> extends Object implements Comparator
AStarHeap
to compare nodes inside the heap.
The trick is, that it is initialized AStarHeapComparator(Map)
with a map
that contains node's costs that are used during the comparation inside compare(Object, Object)
.
No magic yet, ha? Well, the magic is that this map is not cloned... simply a pointer to this very instance passed
inside the constructor is saved to you may alter the cost as you wish to! Which is truly needed by the AStar
class
that is obtaining nodes' costs from the AStarMap
implementor.
Constructor and Description |
---|
AStarHeapComparator(Map<NODE,Integer> estimatedCosts) |
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.