allocate
fun allocate(entity: ProcessModel.Entity, amountNeeded: Int = 1, queue: RequestQ, allocationName: String? = null): Allocation
It is an error to attempt to allocate resource units to an entity if there are insufficient units available. Thus, the amount requested must be less than or equal to the number of units available at the time of this call.
Return
an allocation representing that the units have been allocated to the entity. The reference to this allocation is necessary in order to deallocate the allocated units.
Parameters
entity
the entity that is requesting the units
amount Needed
that amount to allocate, must be greater than or equal to 1
allocation Name
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