Package-level declarations

Types

Link copied to clipboard
open class ActivityStation @JvmOverloads constructor(parent: ModelElement, activityTime: RVariableIfc = ConstantRV.ZERO, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null) : Station, ActivityStationCIfc

Models a simple delay.

Link copied to clipboard
Link copied to clipboard

An opaque token describing one outstanding seize: the resource, the amount of units held, the simulated seizeTime at which the units were acquired, and the name of the SeizeStation that recorded the seize.

Link copied to clipboard
class BatchStation(parent: ModelElement, val batchSize: Int, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null) : ModelElement, QObjectReceiverIfc, RoutingOutletsIfc, BatchStationCIfc

Accumulates arriving QObject instances until batchSize have been collected, then forms a single batch QObject (carrying the members as its attached object) and sends it onward. A SeparateStation is the inverse, recovering the members.

Link copied to clipboard

Read-only view of a BatchStation.

Link copied to clipboard

A receiver with a finite capacity that can report whether it can accept an instance and notify upstream stations when space frees. This enables manufacturing (block-after-service) blocking between stations.

Link copied to clipboard
class BlockingStation(parent: ModelElement, val bufferCapacity: Int, activityTime: RVariableIfc, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null) : ModelElement, BlockableReceiverIfc, RoutingOutletsIfc, BlockingStationCIfc

A single-server station with a finite buffer that uses block-after-service semantics: when the server completes an instance but the downstream receiver cannot accept it, the server is blocked — it holds the finished instance and does not start the next one until the downstream frees a slot. A chain of blocking stations models a production line with limited buffers and back-pressure.

Link copied to clipboard

Read-only view of a BlockingStation.

Link copied to clipboard

Promises to randomly pick the receiver and send the arriving QObject instance to the receiver. Can act as both a receiver and a sender of QObject instances. Receiving instances are immediately sent.

Link copied to clipboard

Routes each arriving QObject to the receiver mapped to its ModelElement.QObject.qObjectType, falling back to default when the type is not present in typeMap. This is the natural routing primitive for a multi-class network, where each class follows its own path.

Link copied to clipboard

A fixed changeover setup: setup time is incurred whenever the type changes (including the first job), and zero when the next job is the same type as the previous one.

Link copied to clipboard
fun interface ChildCountIfc

Returns how many children to spawn for a parent.

Link copied to clipboard
fun interface ChildFactoryIfc

Configures a freshly created child QObject for a given parent. The child itself is constructed by the ForkStation (since QObject is an inner class of ModelElement and must be created in model-element context); this hook marks/types it, attaches a value object, etc. Called once per spawned child. Mirrors the source-station marking idiom.

Link copied to clipboard

Routes each arriving QObject to the receiver of the first cases entry whose predicate holds for that instance, falling back to default if none match. This is the QObject-aware, N-way generalization of a two-way condition sender: the predicates are evaluated against the instance being routed.

Link copied to clipboard
open class DisposalStation(parent: ModelElement, myNumInSystem: TWResponse? = null, name: String? = null) : ModelElement, QObjectReceiverIfc

Can be used to capture the total number disposed through this station and the total time in the system at this dispose. The optionally supplied number in the system response will be decremented by 1 if supplied.

Link copied to clipboard
Link copied to clipboard
fun interface EntryActionIfc
Link copied to clipboard
fun interface ExitActionIfc
Link copied to clipboard

How an in-service unit is treated when a failure occurs:

Link copied to clipboard
class ForkStation(parent: ModelElement, join: JoinStation, childCount: ChildCountIfc, childFactory: ChildFactoryIfc? = null, childReceiver: QObjectReceiverIfc = NotImplementedReceiver, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null) : ModelElement, QObjectReceiverIfc, RoutingOutletsIfc, ForkStationCIfc

The send-side of a fork-join pair: receives a parent QObject, spawns a variable number of children, and routes the parent onward concurrently with the children. Children are created by childFactory and registered with the paired join so it can reunite them with the parent.

Link copied to clipboard
interface ForkStationCIfc

Read-only view of a ForkStation.

Link copied to clipboard
class GateStation(parent: ModelElement, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, initiallyOpen: Boolean = true, name: String? = null) : ModelElement, QObjectReceiverIfc, RoutingOutletsIfc, GateStationCIfc

