package cz.cuni.amis.utils.astar;

import java.util.Comparator;
import java.util.HashMap;

public class AStarHeapComparator<NODE> implements Comparator {
	
	private HashMap<NODE, Integer> values;
	
	public AStarHeapComparator(HashMap<NODE, Integer> estimatedCosts){
		values = estimatedCosts;
	}

	public int compare(Object arg0, Object arg1) {
		Integer val0 = (Integer)values.get(arg0);
		Integer val1 = (Integer)values.get(arg1);
		return val0.intValue() - val1.intValue();
	}

}
