RequestQ

class RequestQ @JvmOverloads constructor(parent: ModelElement, name: String? = null, discipline: Queue.Discipline = Discipline.FIFO) : Queue<ProcessModel.Entity.Request> (source)

If the user supplies a request selection rule then the default queue discipline will order the requests for finding the next request from the queue based on the rule. The rule may cause the ordering of requests to be presented in a different order than strictly implied by the queue discipline. For example, a later arriving request may "jump" forward in the queue if the rule selects it.

Parameters

parent

containing model element

name

the name of the queue

discipline

the queue discipline for ordering the queue

Constructors

Link copied to clipboard
constructor(parent: ModelElement, name: String? = null, discipline: Queue.Discipline = Discipline.FIFO)

Properties

Link copied to clipboard

A rule to select requests. Null by default. The default behavior is to use the selectRequestsByResource() function. If a rule is supplied, then the selectRequestsByResource() function will not be used.

Functions

Link copied to clipboard
fun countRequestsFor(resource: Resource): Int

Returns the number of requests targeting the supplied resource that are waiting in the queue.

Returns the number of requests targeting the supplied resource pool that are waiting in the queue.

Returns the number of requests targeting the supplied movable resource pool that are waiting in the queue.

Link copied to clipboard

Returns a list of requests waiting for the specified resource that have requested a number of units of the resource that is less than or equal to the number of units available. Thus, any request in the returned list could be satisfied at the current time.

Link copied to clipboard

Returns the next request that can be fully satisfied by the resource. If no requests can be satisfied, then null is returned. The selection is based on the queue discipline.

Link copied to clipboard
fun removeAllAndTerminate(waitStats: Boolean = false, afterTermination: (entity: ProcessModel.Entity) -> Unit? = null)

Removes and terminates all the requests waiting in the queue

Link copied to clipboard
fun removeAndTerminate(request: ProcessModel.Entity.Request, waitStats: Boolean = false, afterTermination: (entity: ProcessModel.Entity) -> Unit? = null)

Removes the request from the queue and tells the associated entity to terminate its process. The process that was suspended because the entity's request was placed in the queue is immediately terminated.

Link copied to clipboard

Returns a list of requests that can be allocated at the current time based on the amount available in the resource. Each request that can be fully allocated until the amount available is used up is returned. The list is ordered in the same order as the RequestQ. No partial filling is permitted.