AdapterSupplier.create(StochasticSuppliers.constant(new Solver() { @Override public ImmutableList<ImmutableList<Parcel>> solve(
/** * Constructs a new {@link MASConfiguration} that uses a {@link Solver} * created by the specified <code>solverSupplier</code> to control all * vehicles. The {@link Solver} is converted to a {@link RealtimeSolver} using * {@link RtStAdapters#toRealtime(StochasticSupplier)}. * @param solverSupplier A {@link StochasticSupplier} that should create * instances of {@link Solver}. * @param nameSuffix The suffix to the name of the {@link MASConfiguration}. * The name is formatted as * <code>RtCentral-[solverSupplier][nameSuffix]</code>. * @return A new {@link MASConfiguration} instance. */ public static MASConfiguration solverConfigurationAdapt( StochasticSupplier<? extends Solver> solverSupplier, String nameSuffix) { return solverConfiguration(AdapterSupplier.create(solverSupplier), nameSuffix); }
/** * Constructs a {@link Builder} for creating a real-time central model. The * real-time central model is a model that takes control of all vehicles in a * simulation and uses a {@link RealtimeSolver} to compute routes for all * vehicles. The supplied {@link Solver} is adapted using * {@link RtStAdapters#toRealtime(StochasticSupplier)}. * @param solverSupplier A {@link StochasticSupplier} that creates the * {@link Solver} that will be used for controlling all vehicles. * @return A new {@link Builder} instance. */ public static Builder builderAdapt( StochasticSupplier<? extends Solver> solverSupplier) { return builder(AdapterSupplier.create(solverSupplier)); }
public static MASConfiguration solverConfigurationAdapt( StochasticSupplier<? extends Solver> solverSupplier, String nameSuffix, boolean threadGrouping) { return configBuilder(solverSupplier, nameSuffix) .addModel(builder(AdapterSupplier.create(solverSupplier)) .withThreadGrouping(threadGrouping)) .build(); }