allocate

fun allocate(entity: ProcessModel.Entity, requestLocation: LocationIfc, queue: RequestQ, resourceSelectionRule: MovableResourceSelectionRuleIfc, resourceAllocationRule: MovableResourceAllocationRuleIfc, allocationName: String? = null): Allocation(source)

It is an error to attempt to allocate a movable resource unit to an entity if there are insufficient units available at the time of allocation.

Return

an allocation representing that the unit has been allocated to the entity. The reference to this allocation is necessary in order to deallocate the allocated unit. The allocation belongs to the individual movable resource that was selected, but it records this pool as the pool the request was made against, so that releasing it processes the queue on the pool's behalf. Without that, the release would name the individual resource and match none of the pool's waiting requests, which name the pool.

Parameters

entity

the entity that is requesting the units

allocationName

an optional name for the allocation

queue

the queue associated with the allocation. That is, where the entities would have had to wait if the allocation was not immediately filled

resourceSelectionRule

The rule to use to select resources to allocate from

resourceAllocationRule

The rule to use to determine the resources to allocate from given the selected resources