A gate that passes arriving QObject instances straight through while open, and holds them (in arrival order) while closed. Opening the gate releases all held instances. The gate is controlled externally via open and close — for example by a scheduled event, a controller, or an agent reacting to network state — making it the station-view hook for signal/condition control.

Link copied to clipboard
interface GateStationCIfc

Read-only view of a GateStation.

Link copied to clipboard

A non-generating entry port: accepts externally created or transferred QObject instances into the network (performing the entry bookkeeping) and forwards them to the first internal receiver. Unlike a SourceStation it does not generate arrivals; it is the receiving end of a TransferStation or any external producer.

Link copied to clipboard

The receive-side of a fork-join pair: holds each parent until all of its children have arrived, then emits the parent onward. A parent and its expected child count are registered by the paired ForkStation at fork time; the join holds state keyed by parent.id and releases the parent when arrivedChildren == expectedChildren regardless of arrival order (parent-first or children-first).

Link copied to clipboard
interface JoinStationCIfc

Read-only view of a JoinStation.

Link copied to clipboard
annotation class KSLStationDsl

Restricts implicit receivers within the station-network builder DSL.

Link copied to clipboard
fun interface MarkingHookIfc

A per-instance marking action applied by a SourceStation to each freshly created QObject. Use to sample a type id, attach a value object, set a priority, or attach a route — anything that varies per instance and can't be expressed as a static QObjectClass.

Link copied to clipboard
class MatchStation(parent: ModelElement, val numInputs: Int, keyExtractor: (ModelElement.QObject) -> Any? = null, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null) : ModelElement, RoutingOutletsIfc, MatchStationCIfc

Synchronizes (assembles) instances arriving on several inputs: when one instance is available on every input — optionally with the same matching key — the station removes one from each, combines them into a single instance (carrying the members as its attached object), and sends it onward.

Link copied to clipboard

Read-only view of a MatchStation.

Link copied to clipboard
data class NetworkArc(val from: String, val to: String)

A directed connection between two registered nodes of a StationNetwork, by name.

Link copied to clipboard

The receiver scope for queueingNetwork. Provides node-creation functions and routing operators. Routing targets may be given as live references or, for the string overloads, as node names resolved after the block completes (enabling forward references such as rework loops declared before their target).

Link copied to clipboard

A boundary port through which QObject instances leave a StationNetwork. An egress performs the network's exit bookkeeping (decrement the number in system, record the system time, count the completion, publish the exited-network event) and then either disposes of the instance or hands it off to an external receiver.

Link copied to clipboard

A boundary port through which QObject instances enter a StationNetwork. An ingress performs the network's entry bookkeeping (increment the number in system, publish the entered-network event) and then forwards the arriving instance to the first internal receiver.

Link copied to clipboard
interface NetworkObserver

Observes lifecycle events published by a StationNetwork. Override only the events of interest; all methods do nothing by default. This is the notification seam other modeling views (process, agent-based) subscribe to.

Link copied to clipboard

A non-homogeneous Poisson process source: generates arriving QObject instances at a time-varying rate driven by a PiecewiseRateFunction, then injects them into the StationNetwork. The companion to SourceStation for non-stationary arrivals.

Link copied to clipboard

Allows an REmpiricalList to act as a receiver of qObjects and to send them to destination receivers according to the specified probabilities.

Link copied to clipboard

Selects which of several input queues a multi-queue station serves next. Returns the index of the queue to serve, or null when all are empty.

Link copied to clipboard
class NWayStation(parent: ModelElement, numQueues: Int, activityTime: RVariableIfc, capacity: Int = 1, selectionRule: NWayQueueSelectionRuleIfc = PriorityQueueSelection(), nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null) : ModelElement, RoutingOutletsIfc, NWayStationCIfc

A station with several input queues sharing one server group. Each input has its own queue (reached via input); when a server unit is free, a NWayQueueSelectionRuleIfc chooses which queue to serve next. This models multi-class or multi-stream service with an explicit cross-queue discipline.

Link copied to clipboard
interface NWayStationCIfc

Read-only view of an NWayStation.

Link copied to clipboard
class PickStationReceiver(var stations: List<Station>, var comparator: Comparator<Station> = StationWIPComparator()) : QObjectReceiverIfc

Picks the minimum from the list of stations based on the comparator. Causes the arriving qObject to be received at the picked station.

Link copied to clipboard
class PickStationSender(var stations: List<Station>, var comparator: Comparator<Station> = StationWIPComparator()) : QObjectSender

