Attempts to pickup the specified {@link Parcel} into the specified{@link Vehicle}. Preconditions:
- {@link Vehicle} must be on {@link rinde.sim.core.model.road.RoadModel}.
- {@link Vehicle} must be registered in {@link DefaultPDPModel}.
- {@link Vehicle} must be in {@link VehicleState#IDLE} state.
- {@link Parcel} must be on {@link rinde.sim.core.model.road.RoadModel}.
- {@link Parcel} must be registered in {@link DefaultPDPModel}.
- {@link Parcel} must be in {@link ParcelState#ANNOUNCED} or{@link ParcelState#AVAILABLE} state.
- {@link Vehicle} and {@link Parcel} must be at same position in{@link rinde.sim.core.model.road.RoadModel}.
- {@link Parcel} must fit in {@link Vehicle}.
If any of the preconditions is not met this method throws an {@link IllegalArgumentException}.
When all preconditions are met, the pickup action is started indicated by the dispatching of an {@link rinde.sim.event.Event} with type{@link PDPModelEventType#START_PICKUP}. In case the specified {@link TimeLapse} is not big enough to complete the pickup immediately theaction will be continued next tick. Note that this method does not, and in fact, should not be called again in the next tick to continue the pickup. The continued pickup is handled automatically, the effect is that the {@link Vehicle} will receive less time (or no time at all) in its nexttick. When the pickup action is completed an {@link rinde.sim.event.Event}with type {@link PDPModelEventType#END_PICKUP} is dispatched. When done,the {@link Parcel} will be contained by the {@link Vehicle}.
@param vehicle The {@link Vehicle} involved in pickup.
@param parcel The {@link Parcel} to pick up.
@param time The {@link TimeLapse} that is available for the action.