@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof SolverTimeMeasurement) { SolverTimeMeasurement that = (SolverTimeMeasurement) o; return (this.input.equals(that.input())) && (this.durationNs == that.durationNs()); } return false; }
@Override public ImmutableList<ImmutableList<Parcel>> solve(GlobalStateObject state) throws InterruptedException { final long start = System.nanoTime(); final ImmutableList<ImmutableList<Parcel>> result = delegate.solve(state); final long duration = System.nanoTime() - start; measurements.add(SolverTimeMeasurement.create(state, duration)); return result; } }
@Nullable public ImmutableList<ImmutableList<Parcel>> doSolve( final GlobalStateObject state) throws InterruptedException { final long start = System.nanoTime(); // start solving final PDPSolution problem = convert(state); solver.solve(problem); // end solving if (isMeasuringEnabled) { final long duration = System.nanoTime() - start; measurements.add(SolverTimeMeasurement.create(state, duration)); } final PDPSolution solution = (PDPSolution) solver.getBestSolution(); final HardSoftLongScore score = solution.getScore(); if (score.getHardScore() != 0) { return null; } return toSchedule(solution); }