SResource

class SResource(parent: ModelElement, capacity: Int = 1, name: String? = null) : ModelElement, StationResourceIfc(source)

A SResource represents a simple resource that can have units become busy. A resource is considered busy when it has 1 or more units seized. A resource is considered idle when all available units are idle. A resource has an initial capacity, which represents the units that can be allocated.

The capacity of the resource represents the maximum number of units available for use. For example, if the resource has capacity 3, it may have 2 units busy and 1 unit available. A resource cannot have more units busy than the capacity.

Author

rossetti

Constructors

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

Properties

Link copied to clipboard

Time-weighted 0/1 indicator of the busy state (at least one unit working).

Link copied to clipboard
open override val capacity: Int

The capacity of the resource at time any time t

Link copied to clipboard
open override val capacityResponse: TWResponseCIfc

Time-weighted response of the resource's capacity (which may vary over time under a capacity schedule).

Link copied to clipboard

Time-weighted 0/1 indicator of the failed state; its average is the long-run fraction of time failed (unavailability due to failure).

Link copied to clipboard

The effect of a failure on in-service work. The default is preempt-resume. Must be set before the model runs.

Link copied to clipboard
open override val hasAvailableUnits: Boolean

Indicates if resource has available units

Link copied to clipboard

Time-weighted 0/1 indicator of the idle state (on shift, not busy, not failed).

Link copied to clipboard

Time-weighted 0/1 indicator of the inactive state (off shift, capacity 0, not busy/failed).

Link copied to clipboard
@set:KSLControl(controlType = ControlType.INTEGER, lowerBound = 1.0)
open override var initialCapacity: Int

The initial capacity of the resource at time just prior to 0.0

Link copied to clipboard
open override val isBusy: Boolean

Checks to see if the resource is busy, has some units allocated

Link copied to clipboard
open override val isFailed: Boolean

True if the resource is currently failed (down for repair).

Link copied to clipboard
open override val isIdle: Boolean

Checks if the resource is idle, has no units allocated

Link copied to clipboard
open override val numAvailableUnits: Int

Current number of available units

Link copied to clipboard
open override val numBusyUnits: TWResponseCIfc

Response information on number of busy units

Link copied to clipboard
open override val numTimesFailed: CounterCIfc

Counts the number of failures (downtimes) experienced.

Link copied to clipboard
open override val numTimesReleased: Int

Counts how many times the resource has units become idle

Link copied to clipboard
open override val numTimesSeized: Int

Counts how many times the resource has units become busy

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

Response information on resource utilization

Functions

Link copied to clipboard

Registers a listener notified when the resource fails (for preemption).

Link copied to clipboard

Registers a listener notified when available units increase.

Link copied to clipboard
open override fun changeCapacity(value: Int)

Sets the current capacity. An increase that creates newly available units notifies the availability listeners so a waiting queue can be served. A decrease takes effect as busy units are released (IGNORE-rule semantics): in-service units are not interrupted.

Link copied to clipboard
protected open override fun initialize()

This method should be overridden by subclasses that need actions performed to initialize prior to a replication. It is called once before each replication occurs if the model element wants initialization. It is called after beforeReplication() is called

Link copied to clipboard
open override fun release(amount: Int)

Release the amount of the resource. The amount to release must be 1 or more and less than or equal to the current number of busy resource units.

Link copied to clipboard
open override fun seize(amount: Int)

Seizes amount units of the resource. If amt = 0, then an exception occurs. If the resource has no units available, then an exception occurs. If the amt is greater than the number available, then an exception occurs. Thus, users must check for availability before calling this function.

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

Link copied to clipboard
fun useCountBasedFailures(countToFailure: GetValueIfc, timeToRepair: RVariableIfc)

Configures usage (count) based failures: the resource fails after countToFailure completed services and is down for timeToRepair. The count is re-sampled after each repair.

Link copied to clipboard
fun useOperatingTimeBasedFailures(operatingTimeToFailure: RVariableIfc, timeToRepair: RVariableIfc)

Configures operating-time (usage) based failures: the resource fails after operatingTimeToFailure units of busy time accumulate, and is down for timeToRepair. The operating clock advances only while the resource is busy and on shift; it pauses while idle, off-shift (capacity 0), or failed.

Link copied to clipboard
open override fun useSchedule(schedule: CapacitySchedule)

Drives this resource's capacity from a CapacitySchedule (IGNORE-rule semantics).

Link copied to clipboard
fun useTimeBasedFailures(timeToFailure: RVariableIfc, timeToRepair: RVariableIfc)

Configures time-based (calendar-clock) failures: the resource fails after timeToFailure elapses (wall-clock, whether busy or idle) and is down for timeToRepair. Failures are finish-then-fail (in-service units complete first) and take the whole resource down.