Allocation

class Allocation(val entity: ProcessModel.Entity, val resource: Resource, theAmount: Int = 1, val queue: RequestQ, allocationName: String? = null)

An allocation represents a distinct usage of a resource by an entity with an amount allocated. Entities can have multiple allocations for the same resource. An allocation is in response to separate requests for units. Multiple requests by the same entity for units of the resource result in multiple allocations (when filled). An allocation is not created until the requested amount is available.

Parameters

entity

the entity associated with the allocation

resource

the resource associated with the allocation

theAmount

the amount allocated of the resource to the entity

queue

the queue that the entity had to wait in when requesting the allocation

allocationName

the name of the allocation processed by the resource. The default actions are supplied by the entity associated with the allocation.

Constructors

Link copied to clipboard
constructor(entity: ProcessModel.Entity, resource: Resource, theAmount: Int = 1, queue: RequestQ, allocationName: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard
var amount: Int

The amount of the allocation representing the units allocated of the resource

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val id: Int
Link copied to clipboard

True if the allocation is currently allocated to a resource

Link copied to clipboard

True if no units are allocated

Link copied to clipboard
var name: String?

An optional name for the allocation

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The time that the allocation was allocated to its resource

Link copied to clipboard
Link copied to clipboard

The total elapsed time since allocation if not yet deallocated. If deallocated, the total time between de-allocation and allocation

Functions

Link copied to clipboard
open override fun toString(): String