MovableResourcePool

open class MovableResourcePool(parent: ModelElement, movableResources: List<MovableResource>, defaultVelocity: RVariableIfc, name: String? = null) : AbstractResourcePool<MovableResource> , VelocityIfc(source)

A MovableResourcePool represents a list of movable resources from which resources can be selected to fill requests made by Entities.

Resources are selected according to a ResourceSelectionRule. The assumption is that any of the resources within the pool may be used to fill the request.

If no selection rule is supplied the pool selects a list of resources that can fully satisfy the request. The default allocation rule is to allocate the movable resource that is closest to the entity.

If no default rules are supplied, the first available movable resource is selected based on the order of the resources supplied.

Author

rossetti

Parameters

parent

the parent model element

movableResources

a list of resources to be included in the pool

defaultVelocity

the default velocity fore all resources to use.

name

the name of the pool

Inheritors

Constructors

Link copied to clipboard
constructor(parent: ModelElement, movableResources: List<MovableResource>, defaultVelocity: RVariableIfc, name: String? = null)

Properties

Functions

Link copied to clipboard
override fun addResource(resource: MovableResource)

Adds a movable resource to the pool. The model must not be running when adding a resource.

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

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.

Link copied to clipboard

For use, before calling allocate()

Link copied to clipboard
fun deallocate(allocation: Allocation)