001    package aima.search.framework;
002    
003    import java.util.Comparator;
004    import java.util.List;
005    
006    import aima.search.nodestore.PriorityNodeStore;
007    
008    /**
009     * @author Ravi Mohan
010     * 
011     */
012    public abstract class PrioritySearch implements Search {
013            protected QueueSearch search;
014    
015            public List search(Problem p) throws Exception {
016                    return search.search(p, new PriorityNodeStore(getComparator(p)));
017            }
018    
019            public Metrics getMetrics() {
020                    return search.getMetrics();
021            }
022    
023            //
024            // PROTECTED METHODS
025            //
026            protected abstract Comparator<Node> getComparator(Problem p);
027    }