Package org.opentcs.components.kernel
Interface Scheduler.Module
- All Superinterfaces:
Lifecycle
- Enclosing interface:
Scheduler
A scheduler module.
-
Method Summary
Modifier and TypeMethodDescriptionvoidallocationReleased(Scheduler.Client client, Set<TCSResource<?>> resources) Informs this module about resources being fully released by a client.booleanhasPreparedAllocation(Scheduler.Client client, Set<TCSResource<?>> resources) Checks if this module is done preparing the given resources for a client.booleanmayAllocate(Scheduler.Client client, Set<TCSResource<?>> resources) Checks if the resulting system state is safe if the given set of resources would be allocated by the given resource user.voidprepareAllocation(Scheduler.Client client, Set<TCSResource<?>> resources) Lets this module prepare the given resources so they can be allocated to a client.voidsetAllocationState(Scheduler.Client client, Set<TCSResource<?>> alloc, List<Set<TCSResource<?>>> remainingClaim) Informs this module about a client's current allocation state.Methods inherited from interface org.opentcs.components.Lifecycle
initialize, isInitialized, terminate
-
Method Details
-
setAllocationState
void setAllocationState(@Nonnull Scheduler.Client client, @Nonnull Set<TCSResource<?>> alloc, @Nonnull List<Set<TCSResource<?>>> remainingClaim) Informs this module about a client's current allocation state.- Parameters:
client- The client.alloc- The client's currently allocated resources.remainingClaim- The client's remaining claim.
-
mayAllocate
Checks if the resulting system state is safe if the given set of resources would be allocated by the given resource user.- Parameters:
client- TheResourceUserrequesting resources set.resources- The requested resources.- Returns:
trueif this module thinks the given resources may be allocated for the given client.
-
prepareAllocation
Lets this module prepare the given resources so they can be allocated to a client.- Parameters:
client- The client the resources are being prepared for.resources- The resources to be prepared.
-
hasPreparedAllocation
boolean hasPreparedAllocation(@Nonnull Scheduler.Client client, @Nonnull Set<TCSResource<?>> resources) Checks if this module is done preparing the given resources for a client.- Parameters:
client- The client the resources are being prepared for.resources- The resources to be checked.- Returns:
trueif the resoruces are prepared for a client.
-
allocationReleased
Informs this module about resources being fully released by a client.- Parameters:
client- The client releasing the resources.resources- The resources being released.
-