Package org.opentcs.components.kernel
Interface Scheduler.Client
- All Known Subinterfaces:
VehicleController
- Enclosing interface:
- Scheduler
public static interface Scheduler.Client
Defines callback methods for clients of the resource scheduler.
-
Method Summary
Modifier and Type Method Description voidallocationFailed(java.util.Set<TCSResource<?>> resources)Called if it was impossible to allocate a requested set of resources for this client.booleanallocationSuccessful(java.util.Set<TCSResource<?>> resources)Called when resources have been reserved for this client.java.lang.StringgetId()Returns an ID string for this client.default TCSObjectReference<Vehicle>getRelatedVehicle()Returns a reference to theVehiclethat this client is related to.
-
Method Details
-
getId
@Nonnull java.lang.String getId()Returns an ID string for this client. The returned string should be unique among all clients in the system.- Returns:
- An unique ID string for this client.
-
getRelatedVehicle
@Nullable @ScheduledApiChange(when="6.0", details="Default implementation will be removed.") default TCSObjectReference<Vehicle> getRelatedVehicle()Returns a reference to theVehiclethat this client is related to. -
allocationSuccessful
Called when resources have been reserved for this client.- Parameters:
resources- The resources reserved.- Returns:
trueif, and only if, this client accepts the resources allocated. A return value offalseindicates this client does not need the given resources (any more), freeing them implicitly, but not restoring any previous claim.
-
allocationFailed
Called if it was impossible to allocate a requested set of resources for this client.- Parameters:
resources- The resources which could not be reserved.
-