@Override public void handleTimedEvent(AddDepotEvent event, SimulatorAPI simulator) { counter++; simulator.register(new Depot(event.getPosition(), "Depot " + counter)); }
/** * Instantiate the depot at the provided position. * @param position The position where the depot will be located. * @param nm The name of the depot, this overrides the toString value. */ public Depot(Point position, @Nullable String nm) { setStartPosition(position); if (nm == null) { name = ""; } else { name = nm; } }
@Test(expected = IllegalStateException.class) public void objectCheckDoubleRegistrationFail1() { final Depot d = new TestDepot(10); d.initPDPObject(model); d.initPDPObject(model); }
@Test(expected = IllegalStateException.class) public void objectSetStartPositionFail() { final Depot d = new TestDepot(10); model.register(d); assertEquals(model, d.getPDPModel()); rm.register(d); assertEquals(rm, d.getRoadModel()); d.setStartPosition(new Point(0, 0)); }
@Test(expected = IllegalStateException.class) public void objectCheckDoubleRegistrationFail2() { final Depot d = new TestDepot(10); d.initRoadUser(rm); d.initRoadUser(rm); }
@Test(expected = IllegalStateException.class) public void containerSetCapacityFail() { final Depot d = new TestDepot(10); model.register(d); rm.register(d); d.setCapacity(20); }
@Override public void handleTimedEvent(AddDepotEvent event, SimulatorAPI simulator) { counter++; simulator.register(new Depot(event.getPosition(), "Depot " + counter)); }
@Override public void handleTimedEvent(AddDepotEvent event, SimulatorAPI sim) { sim.register(new Depot(event.getPosition())); }
@Override public void handleTimedEvent(AddDepotEvent event, SimulatorAPI sim) { sim.register(new Depot(event.getPosition())); }
/** * Tests the check for the number of depots, only 1 is allowed. */ @Test(expected = IllegalArgumentException.class) public void multiDepotFail() { init(false); PDPTWTestUtil.register(rm, pm, depot, new Depot(new Point(3, 5)), d); }
.build(); sim.register(new Depot(new Point(1, 1)));
depot = new Depot(depotLocation); rm.addObjectAt(depot, depotLocation);
}); sim.register(new Depot(new Point(5, 5))); final Agent agent = new Agent();
.build(); depot = new Depot(new Point(3, 5)); if (register) { PDPTWTestUtil.register(rm, pm, depot, d, d2, p1, p2, p3);
}); sim.register(new Depot(new Point(1, 1))); sim.start();
@Before public void setUp() { sim = Simulator.builder() .addModel(TimeModel.builder() .withRealTime() .withTickLength(100L) .withTimeUnit(SI.MILLI(SI.SECOND))) .addModel(PDPRoadModel.builder(RoadModelBuilders.plane())) .addModel(DefaultPDPModel.builder()) .addModel(RtSolverModel.builder() .withSingleMode() .withThreadGrouping(useThreadGrouping)) .build(); model = sim.getModelProvider().getModel(RtSolverModel.class); rtClock = sim.getModelProvider().getModel(TimeModel.class) .get(RealtimeClockController.class); sim.register(new Depot(new Point(5, 5))); sim.register(new RouteFollowingVehicle(VehicleDTO.builder().build(), true)); }
@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); }
sim.register(new Depot(new Point(5, 5)));
.build(), false); final Depot depot = new Depot(new Point(5, 5));