Picks the minimum from the list of stations based on the comparator.

Link copied to clipboard

Serves the lowest-index non-empty queue first (strict priority by queue index).

Link copied to clipboard

Routes each arriving QObject to a receiver chosen at random by picker. The knownDestinations make the random choice introspectable for the network graph (the picker alone does not expose its elements). Supply a picker — such as an ksl.modeling.elements.REmpiricalList — over the same destinations.

Link copied to clipboard
class QObjectClass(val className: String, val typeId: Int, val priority: Int = DEFAULT_PRIORITY, val valueObject: GetValueIfc? = null, val route: Route? = null, val configure: (ModelElement.QObject) -> Unit? = null)

A named template for a class of QObject instances flowing through a StationNetwork. A class is a configuration, not a factory: instances are created by a SourceStation and then have the class's template applied to them. This is the bridge to multi-class queueing networks, where each class can carry its own type id, priority, service-time provider, and route.

Link copied to clipboard
fun interface QObjectPredicate

A predicate over a QObject instance, used by routers to make data-dependent routing decisions. Unlike a plain () -> Boolean, the predicate is given the instance being routed, so routing can depend on its type, priority, value, or attached state.

Link copied to clipboard
fun interface QObjectReceiverIfc

A generic interface that can be implemented to facilitate the receiving of QObjects for processing.

Link copied to clipboard
Link copied to clipboard
fun interface QObjectSenderIfc

A functional interface that promises to send. Within the context of qObjects a sender should cause a qObject to be (eventually) received by a receiver.

Link copied to clipboard

Represents an iterator based sequence of receivers that can be used to send the qObject to the next receiver. At the end of the iterator the default behavior is to silently end.

Link copied to clipboard

An atomic release: when an entity arrives, releases this entity's oldest outstanding allocation on resource (FIFO) and forwards. If the entity holds no allocation on the resource, the model is in error and the build fails loudly — releases must be paired with seizes.

Link copied to clipboard

Read-only view of a ReleaseStation.

Link copied to clipboard

Notified when a resource fails so that a station can preempt its in-service work (cancel the in-service event, bank the remaining time, and free the unit). Resumption and queue service happen on repair via the UnitsAvailableListenerIfc.

Link copied to clipboard
open class ResourcePoolStation(parent: ModelElement, pool: SResourcePool, activityTime: RVariableIfc = ConstantRV.ZERO, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null) : Station, ActivityStationCIfc

A single-queue station that seizes units from a shared SResourcePool rather than from its own resource. Several such stations sharing one pool model a set of servers (the pool) serving several distinct queues; a unit freed by any station can serve whichever waiting station the pool notifies first.

Link copied to clipboard

Cycles through the queues, serving the next non-empty one after the last served.

Link copied to clipboard

Routes arriving QObject instances to receivers in cyclic order, distributing successive instances round-robin regardless of their content.

Link copied to clipboard
class Route(val routeName: String, steps: List<QObjectReceiverIfc>)

A first-class, named, ordered visitation sequence through a set of receivers (a "process plan"). A route is a reusable template: each QObject that follows the route gets its own cursor via newSender, so many instances can traverse the same route concurrently without interfering.

Link copied to clipboard

A Router both receives a QObject and immediately sends it onward, choosing the destination as a function of the arriving instance. It is the QObject-aware generalization of QObjectSender: its selectNextReceiver is passed the instance being routed, so data-dependent routing (by type, by condition, by attribute) is expressible directly.

Link copied to clipboard
data class RoutingCase(val predicate: QObjectPredicate, val receiver: QObjectReceiverIfc)

A pairing of a QObjectPredicate with the receiver to use when the predicate holds for the routed instance.

Link copied to clipboard

Implemented by network nodes that can describe their static onward routing, enabling a StationNetwork to assemble an introspectable graph and to validate the topology before a run.

Link copied to clipboard

An atomic seize: when an entity arrives, the station either acquires amount units of resource (recording the Allocation with the network so ReleaseStation can release it later) and forwards the entity, or blocks the entity in its own queue. When the resource gains units, the station serves as many waiting entities as it can.

Link copied to clipboard

Read-only view of a SeizeStation.

Link copied to clipboard
fun interface SendingActionIfc
Link copied to clipboard

Separates a batch formed by a BatchStation back into its member instances, sending each member onward. A batch is recognized by an attached object that is a list of QObject members; the batch wrapper is discarded and the original members continue. A non-batch instance is passed through unchanged.

