Resource With Q
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
the containing model element
the capacity for the resource at the beginning of each replication, must be at least 1
the name for the resource
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.