Revision 198:7f89dcc4634c

View differences:

src/main/java/cz/agents/dimaptools/search/GlobalLocalDistributedBestFirstSearch.java
45 45
    protected final Problem problem;
46 46
    protected final PriorityBlockingQueue<SearchState> openGlobal;
47 47
    protected final PriorityBlockingQueue<SearchState> openLocal;
48
    
48 49
    protected final TIntHashSet closed = new TIntHashSet();
50
    protected final TIntHashSet closedLocal = new TIntHashSet();
51
    private boolean useLocalClosed = false;
49 52

  
50 53
    protected RelaxationHeuristic localHeuristic;
51 54
    protected RecursiveDistributedRelaxationRequestHeuristic requestGlobalHeuristic;
......
190 193
        }
191 194
        
192 195
        recomputeHeuristicOnReceive = config.getBoolean("recomputeHeuristicOnReceive", false);
196
        useLocalClosed = config.getBoolean("useLocalClosed", false);
193 197
    }
194 198

  
195 199

  
......
283 287
        				localState = openLocal.poll();
284 288
        			}
285 289
        			
286
        			if (state != null && !(closed.contains(localState.hashCode()) && local)) {
290
        			if (state != null && !(closed.contains(localState.hashCode()) && local) && !(useLocalClosed && closedLocal.contains(localState.hashCode()))) {
287 291

  
288
//                        closed.add(localState.hashCode());
292
                        if(useLocalClosed)closedLocal.add(localState.hashCode());
289 293
                        
290 294
        				if(state.getHeuristic() < minLH){
291 295
        	              	minLH = state.getHeuristic();

Also available in: Unified diff