@Override public ImmutableList<ImmutableList<Parcel>> call() throws Exception { return solver.solve(snapshot); } }
@Override public ImmutableList<ImmutableList<Parcel>> solve(GlobalStateObject state) throws InterruptedException { Thread.sleep(sleepTime); return delegate.solve(state); }
/** * Calls the {@link Solver} to solve the problem as defined by the current * simulation state. * @param state The {@link GlobalStateObject} that specifies the current * simulation state. * @return A list of routes, one for each vehicle. */ public ImmutableList<ImmutableList<Parcel>> solve(GlobalStateObject state) { try { return solver.get().solve(state); } catch (final InterruptedException e) { throw new IllegalStateException( "The solver is interrupted, can't continue.", e); } }
@Override public ImmutableList<ImmutableList<Parcel>> solve(GlobalStateObject state) throws InterruptedException { if (print) { System.out.println(state); } inputs.add(state); final ImmutableList<ImmutableList<Parcel>> result = delegate .solve(state); outputs.add(result); if (print) { System.out.println(result); } return result; }
@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; } }
@Override public final ImmutableList<ImmutableList<Parcel>> solve( GlobalStateObject state) throws InterruptedException { final ImmutableList<ImmutableList<Parcel>> schedule = delegate.solve(state); return doSolve(schedule, state); }
@Override public ImmutableList<ImmutableList<Parcel>> solve(GlobalStateObject state) throws InterruptedException { return validateOutputs(delegateSolver.solve(validateInputs(state)), state); } }
mock(RoadModelSnapshot.class)); final Solver solver = SolverValidator.wrap(new FakeSolver(routes)); solver.solve(state);