Link copied to clipboard

Read-only view of a SeparateStation.

Link copied to clipboard
class SequenceDependentSetupTime(setups: Map<Pair<Int, Int>, Double>, initialSetups: Map<Int, Double> = emptyMap(), defaultSetup: Double = 0.0) : SetupTimeIfc

A sequence-dependent setup matrix: the setup before serving toType depends on the (fromType, toType) pair.

Link copied to clipboard
fun interface SetupTimeIfc

Determines the setup (changeover) time incurred before a station serves a QObject, as a function of the previously served type and the arriving type. This supports sequence-dependent setups common in manufacturing.

Link copied to clipboard
class ShortestQueueRouter(stations: List<Station>, comparator: Comparator<Station> = StationWIPComparator()) : Router

Routes each arriving QObject to the station with the smallest work-in-process among stations, as ordered by comparator (default: fewest at station). This is the join-shortest-queue policy and generalizes the pick-station receiver.

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

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.

Link copied to clipboard
Link copied to clipboard

A SinkStation is the network's terminal egress: it disposes of the QObject instances it receives, decrementing the number in the system and recording the total time in the system. It is the self-contained special case of a NetworkEgress and generalizes DisposalStation by tying the disposal into the owning StationNetwork's system-level responses and event stream.

Link copied to clipboard

A SourceStation generates QObject instances according to an arrival process and injects them into a StationNetwork. It is the self-contained special case of a NetworkIngress that also creates the arriving instances.

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

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.

Link copied to clipboard
interface SResourceCIfc
Link copied to clipboard
class SResourcePool(parent: ModelElement, capacity: Int = 1, name: String? = null) : ModelElement, SResourcePoolCIfc

A pool of interchangeable resource units shared by one or more ResourcePoolStations. Stations seize and release units from the common pool, so a freed unit can serve whichever station's queue is waiting. When a unit is released, the pool notifies its registered stations (in registration order) so they can serve their queues.

Link copied to clipboard

Read-only view of an SResourcePool.

Link copied to clipboard
abstract class Station(parent: ModelElement, nextReceiver: QObjectReceiverIfc = NotImplementedReceiver, name: String? = null) : ModelElement, QObjectReceiverIfc, StationCIfc, Comparable<Station> , RoutingOutletsIfc

A station is a location that can receive, potentially process instances of the QObject class, and cause them to be received by other receivers via appropriate send logic.

Link copied to clipboard

A functional interface for determining the activity time at a station

Link copied to clipboard
interface StationCIfc
Link copied to clipboard

A StationNetwork is a container that models a queueing network as a graph of receivers (stations) connected by senders/routers. It owns the network-level responses that essentially every queueing model re-derives by hand — the number in the system, the total time in the system, and the number completed — and it provides a name registry, named boundary ports (ingress/egress), and a lifecycle event stream so that the network is an open, observable system.

Link copied to clipboard

A read-only, observation-oriented view of a StationNetwork. Exposes the network-level responses and the introspectable set of node names, and allows attaching/detaching lifecycle observers, while hiding construction and mutation operations (the creation helpers, node registration, and the internal entry/exit bookkeeping). Expose this interface to clients of a network rather than the concrete class.

Link copied to clipboard

The operational contract a station programs against for its resource. This is the seam that lets a station use either a simple SResource or, later, a resource pool, without depending on a concrete type. It adds the mutating operations (seize/release, capacity changes, schedule attachment, and an availability listener) to the read-only SResourceCIfc.

Link copied to clipboard
Link copied to clipboard

An egress port that hands instances off to a target receiver — typically the IngressStation of another network — instead of disposing of them. This is the station-view realization of a network-to-network transfer "in a prescribed manner": an optional transferDelay models transport time, and an optional transform can re-mark/repackage the instance on hand-off.

Link copied to clipboard

Allows a Bernoulli choice between two qObject receivers. Receives the incoming qObject and sends it two one of two receivers according to the Bernoulli picking process.

Link copied to clipboard
Link copied to clipboard

Notified when a station resource gains available units (for example, after a capacity increase from a schedule), so that a waiting queue can be served.

Functions

Link copied to clipboard

Creates a StationNetwork using the type-safe builder DSL. The block declares sources, stations, sinks, and the routing between them; the network is the parent of every created node. This is a thin facade over the network's creation helpers and routing primitives — anything expressible here is expressible by hand and vice versa.