SingleQStation

open class SingleQStation @JvmOverloads constructor(parent: ModelElement, activityTime: RVariableIfc = ConstantRV.ZERO, resource: SResource? = null, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null) : Station, SingleQStationCIfc(source)

Models a simple work station that has a single queue for holding received qObjects for processing and a simple resource that is used during the processing.

A QObject may have an object that implements the GetValueIfc attached. If so, the current value from this object is used as the processing time at the station. If not attached, then the specified processing time for the station will be used. Thus, a processed QObject instance can bring its own processing time. In addition, a QObject may have an instance of a QObjectSenderIfc interface attached. If one is attached, the sender will be used to determine where to send the qObject. If a sender is not attached, then the specified next receiver will be used. Thus, a processed QObject instance can determine where it goes to next after processing.

Parameters

parent

the model element serving as this element's parent

activityTime

the processing time at the station. The default is a 0.0 delay.

resource

the resource to use at the station. The default of null will cause a resource of capacity 1 to be created and used at the station

nextReceiver

the receiving location that will receive the processed qObjects once the processing has been completed. A default of NotImplementedReceiver, indicates that there is no receiver implemented. If no receiver is present, there will be a run-time error.

name

the name of the station

Constructors

Link copied to clipboard
constructor(parent: ModelElement, activityTime: RVariableIfc = ConstantRV.ZERO, resource: SResource? = null, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null)
constructor(parent: ModelElement, activityTime: RVariableIfc = ConstantRV.ZERO, initialCapacity: Int, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null)

Allows the single queue station to be created with an initial capacity specification for its resource.

Properties

Link copied to clipboard

If set and the station does not use the qObject for determining the activity time, then the supplied function will be used.

Link copied to clipboard
Link copied to clipboard
open override val isQueueEmpty: Boolean

Indicates if the queue is empty.

Link copied to clipboard
open override val isQueueNotEmpty: Boolean

Indicates if the queue is not empty

Link copied to clipboard
open override val isResourceAvailable: Boolean

Indicates if the resource has units available.

Link copied to clipboard
Link copied to clipboard
protected val myResource: SResource
Link copied to clipboard
Link copied to clipboard

The number of instances that reneged (left the queue out of impatience).

Link copied to clipboard

Where reneging (impatient) instances are sent; null drops them.

Link copied to clipboard

Optional patience (reneging) time. When set, each enqueued QObject will leave the queue if it has not begun service within a sampled patience time, and is routed to renegeReceiver (or dropped if that is null). Note: if reneged instances are dropped rather than routed to a sink, the owning network's number-in-system will not reflect their departure.

Link copied to clipboard
open override val resource: SResourceCIfc
Link copied to clipboard

The setup time incurred per served QObject (zero when no changeover occurs).

Link copied to clipboard

Optional sequence-dependent setup (changeover) rule. When set, a setup time is incurred before serving each QObject, based on the previously served type and the arriving type. The setup precedes the activity time within the same service.

Link copied to clipboard

If true, the instance will attempt to use the QObject that is experiencing the activity to determine the activity time by referencing the QObject's valueObject. If false (the default), the supplied activity time will be used

Link copied to clipboard

Functions

Link copied to clipboard
protected open fun activityTime(qObject: ModelElement.QObject): Double

Could be overridden to supply different approach for determining the activity delay. The current approach does the following.

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
protected open override fun process(arrivingQObject: ModelElement.QObject)

Receives the qObject instance for processing. Handle the queuing if the resource is not available and begins service for the next customer.

Link copied to clipboard
protected fun serveNext()

Called to determine which waiting QObject will be served next Determines the next customer, seizes the resource, and schedules the end of the service.

Link copied to clipboard
protected fun serveWaitingCustomers()

Serves waiting customers while the resource has available units and the queue is not empty. Invoked when the resource's capacity increases.

Link copied to clipboard

Drives this station's resource capacity from a CapacitySchedule, enabling shift/availability modeling. Decreases use IGNORE-rule semantics (in-service units are not interrupted); increases immediately serve the waiting queue.

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

Configures usage (count) based failures for this station's resource: the resource fails after a sampled number of completed services, then is down for a sampled repair time. Failures are finish-then-fail and full-down.

Link copied to clipboard

Sets the failure effect to finish-then-fail (in-service work completes first).

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

Configures operating-time (usage) based failures for this station's resource: the resource fails after a sampled amount of accumulated busy time and is down for a sampled repair time. The operating clock pauses while the station is idle, off-shift, or failed.

Link copied to clipboard

Sets the failure effect to preempt-resume (the default).

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

Configures time-based (calendar-clock) failures for this station's resource: time-to-failure and time-to-repair are sampled from the supplied random variables. Failures are finish-then-fail and take the whole resource down.