Revision 348:a45bc520cbc1

View differences:

src/main/java/cz/agents/dimaptools/experiment/DataAccumulator.java
32 32
	public long startTimeMs;
33 33
	public long startAfterPreprocessTimeMs;
34 34
	public long finishTimeMs;
35
	public Map<String,Long> startCPUTimeMs = new HashMap<>();
36
	public Map<String,Long> CPUTimeMs = new HashMap<>();
35 37
	public int agents;
36 38
	public Map<String,Integer> initHeuristic = new HashMap<>();
37 39
	public Map<String,Integer> initHeuristicDist = new HashMap<>();
......
89 91
		sb.append("recursionLevel").append(sep);
90 92
//		sb.append("run").append(sep);
91 93
		sb.append("totalTime").append(sep);
94
		sb.append("CPUTimeAgents").append(sep);
95
		sb.append("CPUTime").append(sep);
92 96
		sb.append("initHeuristic").append(sep);
93 97
		sb.append("initHeuristicDist").append(sep);
94 98
		sb.append("searchTime").append(sep);
......
129 133
		sb.append(recursionLevel).append(sep);
130 134
//		sb.append(run).append(sep);
131 135
		sb.append(finishTimeMs-startTimeMs).append(sep);
136
		long tCPU = 0;
137
		for(long t : CPUTimeMs.values()) tCPU+= t;
138
		sb.append(CPUTimeMs.toString().replace(",", "")).append(sep);
139
		sb.append(tCPU).append(sep);
132 140
		sb.append(initHeuristic.toString().replace(",", "")).append(sep);
133 141
		sb.append(initHeuristicDist.toString().replace(",", "")).append(sep);
134 142
		sb.append(searchStopwatch.getTotalTime()).append(sep);
src/main/java/cz/agents/dimaptools/search/GlobalLocalDistributedBestFirstSearch.java
3 3
import gnu.trove.TIntHashSet;
4 4
import gnu.trove.TIntObjectHashMap;
5 5

  
6
import java.lang.management.ManagementFactory;
6 7
import java.util.ArrayList;
7 8
import java.util.Arrays;
8 9
import java.util.Comparator;
......
143 144

  
144 145
                LOGGER.warn(comm.getAddress() + " receive PLANNING_FINISHED!" );
145 146

  
147
                long tCPU = ManagementFactory.getThreadMXBean().getCurrentThreadCpuTime();
148
                long startCPU = DataAccumulator.getAccumulator().startCPUTimeMs.get(problem.agent);
149
                DataAccumulator.getAccumulator().CPUTimeMs.put(problem.agent, (tCPU-startCPU)/1000000);
150
                LOGGER.info("planning finished message - CPU-time ("+problem.agent+"): " + (tCPU-startCPU)/1000000);
146 151

  
147 152
                run = false;
148 153

  

Also available in: Unified diff