Package-level declarations

Types

Link copied to clipboard
@Serializable
data class ActivityStationSpec(val name: String, val activityTime: RVData, val routing: RoutingSpec? = null)

An infinite-server delay station (no resource contention beyond its activity time). Useful for pure delays between seize/release pairs and for class-based paths that don't need queueing.

Link copied to clipboard
@Serializable
data class BatchStationSpec(val name: String, val batchSize: Int, val routing: RoutingSpec? = null)

A station that accumulates batchSize instances into one batch.

Link copied to clipboard
@Serializable
data class BlockingStationSpec(val name: String, val bufferCapacity: Int, val activityTime: RVData, val routing: RoutingSpec? = null)

A finite-buffer station with block-after-service semantics.

Link copied to clipboard
@Serializable
data class CapacityItemSpec(val capacity: Int, val duration: Double)

One step of a capacity schedule: hold capacity for duration.

Link copied to clipboard
@Serializable
data class CapacityScheduleSpec(val items: List<CapacityItemSpec>, val repeatable: Boolean = false, val startTime: Double = 0.0)

A capacity (shift) schedule for a station's resource. The items are applied in order from startTime; if repeatable, the sequence repeats.

Link copied to clipboard
@Serializable
data class ChanceBranch(val to: String, val probability: Double)

A probabilistic routing branch: send to to with the given probability.

Link copied to clipboard
@Serializable
data class ConditionCase(val predicate: String, val to: String)

A by-condition routing case: when the named predicate holds, route to to.

Link copied to clipboard

How a failure treats in-service work; mirrors the runtime failure effect.

Link copied to clipboard
@Serializable
sealed class FailureSpec

A failure (breakdown) specification for a station's resource. All variants carry a repair-time distribution and an effect; they differ in the trigger.

Link copied to clipboard
@Serializable
data class ForkStationSpec(val name: String, val join: String, val childCount: String, val childFactory: String? = null, val childRouting: RoutingSpec? = null, val routing: RoutingSpec? = null)

The send side of a fork-join pair, paired with the join named join. Behavior (count and child configuration) is supplied via named hooks resolved at build time against the builder's ChildFactoryIfc / ChildCountIfc registries; an unknown hook fails the build loudly.

Link copied to clipboard
@Serializable
data class GateStationSpec(val name: String, val initiallyOpen: Boolean = true, val routing: RoutingSpec? = null)

A gate that holds instances while closed. The initiallyOpen state serializes; the open/close control is behavior (not serialized) and must be supplied in code.

Link copied to clipboard
@Serializable
data class InitialSetupEntry(val toType: Int, val setupTime: Double)

An initial (first-job) setup-time entry by type.

Link copied to clipboard
@Serializable
data class JoinStationSpec(val name: String, val routing: RoutingSpec? = null)

