Revision 191:2c3e9e1718d6

View differences:

src/main/java/cz/agents/dimaptools/search/DistributedBestFirstSearch.java
4 4
import gnu.trove.TIntObjectHashMap;
5 5

  
6 6
import java.util.Arrays;
7
import java.util.Comparator;
7 8
import java.util.HashSet;
8 9
import java.util.LinkedList;
9 10
import java.util.List;
......
40 41
    private static final Logger LOGGER = Logger.getLogger(DistributedBestFirstSearch.class);
41 42

  
42 43
    protected final Problem problem;
43
    protected final PriorityBlockingQueue<SearchState> open = new PriorityBlockingQueue<SearchState>();
44
    protected final PriorityBlockingQueue<SearchState> open;
44 45
    protected final TIntHashSet closed = new TIntHashSet();
45 46

  
46 47
    protected HeuristicInterface heuristic;
......
81 82

  
82 83
        heuristic = new GoalSatHeuristic(problem.goalSuperState);
83 84
        requestHeuristic = heuristic;
85
        
86
        open = new PriorityBlockingQueue<SearchState>(10000,new Comparator<SearchState>(){
87

  
88
			@Override
89
			public int compare(SearchState arg0, SearchState arg1) {
90
				return arg0.getHeuristic() - arg1.getHeuristic();
91
			}
92
        	
93
        });
84 94

  
85 95
        protocol = new DistributedSearchProtocol(comm, world.getAgentName(), world.getEncoder()) {
86 96

  

Also available in: Unified diff