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 void
allocationFailed(java.util.Set<TCSResource<?>> resources)
Called if it was impossible to allocate a requested set of resources for this client.boolean
allocationSuccessful(java.util.Set<TCSResource<?>> resources)
Called when resources have been reserved for this client.java.lang.String
getId()
Returns an ID string for this client.default TCSObjectReference<Vehicle>
getRelatedVehicle()
Returns a reference to theVehicle
that 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 theVehicle
that this client is related to. -
allocationSuccessful
Called when resources have been reserved for this client.- Parameters:
resources
- The resources reserved.- Returns:
true
if, and only if, this client accepts the resources allocated. A return value offalse
indicates 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.
-