The receive side of a fork-join pair. Its parent input is reached as "name#0" and its child input as "name#1" (the join's default receive is the parent input, so the bare "name" target works for parents too).

Link copied to clipboard
@Serializable
data class MatchStationSpec(val name: String, val numInputs: Int, val keyByType: Boolean = false, val routing: RoutingSpec? = null)

An assembly/synchronization station joining one instance from each input. Route to a specific input with the target syntax "name#index". With keyByType true, instances are matched by their type id; otherwise any one from each input is matched.

Link copied to clipboard
@Serializable
data class NHPPSourceSpec(val name: String, val durations: List<Double>, val rates: List<Double>, val streamNum: Int = 0, val maxArrivals: Long = Long.MAX_VALUE, val marking: String? = null, val routing: RoutingSpec? = null)

A non-homogeneous Poisson arrival source driven by a piecewise-constant rate function. The rate function is specified as parallel durations (length of each interval) and rates (arrival rate during each interval). Both arrays must have the same length and at least one element.

Link copied to clipboard
@Serializable
data class NWayStationSpec(val name: String, val numQueues: Int, val activityTime: RVData, val capacity: Int = 1, val selection: QueueSelection = QueueSelection.PRIORITY, val routing: RoutingSpec? = null)

A multi-queue single-server-group station. Route to a specific input with the target syntax "name#index" (for example, "Assembly#0"). Its single output is given by routing.

Link copied to clipboard
@Serializable
data class PooledStationSpec(val name: String, val pool: String, val activityTime: RVData? = null, val routing: RoutingSpec? = null)

A station that seizes from a shared pool instead of its own resource.

Link copied to clipboard
@Serializable
data class PoolSpec(val name: String, val capacity: Int = 1)

A shared resource pool (not a routing node); referenced by PooledStationSpec.pool.

Link copied to clipboard
@Serializable
data class QObjectClassSpec(val name: String, val typeId: Int, val priority: Int = 1, val serviceTime: RVData? = null)

A QObject class template for multi-class networks.

Link copied to clipboard
Link copied to clipboard
class QueueingNetworkModelBuilder(spec: QueueingNetworkSpec, predicates: Map<String, QObjectPredicate> = emptyMap(), childFactories: Map<String, ChildFactoryIfc> = emptyMap(), childCounts: Map<String, ChildCountIfc> = emptyMap(), markings: Map<String, MarkingHookIfc> = emptyMap()) : ModelBuilderIfc

A ModelBuilderIfc that builds a runnable Model containing a single ksl.modeling.station.StationNetwork from a QueueingNetworkSpec. This makes a serialized (e.g., TOML) network a portable model source that plugs into the app/config layer (run configuration, scenarios, optimization).

Link copied to clipboard
@Serializable
data class QueueingNetworkSpec(val name: String, val sources: List<SourceSpec> = emptyList(), val stations: List<StationSpec> = emptyList(), val sinks: List<SinkSpec> = emptyList(), val classes: List<QObjectClassSpec> = emptyList(), val pools: List<PoolSpec> = emptyList(), val pooledStations: List<PooledStationSpec> = emptyList(), val batchStations: List<BatchStationSpec> = emptyList(), val separateStations: List<SeparateStationSpec> = emptyList(), val gateStations: List<GateStationSpec> = emptyList(), val blockingStations: List<BlockingStationSpec> = emptyList(), val nWayStations: List<NWayStationSpec> = emptyList(), val matchStations: List<MatchStationSpec> = emptyList(), val joinStations: List<JoinStationSpec> = emptyList(), val forkStations: List<ForkStationSpec> = emptyList(), val resources: List<ResourceSpec> = emptyList(), val seizeStations: List<SeizeStationSpec> = emptyList(), val releaseStations: List<ReleaseStationSpec> = emptyList(), val activityStations: List<ActivityStationSpec> = emptyList(), val nhppSources: List<NHPPSourceSpec> = emptyList(), val routes: List<RouteSpec> = emptyList())

Serializable, hand-authorable description of a queueing network. This is pure data: distributions are captured as RVData (reusing the KSL random-variable serialization), and routing is a closed set of RoutingSpec variants. A ksl.modeling.station.config.StationNetworkBuilder turns a spec into a live ksl.modeling.station.StationNetwork.

Link copied to clipboard

TOML codec for QueueingNetworkSpec, mirroring the app-config codecs. TOML's tables and array-of-table syntax make hand-authored network descriptions readable.

Link copied to clipboard
@Serializable
enum QueueSelection : Enum<QueueSelection>

The cross-queue selection rule for an NWayStationSpec.

Link copied to clipboard
@Serializable
data class ReleaseStationSpec(val name: String, val resource: String, val routing: RoutingSpec? = null)

An atomic release station: releases this entity's oldest outstanding allocation on resource. Release without a prior seize on that resource fails loudly.

Link copied to clipboard
@Serializable
data class ResourceSpec(val name: String, val capacity: Int = 1)

A free-standing resource (not a routing node); referenced by SeizeStationSpec and ReleaseStationSpec for atomic Arena-style seize/release.

Link copied to clipboard
@Serializable
data class RouteSpec(val name: String, val steps: List<String>)

A first-class named ksl.modeling.station.Route — an ordered list of receivers a QObject traverses via its attached sender. Each step is a node name (with the "node#index" syntax supported for the multi-input stations NWay/Match/Join).

Link copied to clipboard
@Serializable
sealed class RoutingSpec

How a node routes processed instances. A closed set of variants.

Link copied to clipboard
@Serializable
data class SeizeStationSpec(val name: String, val resource: String, val amount: Int = 1, val routing: RoutingSpec? = null)

An atomic seize station: acquires amount units of resource, or queues the entity if not available. Multiple seize stations may share the same resource; each has its own queue.

Link copied to clipboard
@Serializable
data class SeparateStationSpec(val name: String, val routing: RoutingSpec? = null)

A station that separates a batch back into its members.

Link copied to clipboard
@Serializable
data class SetupEntry(val fromType: Int, val toType: Int, val setupTime: Double)

A (fromType, toType) setup-time entry for a sequence-dependent setup matrix.

Link copied to clipboard
@Serializable
sealed class SetupSpec

A sequence-dependent setup (changeover) specification for a station.

Link copied to clipboard
@Serializable
data class SinkSpec(val name: String)

A disposal sink node.

Link copied to clipboard
@Serializable
data class SourceSpec(val name: String, val interArrivalTime: RVData, val timeUntilFirst: RVData? = null, val maxArrivals: Long = Long.MAX_VALUE, val entityClass: String? = null, val marking: String? = null, val routing: RoutingSpec? = null)

An arrival source.

Link copied to clipboard
class StationNetworkBuilder(spec: QueueingNetworkSpec, predicates: Map<String, QObjectPredicate> = emptyMap(), childFactories: Map<String, ChildFactoryIfc> = emptyMap(), childCounts: Map<String, ChildCountIfc> = emptyMap(), markings: Map<String, MarkingHookIfc> = emptyMap())

Builds a live StationNetwork from a QueueingNetworkSpec. The builder is the resolution half of the two-layer design: the spec is pure data, and this turns it into model elements parented to a supplied ModelElement, wiring routing by node name in a second pass so forward references resolve.

Link copied to clipboard
@Serializable
data class StationSpec(val name: String, val activityTime: RVData? = null, val capacity: Int = 1, val routing: RoutingSpec? = null, val capacitySchedule: CapacityScheduleSpec? = null, val failure: FailureSpec? = null, val setup: SetupSpec? = null)

A single-queue station.

Link copied to clipboard
@Serializable
data class TypeBranch(val type: Int, val to: String)

A by-type routing branch: instances of type go to to.