seize

abstract suspend fun seize(resource: Resource, amountNeeded: Int = 1, seizePriority: Int = SEIZE_PRIORITY, queue: RequestQ, suspensionName: String? = null): Allocation

Requests a number of units of the indicated resource.

Return

the Allocation representing the request for the Resource. After returning, the allocation indicates that the units of the resource have been allocated to the entity making the request. An allocation should not be returned until all requested units of the resource have been allocated.

Parameters

amountNeeded

the number of units of the resource needed for the request. The default is 1 unit.

resource

the resource from which the units are being requested.

seizePriority

the priority of the request. This is meant to inform any allocation mechanism for requests that may be competing for the resource.

queue

the queue that will hold the entity if the amount needed cannot immediately be supplied by the resource. If the queue is priority based (i.e. uses a ranked queue discipline) the user should set the entity's priority attribute for use in ranking the queue prior to the calling seize.

suspensionName

the name of the suspension point. can be used to identify which seize the entity is experiencing if there are more than one seize suspension points within the process. The user is responsible for uniqueness.


open suspend fun seize(resource: ResourceWithQ, amountNeeded: Int = 1, seizePriority: Int = SEIZE_PRIORITY, suspensionName: String? = null): Allocation

Requests a number of units of the indicated resource. The queue that will hold the entity is internal to the resource. If the queue is priority based (i.e. uses a ranked queue discipline) the user should set the entity's priority attribute for use in ranking the queue prior to the calling seize.

Return

the Allocation representing the request for the Resource. After returning, the allocation indicates that the units of the resource have been allocated to the entity making the request. An allocation should not be returned until all requested units of the resource have been allocated.

Parameters

amountNeeded

the number of units of the resource needed for the request. The default is 1 unit.

resource

the resource from which the units are being requested.

seizePriority

the priority of the request. This is meant to inform any allocation mechanism for requests that may be competing for the resource.

suspensionName

the name of the suspension point. can be used to identify which seize the entity is experiencing if there are more than one seize suspension points within the process. The user is responsible for uniqueness.


open suspend fun seize(resource: MovableResource, seizePriority: Int = SEIZE_PRIORITY, queue: RequestQ, suspensionName: String? = null): Allocation

Requests a number of units of the indicated movable resource.

Return

the Allocation representing the request for the Resource. After returning, the allocation indicates that the units of the resource have been allocated to the entity making the request. An allocation should not be returned until all requested units of the resource have been allocated.

Parameters

resource

the resource from which the units are being requested.

seizePriority

the priority of the request. This is meant to inform any allocation mechanism for requests that may be competing for the resource.

queue

the queue that will hold the entity if the amount needed cannot immediately be supplied by the resource. If the queue is priority based (i.e. uses a ranked queue discipline) the user should set the entity's priority attribute for use in ranking the queue prior to the calling seize.

suspensionName

the name of the suspension point. can be used to identify which seize the entity is experiencing if there are more than one seize suspension points within the process. The user is responsible for uniqueness.


open suspend fun seize(resource: MovableResourceWithQ, seizePriority: Int = SEIZE_PRIORITY, suspensionName: String? = null): Allocation

Requests a number of units of the indicated movable resource.

Return

the Allocation representing the request for the Resource. After returning, the allocation indicates that the units of the resource have been allocated to the entity making the request. An allocation should not be returned until all requested units of the resource have been allocated.

Parameters

resource

the resource from which the units are being requested.

seizePriority

the priority of the request. This is meant to inform any allocation mechanism for requests that may be competing for the resource.

suspensionName

the name of the suspension point. can be used to identify which seize the entity is experiencing if there are more than one seize suspension points within the process. The user is responsible for uniqueness.


abstract suspend fun seize(resourcePool: ResourcePool, amountNeeded: Int = 1, seizePriority: Int = SEIZE_PRIORITY, queue: RequestQ, resourceSelectionRule: ResourceSelectionRuleIfc = resourcePool.defaultResourceSelectionRule, resourceAllocationRule: ResourceAllocationRuleIfc = resourcePool.defaultResourceAllocationRule, suspensionName: String? = null): ResourcePoolAllocation

Requests a number of units from the indicated pool of resources

Return

the Allocation representing the request for the Resource. After returning, the allocation indicates that the units of the resource have been allocated to the entity making the request. An allocation should not be returned until all requested units of the resource have been allocated.

Parameters

amountNeeded

the number of units of the resource needed for the request. The default is 1 unit.

resourcePool

the resource pool from which the units are being requested.

seizePriority

the priority of the request. This is meant to inform any allocation mechanism for requests that may be competing for the resource.

queue

the queue that will hold the entity if the amount needed cannot immediately be supplied by the resource. If the queue is priority based (i.e. uses a ranked queue discipline) the user should set the entity's priority attribute for use in ranking the queue prior to the calling seize.

resourceSelectionRule

The rule to use to select resources to allocate from. By default, the pool's default rule is used.

resourceAllocationRule

The rule to use to determine the resources to allocate from given the selected resources. By default, the pool's default rule is used.

suspensionName

the name of the suspension point. can be used to identify which seize the entity is experiencing if there are more than one seize suspension points within the process. The user is responsible for uniqueness.


open suspend fun seize(resourcePool: ResourcePoolWithQ, amountNeeded: Int = 1, seizePriority: Int = SEIZE_PRIORITY, resourceSelectionRule: ResourceSelectionRuleIfc = resourcePool.defaultResourceSelectionRule, resourceAllocationRule: ResourceAllocationRuleIfc = resourcePool.defaultResourceAllocationRule, suspensionName: String? = null): ResourcePoolAllocation

Requests a number of units from the indicated pool of resources The queue that will hold the entity is internal to the resource pool. If the queue is priority based (i.e. uses a ranked queue discipline) the user should set the entity's priority attribute for use in ranking the queue prior to the calling seize.

Return

the Allocation representing the request for the Resource. After returning, the allocation indicates that the units of the resource have been allocated to the entity making the request. An allocation should not be returned until all requested units of the resource have been allocated.

Parameters

amountNeeded

the number of units of the resource needed for the request. The default is 1 unit.

resourcePool

the resource pool from which the units are being requested.

seizePriority

the priority of the request. This is meant to inform any allocation mechanism for requests that may be competing for the resource.

resourceSelectionRule

The rule to use to select resources to allocate from. By default, the pool's default rule is used.

resourceAllocationRule

The rule to use to determine the resources to allocate from given the selected resources. By default, the pool's default rule is used.

suspensionName

the name of the suspension point. can be used to identify which seize the entity is experiencing if there are more than one seize suspension points within the process. The user is responsible for uniqueness.


abstract suspend fun seize(movableResourcePool: MovableResourcePool, queue: RequestQ, requestLocation: LocationIfc = entity.currentLocation, seizePriority: Int = SEIZE_PRIORITY, resourceSelectionRule: MovableResourceSelectionRuleIfc = movableResourcePool.defaultMovableResourceSelectionRule, resourceAllocationRule: MovableResourceAllocationRuleIfc = movableResourcePool.defaultMovableResourceAllocationRule, suspensionName: String? = null): Allocation

Requests a movable resource from the indicated pool of resources The queue that will hold the entity is supplied to the movable resource pool. The movable resources in the pool will select requests from the queue. If the queue is priority based (i.e. uses a ranked queue discipline) the user should set the entity's priority attribute for use in ranking the queue prior to the calling seize.

Return

the Allocation representing the request for the Resource. After returning, the allocation indicates that the units of the resource have been allocated to the entity making the request. An allocation should not be returned until all requested units of the resource have been allocated.

Parameters

movableResourcePool

the resource pool from which the units are being requested.

requestLocation

The location of the request. The default is the entity's currentLocation

seizePriority

the priority of the request. This is meant to inform any allocation mechanism for requests that may be competing for the resource.

queue

the queue that will hold the entity if the amount needed cannot immediately be supplied by the resource. If the queue is priority based (i.e. uses a ranked queue discipline) the user should set the entity's priority attribute for use in ranking the queue prior to the calling seize.

resourceSelectionRule

The rule to use to select resources to allocate from. If null is supplied, then the pool's default rule is used.

resourceAllocationRule

The rule to use to determine the resources to allocate from given the selected resources. By default, the pool's default rule is used.

suspensionName

the name of the suspension point. can be used to identify which seize the entity is experiencing if there are more than one seize suspension points within the process. The user is responsible for uniqueness.


open suspend fun seize(movableResourcePoolWithQ: MovableResourcePoolWithQ, requestLocation: LocationIfc = entity.currentLocation, seizePriority: Int = SEIZE_PRIORITY, resourceSelectionRule: MovableResourceSelectionRuleIfc = movableResourcePoolWithQ.defaultMovableResourceSelectionRule, resourceAllocationRule: MovableResourceAllocationRuleIfc = movableResourcePoolWithQ.defaultMovableResourceAllocationRule, suspensionName: String? = null): Allocation

Requests a movable resource from the indicated pool of resources The queue that will hold the entity is internal to the movable resource pool. If the queue is priority based (i.e. uses a ranked queue discipline) the user should set the entity's priority attribute for use in ranking the queue prior to the calling seize.

Return

the Allocation representing the request for the Resource. After returning, the allocation indicates that the units of the resource have been allocated to the entity making the request. An allocation should not be returned until all requested units of the resource have been allocated.

Parameters

movableResourcePoolWithQ

the resource pool from which the units are being requested.

requestLocation

The location of the request. The default is the entity's currentLocation

seizePriority

the priority of the request. This is meant to inform any allocation mechanism for requests that may be competing for the resource.

resourceSelectionRule

The rule to use to select resources to allocate from. By default, the pool's default rule is used.

resourceAllocationRule

The rule to use to determine the resources to allocate from given the selected resources. By default, the pool's default rule is used.

suspensionName

the name of the suspension point. can be used to identify which seize the entity is experiencing if there are more than one seize suspension points within the process. The user is responsible for uniqueness.