ResourceWithQ

open class ResourceWithQ @JvmOverloads constructor(parent: ModelElement, name: String? = null, capacity: Int = 1, queue: RequestQ? = null) : Resource, ResourceWithQCIfc(source)

A resource is considered busy if at least 1 unit is allocated. A resource is considered idle if no units have been allocated. The capacity can be changed during a replication; however, the capacity of every replication starts at the same initial capacity.

A resource is considered inactive if all of its units of capacity are inactive. That is, a resource is inactive if its capacity is zero and there are no busy units. Capacity can only become 0 via the use of a CapacitySchedule or via the use of a CapacityChangeNotice. A resource that is inactive can be seized. If a request for units occurs when the resource is inactive, the request waits (as usual) until it can be fulfilled.

Define b(t) as the number of units allocated and c(t) as the current capacity of the resource at time t.

If (b(t) = 0 and c(t) = 0) then the resource is considered inactive If b(t) 0 and c(t) >= 0, then the resource is busy If b(t) = 0 and c(t) 0, then the resource is idle

Note that a resource may be busy when the capacity is 0 because of the timing of capacity changes.

Parameters

parent

the containing model element

capacity

the capacity for the resource at the beginning of each replication, must be at least 1

name

the name for the resource

queue

the queue for waiting entities. If a request for units cannot immediately be met, then this is where the request waits. If a queue is not supplied, a default queue will be created. Supplying a queue allows resources to share request queues.

Constructors

Link copied to clipboard
constructor(parent: ModelElement, name: String? = null, capacity: Int = 1, queue: RequestQ? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override var defaultReportingOption: Boolean

Returns the default reporting option. True means that the response should appear on the default reports

Link copied to clipboard
Link copied to clipboard
open override val wip: TWResponseCIfc

The number waiting and in service

Functions

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

Includes the model name, the id, the model element name, the parent name, and parent id