mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
refine and improve benchmarking
This commit is contained in:
parent
70bb212848
commit
3d0594448e
6 changed files with 537 additions and 72 deletions
17
jsprit-core/src/main/java/util/BenchmarkInstance.java
Normal file
17
jsprit-core/src/main/java/util/BenchmarkInstance.java
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package util;
|
||||
|
||||
import basics.VehicleRoutingProblem;
|
||||
|
||||
public class BenchmarkInstance {
|
||||
public final String name;
|
||||
public final VehicleRoutingProblem vrp;
|
||||
public final Double bestKnownResult;
|
||||
public Double bestKnownVehicles;
|
||||
public BenchmarkInstance(String name, VehicleRoutingProblem vrp, Double bestKnownResult, Double bestKnowVehicles) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.vrp = vrp;
|
||||
this.bestKnownResult = bestKnownResult;
|
||||
this.bestKnownVehicles = bestKnowVehicles;
|
||||
}
|
||||
}
|
||||
56
jsprit-core/src/main/java/util/BenchmarkResult.java
Normal file
56
jsprit-core/src/main/java/util/BenchmarkResult.java
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
package util;
|
||||
|
||||
import org.apache.commons.math.stat.descriptive.DescriptiveStatistics;
|
||||
|
||||
|
||||
|
||||
public class BenchmarkResult {
|
||||
private double[] results;
|
||||
private double[] vehicles;
|
||||
private double[] times;
|
||||
|
||||
private DescriptiveStatistics statsResults;
|
||||
private DescriptiveStatistics statsVehicles;
|
||||
private DescriptiveStatistics statsTimes;
|
||||
|
||||
public final BenchmarkInstance instance;
|
||||
|
||||
public final int runs;
|
||||
|
||||
public BenchmarkResult(BenchmarkInstance instance, int runs, double[] results, double[] compTimes, double[] vehicles) {
|
||||
super();
|
||||
this.results = results;
|
||||
this.runs = runs;
|
||||
this.times = compTimes;
|
||||
this.instance = instance;
|
||||
this.vehicles = vehicles;
|
||||
this.statsResults = new DescriptiveStatistics(results);
|
||||
this.statsTimes = new DescriptiveStatistics(times);
|
||||
this.statsVehicles = new DescriptiveStatistics(vehicles);
|
||||
}
|
||||
|
||||
public double[] getResults(){
|
||||
return results;
|
||||
}
|
||||
|
||||
public double[] getVehicles(){
|
||||
return vehicles;
|
||||
}
|
||||
|
||||
public double[] getCompTimes(){
|
||||
return times;
|
||||
}
|
||||
|
||||
public DescriptiveStatistics getResultStats(){
|
||||
return statsResults;
|
||||
}
|
||||
|
||||
public DescriptiveStatistics getVehicleStats(){
|
||||
return statsVehicles;
|
||||
}
|
||||
|
||||
public DescriptiveStatistics getTimesStats(){
|
||||
return statsTimes;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue