@Override public ImmutableSet<ModelBuilder<?, ?>> getModelBuilders() { return ImmutableSet.<ModelBuilder<?, ?>>builder() .add( TimeModel.builder() .withTickLength(1L) .withTimeUnit(NonSI.MINUTE)) .add( RoadModelBuilders.plane() .withMinPoint(getMin()) .withMaxPoint(getMax()) .withDistanceUnit(SI.KILOMETER) .withMaxSpeed(MAX_SPEED) .withSpeedUnit( SI.KILOMETRE.divide(NonSI.MINUTE).asType(Velocity.class))) .add( DefaultPDPModel.builder() .withTimeWindowPolicy(TimeWindowPolicies.TARDY_ALLOWED)) .add( StatsTracker.builder()) .build(); }
.add( DefaultPDPModel.builder() .withTimeWindowPolicy(TimeWindowPolicies.TARDY_ALLOWED)) .add( StatsTracker.builder())
/** * Setup an environment with three vehicles and three parcels. */ @Before public void setUp() { final DependencyProvider dp = mock(DependencyProvider.class); rm = PDPRoadModel.builder( RoadModelBuilders.plane() .withMaxSpeed(300d)) .withAllowVehicleDiversion(false) .build(dp); when(dp.get(RoadModel.class)).thenReturn(rm); pm = DefaultPDPModel.builder() .withTimeWindowPolicy(TimeWindowPolicies.TARDY_ALLOWED) .build(dp); mp = new TestModelProvider(new ArrayList<>( Arrays.<Model<?>>asList(rm, pm))); rm.registerModelProvider(mp); v1 = new TestVehicle(new Point(0, 1)); v2 = new TestVehicle(new Point(0, 2)); v3 = new TestVehicle(new Point(0, 3)); p1 = createParcel(new Point(3, 0), new Point(0, 3)); p2 = createParcel(new Point(6, 9), new Point(2, 9)); p3 = createParcel(new Point(2, 8), new Point(8, 2)); ss = rm.getSnapshot(); }
.withTimeWindowPolicy(TimeWindowPolicies.TARDY_ALLOWED))
.addModel( DefaultPDPModel.builder() .withTimeWindowPolicy(TimeWindowPolicies.LIBERAL)) .addModel( PDPRoadModel.builder(RoadModelBuilders.plane())
.withTimeWindowPolicy(TimeWindowPolicies.TARDY_ALLOWED))
.withTimeWindowPolicy(TimeWindowPolicies.TARDY_ALLOWED) .build(dep);
.withTimeWindowPolicy(TimeWindowPolicies.TARDY_ALLOWED) .build(dp);
.addModel( DefaultPDPModel.builder() .withTimeWindowPolicy(TimeWindowPolicies.TARDY_ALLOWED)) .build();
.withSpeedUnit(NonSI.MILES_PER_HOUR)) .addModel(DefaultPDPModel.builder() .withTimeWindowPolicy(TimeWindowPolicies.STRICT)) .setStopCondition( StopConditions.and(StopConditions.alwaysTrue(),
.addModel( DefaultPDPModel.builder() .withTimeWindowPolicy(TimeWindowPolicies.LIBERAL)) .addModel( View.builder()
.addModel( DefaultPDPModel.builder() .withTimeWindowPolicy(TimeWindowPolicies.LIBERAL)) .setStopCondition(StatsStopConditions.timeOutEvent()) .build().generate(rng, "hoi");
@Before public void setUp() { sim = Simulator.builder() .addModel( PDPRoadModel.builder( RoadModelBuilders.plane() .withMaxSpeed(300d)) .withAllowVehicleDiversion(false)) .addModel( DefaultPDPModel.builder() .withTimeWindowPolicy(TimeWindowPolicies.TARDY_ALLOWED)) .build(); rm = sim.getModelProvider().getModel(PDPRoadModel.class); pm = sim.getModelProvider().getModel(PDPModel.class); depot = new Depot(new Point(5, 5)); sim.register(depot); p1 = createParcel(new Point(3, 0), new Point(0, 3)); p2 = createParcel(new Point(6, 9), new Point(2, 9)); p3 = createParcel(new Point(2, 8), new Point(8, 2)); TestUtil.testPrivateConstructor(Central.class); TestUtil.testPrivateConstructor(Solvers.class); TestUtil.testEnum(VehicleCreator.class); }