Revision 349:fee3d34ccaa7

View differences:

src/main/java/cz/agents/dimaptools/heuristic/relaxed/LazilyDistributedSAFFRequestHeuristic.java
51 51
		agentID = world.getAgentID();
52 52
		this.maxRecursionDepth = maxRecursionDepth > -1 ? maxRecursionDepth : Integer.MAX_VALUE;
53 53
		
54
		currentRequest = new RelaxedPlanRequest(agentID,null);
54
		currentRequest = new RelaxedPlanRequest(agentID,problem,null);
55 55

  
56 56
		requestProtocol = new DistributedHeuristicRequestProtocol(
57 57
                world.getCommunicator(),
......
138 138
		}
139 139
		
140 140
		
141
		currentRequest = new RelaxedPlanRequest(agentID,callback);
141
		currentRequest = new RelaxedPlanRequest(agentID,problem,callback);
142 142
		requestedActions.clear();
143 143
		
144 144
//		Trace.it("	",comm.getAddress(),"already requested actions(clear):",currentRequest.hashCode(),requestedActions.size());
src/main/java/cz/agents/dimaptools/heuristic/relaxed/PPLazilyDistributedSAFFRequestHeuristic.java
51 51
		agentID = world.getAgentID();
52 52
		this.maxRecursionDepth = maxRecursionDepth > -1 ? maxRecursionDepth : Integer.MAX_VALUE;
53 53
		
54
		currentRequest = new RelaxedPlanRequest(agentID,null);
54
		currentRequest = new RelaxedPlanRequest(agentID,problem,null);
55 55

  
56 56
		requestProtocol = new DistributedHeuristicRequestProtocol(
57 57
                world.getCommunicator(),
......
138 138
		}
139 139
		
140 140
		
141
		currentRequest = new RelaxedPlanRequest(agentID,callback);
141
		currentRequest = new RelaxedPlanRequest(agentID,problem,callback);
142 142
		requestedActions.clear();
143 143
		
144 144
//		Trace.it("	",comm.getAddress(),"already requested actions(clear):",currentRequest.hashCode(),requestedActions.size());
src/main/java/cz/agents/dimaptools/heuristic/relaxed/RelaxedPlanRequest.java
7 7
import cz.agents.dimaptools.experiment.Trace;
8 8
import cz.agents.dimaptools.heuristic.HeuristicResult;
9 9
import cz.agents.dimaptools.heuristic.HeuristicInterface.HeuristicComputedCallback;
10
import cz.agents.dimaptools.model.Problem;
10 11

  
11 12
public class RelaxedPlanRequest {
12 13

  
......
18 19
    private final int hash;
19 20

  
20 21
    private final HeuristicComputedCallback callback;
22
    Problem problem;
21 23

  
22 24
    private int expectedReplies;
23 25
    private RelaxedPlan rp = null;
24 26

  
25
    public RelaxedPlanRequest(int agentID, HeuristicComputedCallback callback) {
27
    public RelaxedPlanRequest(int agentID,Problem problem, HeuristicComputedCallback callback) {
26 28
        hash = (hashCodes++)*MAX_EXPECTED_AGENTS + agentID;
27 29
        this.callback = callback;
30
        this.problem = problem;
28 31
        this.expectedReplies = 0;
29 32
        rp = new RelaxedPlan();
30 33
    }
......
82 85
            
83 86
            Trace.it("heuristic:",hash,rp.getCost());
84 87
            
88
            System.out.println("RELAXED PLAN" + rp.humanize(problem) + "("+rp.getCost()+")");
89
    		
90
            
85 91
            callback.heuristicComputed(new HeuristicResult(rp.getCost()));
86 92
        }
87 93

  
......
105 111
            
106 112
            Trace.it("heuristic:",hash,rp.getCost());
107 113
            
114
            System.out.println(problem.agent + ": " + rp.humanize(problem) + "("+rp.getCost()+")");
115
    		
116
            
108 117
            callback.heuristicComputed(new HeuristicResult(rp.getCost()+privateCost));
109 118
        }
110 119

  
src/main/java/cz/agents/dimaptools/heuristic/relaxed/evaluator/FFEvaluator.java
74 74
			mark(p);
75 75
		}
76 76
		
77
//		System.out.println(problem.agent + "(FFeval): " + rp.humanize(problem) + "("+rp.getCost()+")");
78
		
79
		
80
		
77 81
		return rp.getCost();
78 82

  
79 83
	}

Also available in: Unified diff