Interface DispatcherService
public interface DispatcherService
Provides methods concerning the
Dispatcher
.-
Method Summary
Modifier and Type Method Description default void
assignNow(TCSObjectReference<TransportOrder> ref)
Assign the referenced transport order (to its intended vehicle) now.void
dispatch()
Explicitly trigger the dispatching process.default void
reroute(TCSObjectReference<Vehicle> ref, ReroutingType reroutingType)
Explicitly trigger a rerouting for the given vehicles.default void
rerouteAll(ReroutingType reroutingType)
Explicitly trigger a rerouting for all vehicles.void
withdrawByTransportOrder(TCSObjectReference<TransportOrder> ref, boolean immediateAbort)
Withdraw the referenced order.void
withdrawByVehicle(TCSObjectReference<Vehicle> ref, boolean immediateAbort)
Withdraw any order that a vehicle might be processing.
-
Method Details
-
dispatch
Explicitly trigger the dispatching process.If called within the kernel application, this method is supposed to be called only on the kernel executor thread.
- Throws:
KernelRuntimeException
- In case there is an exception executing this method.
-
withdrawByVehicle
void withdrawByVehicle(TCSObjectReference<Vehicle> ref, boolean immediateAbort) throws ObjectUnknownException, KernelRuntimeExceptionWithdraw any order that a vehicle might be processing.If called within the kernel application, this method is supposed to be called only on the kernel executor thread.
- Parameters:
ref
- A reference to the vehicle to be modified.immediateAbort
- Iffalse
, this method once will initiate the withdrawal, leaving the transport order assigned to the vehicle until it has finished the movements that it has already been ordered to execute. The transport order's state will change toTransportOrder.State.WITHDRAWN
. Iftrue
, the dispatcher will withdraw the order from the vehicle without further waiting.- Throws:
ObjectUnknownException
- If the referenced vehicle does not exist.KernelRuntimeException
- In case there is an exception executing this method.
-
withdrawByTransportOrder
void withdrawByTransportOrder(TCSObjectReference<TransportOrder> ref, boolean immediateAbort) throws ObjectUnknownException, KernelRuntimeExceptionWithdraw the referenced order.If called within the kernel application, this method is supposed to be called only on the kernel executor thread.
- Parameters:
ref
- A reference to the transport order to be withdrawn.immediateAbort
- Iffalse
, this method once will initiate the withdrawal, leaving the transport order assigned to the vehicle until it has finished the movements that it has already been ordered to execute. The transport order's state will change toTransportOrder.State.WITHDRAWN
. Iftrue
, the dispatcher will withdraw the order from the vehicle without further waiting.- Throws:
ObjectUnknownException
- If the referenced transport order does not exist.KernelRuntimeException
- In case there is an exception executing this method.
-
reroute
@ScheduledApiChange(when="6.0", details="Default implementation will be removed.") default void reroute(@Nonnull TCSObjectReference<Vehicle> ref, @Nonnull ReroutingType reroutingType) throws ObjectUnknownException, KernelRuntimeExceptionExplicitly trigger a rerouting for the given vehicles.If called within the kernel application, this method is supposed to be called only on the kernel executor thread.
- Parameters:
ref
- The vehicle to be rerouted.reroutingType
- The type of the requested rerouting.- Throws:
ObjectUnknownException
KernelRuntimeException
-
rerouteAll
@ScheduledApiChange(when="6.0", details="Default implementation will be removed.") default void rerouteAll(@Nonnull ReroutingType reroutingType)Explicitly trigger a rerouting for all vehicles.If called within the kernel application, this method is supposed to be called only on the kernel executor thread.
- Parameters:
reroutingType
- The type of rerouting.
-
assignNow
@ScheduledApiChange(when="6.0", details="Default implementation will be removed.") default void assignNow(TCSObjectReference<TransportOrder> ref) throws ObjectUnknownException, TransportOrderAssignmentException, KernelRuntimeExceptionAssign the referenced transport order (to its intended vehicle) now.If called within the kernel application, this method is supposed to be called only on the kernel executor thread.
- Parameters:
ref
- The transport order to be assigned.- Throws:
ObjectUnknownException
- If the referenced transport order does not exist.TransportOrderAssignmentException
- If the given transport order could not be assigned to its intended vehicle.KernelRuntimeException
- In case there is an exception executing this method.
-