PDPModel extends AbstractModel<PDPObject> implements TickListener { public abstract void drop(Vehicle vehicle, Parcel parcel, TimeLapse time);  @Override final boolean register(PDPObject object); abstract ImmutableSet<Parcel> getContents(Container container); abstract double getContentsSize(Container container); abstract double getContainerCapacity(Container container); abstract void pickup(Vehicle vehicle, Parcel parcel, TimeLapse time); abstract void drop(Vehicle vehicle, Parcel parcel, TimeLapse time); abstract void deliver(Vehicle vehicle, Parcel parcel, TimeLapse time); abstract void addParcelIn(Container container, Parcel parcel); abstract Collection<Parcel> getParcels(ParcelState state); abstract Collection<Parcel> getParcels(ParcelState... states); abstract Set<Vehicle> getVehicles(); abstract ParcelState getParcelState(Parcel parcel); abstract VehicleState getVehicleState(Vehicle vehicle); abstract PDPModel.VehicleParcelActionInfo getVehicleActionInfo(
      Vehicle vehicle); abstract EventAPI getEventAPI(); abstract boolean containerContains(Container container, Parcel parcel); abstract TimeWindowPolicy getTimeWindowPolicy(); abstract void service(Vehicle vehicle, Parcel parcel, TimeLapse time);  }
@Test public void testDrop() { final Vehicle truck = new TestVehicle(VehicleDTO.builder() .startPosition(new Point(1, 1)) .capacity(10) .speed(1.0) .build()); model.register(truck); rm.register(truck); final Parcel pack = Parcel.builder(new Point(1, 2), new Point(2, 2)) .pickupDuration(100L) .deliveryDuration(100L) .neededCapacity(2d) .build(); model.register(pack); rm.register(pack); rm.followPath(truck, newLinkedList(asList(new Point(1, 2))), TimeLapseFactory.create(0, 3600000)); model.pickup(truck, pack, TimeLapseFactory.create(0, 40)); model.continuePreviousActions(truck, TimeLapseFactory.create(0, 40)); final TimeLapse tl = TimeLapseFactory.create(0, 40); model.continuePreviousActions(truck, tl); assertFalse(model.getContents(truck).isEmpty()); assertEquals(ParcelState.IN_CARGO, model.getParcelState(pack)); assertEquals(VehicleState.IDLE, model.getVehicleState(truck)); rm.followPath(truck, newLinkedList(asList(new Point(2, 2))), TimeLapseFactory.create(0, 3600000)); model.drop(truck, pack, TimeLapseFactory.create(0, 50)); assertFalse(model.getContents(truck).isEmpty()); assertEquals(VehicleState.DELIVERING, model.getVehicleState(truck)); assertEquals(ParcelState.DELIVERING, model.getParcelState(pack)); model.continuePreviousActions(truck, TimeLapseFactory.create(0, 50)); assertEquals(0, model.getContentsSize(truck), EPSILON); assertTrue(model.getContents(truck).isEmpty()); assertEquals(ParcelState.AVAILABLE, model.getParcelState(pack)); assertEquals(VehicleState.IDLE, model.getVehicleState(truck)); }