.parse(new File("files/test/gendreau06/req_rapide_1_240_24"));
final DebugSolverCreator dsc = new DebugSolverCreator(123,
scenario.getTimeUnit());
final Gendreau06ObjectiveFunction obj = new Gendreau06ObjectiveFunction();
Experiment.build(obj).addConfiguration(Central.solverConfiguration(dsc))
.addScenario(scenario).repeat(10).perform();
final MVASDebugger arraysSolver = dsc.arraysSolver;
final SolverDebugger solver = dsc.solver;
final int n = solver.getInputs().size();
assertEquals(n, arraysSolver.getInputs().size());
assertEquals(n, solver.getOutputs().size());
assertEquals(n, arraysSolver.getOutputs().size());
for (int i = 0; i < n; i++) {
final GlobalStateObject solverInput = solver.getInputs().get(i);
final ImmutableList<ImmutableList<ParcelDTO>> solverOutput = solver
.getOutputs().get(i);
final SolutionObject[] sols = arraysSolver.getOutputs().get(i);
final MVArraysObject arrInput = arraysSolver.getInputs().get(i);
assertEquals(solverOutput.size(), sols.length);
final double arrObjVal = ArraysSolvers.computeTotalObjectiveValue(sols)
/ MS_TO_MIN;
final double arrOverTime = overTime(sols, arrInput) / MS_TO_MIN;
final double arrTardiness = computeTardiness(sols, arrInput) / MS_TO_MIN;
final double arrTravelTime = computeTravelTime(sols, arrInput)
/ MS_TO_MIN;
final ExtendedStats stats = (ExtendedStats) Solvers.computeStats(
solverInput, solverOutput);
// check arrival times
for (int j = 0; j < sols.length; j++) {
final SolutionObject sol = sols[j];
final long[] arraysArrivalTimes = incrArr(sol.arrivalTimes,
solverInput.time);
final long[] arrivalTimes = Longs.toArray(stats.arrivalTimes.get(j));
assertArrayEquals(arraysArrivalTimes, arrivalTimes);
}
final double tardiness = obj.tardiness(stats) + obj.overTime(stats);
final double travelTime = obj.travelTime(stats);
assertEquals(arrOverTime, obj.overTime(stats), 0.001);
assertEquals(arrTravelTime, travelTime, 0.01);
assertEquals(arrTardiness, tardiness, 0.001);
assertEquals(arrObjVal, obj.computeCost(stats), 0.01);
assertEquals(arrObjVal,
decomposedCost(solverInput, solverOutput, obj), 0.01);
}
}