Package-level declarations

Types

Link copied to clipboard

NodeBuilder joining two non-adjacent parts of a queue network, or spanning two otherwise separate queue networks, together.

Link copied to clipboard
sealed interface MetricsBuilderScope

Keeps track of metrics requested by the metrics DSL system, to be installed into a given scenario, and abstracts away explicit metric creation, tag walking, and metrics object handling

Link copied to clipboard
sealed interface NodeBuilder<out ItemT, ChannelT : ChannelType<ChannelT>>

Interface for objects that can be built upon by the DSL functions.

Link copied to clipboard

A reference to an output channel, which can then be connected to other nodes directly

Link copied to clipboard

NodeBuilder following on immediately from a node in the chain, usually representing the traditional left-right flow of nodes in the queue network

Link copied to clipboard
sealed interface ScenarioBuilderScope

Keeps track of the scenario being built by the DSL system, and abstracts explicit node and connection handling required to construct the port otherwise

Functions

Link copied to clipboard

Starts the builder chain, from which more nodes can be attached using the DSL. Vehicles generated by the arrivals node will be pushed to the next node in the chain.

Link copied to clipboard

Starts the builder chain, from which more nodes can be attached using the DSL. Vehicles generated by the arrivals node will be pushed to the next node in the chain.

Link copied to clipboard
fun buildScenario(builder: context(ScenarioBuilderScope) () -> Unit): Scenario

Builds a scenario using the DSL system.

Link copied to clipboard

Creates a new connection generic of whether it will be push or pull

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Runs saver to the immediately prior node inline in the builder chain, and allows the builder chain to continue after this function.

Link copied to clipboard

Tags the immediate previous node in the builder chain with the tag supplied.

Adds to the list of tags, a tag for the immediate previous node in the builder chain.

Link copied to clipboard
fun <T> NodeBuilder<T, *>.thenBoundedQueue(label: String, capacity: Int, policy: QueuePolicy<T> = FIFOQueuePolicy()): RegularNodeBuilder<BoundedQueueNode<T>, T, ChannelType.Pull>

Attaches a buffered queue (of limited max capacity) into the builder chain, which can then be continued after this call. If a bounded queue reaches maximum capacity, the node will not accept anymore pushes, or will not pull from the upstream node, until something has left the bounded queue

Link copied to clipboard

Ends the current NodeBuilder chain, and all objects processed by the nodes in the chain will be fed to the opposite end of the connection supplied.

Link copied to clipboard

Attaches a dead end node and terminates the builder chain. This represents a node whose push input channel is always closed, or never pulls.

Link copied to clipboard

Attaches a delay node to the builder chain, applying a delay to all vehicles passing through the node. Vehicles that has passed through the delay node are pushed to the next node in the chain.

Link copied to clipboard

Attaches a fork node to the builder chain, which splits the current builder chain to numLanes parallel lanes, whose behaviour is determined by laneAction. The subsequent lanes will commence with a pull input connection from the fork.

fun <ItemT, R> NodeBuilder<ItemT, ChannelType.Push>.thenFork(label: String, lanes: List<(RegularNodeBuilder<PushForkNode<ItemT>, ItemT, ChannelType.Push>) -> R>, policy: ForkPolicy<ItemT> = forkPolicy(RandomPolicy())): List<R>
fun <ItemT, R> NodeBuilder<ItemT, ChannelType.Push>.thenFork(label: String, numLanes: Int, policy: ForkPolicy<ItemT> = forkPolicy(RandomPolicy()), laneAction: (Int, RegularNodeBuilder<PushForkNode<ItemT>, ItemT, ChannelType.Push>) -> R): List<R>

Attaches a fork node to the builder chain, which splits the current builder chain to numLanes parallel lanes, whose behaviour is determined by laneAction. The subsequent lanes will commence with a push input connection from the fork.

Link copied to clipboard

Attaches a join node to the builder chain to join together a list of builder chains (with push output connections). The subsequent connection out of the join node will be a push connection.

fun <T> List<NodeBuilder<T, ChannelType.Pull>>.thenJoin(label: String, policy: JoinPolicy<T> = joinPolicy(RandomPolicy())): RegularNodeBuilder<PullJoinNode<T>, T, ChannelType.Pull>

Attaches a join node to the builder chain to join together a list of builder chains (with pull output connections). The subsequent connection out of the join node will be a pull connection.

Link copied to clipboard

Attaches a loss sink, a special loss node that is hidden from certain metrics, to be used to simulate loss / dropped items

Link copied to clipboard

Attaches a match node into the builder chain, which can then be continued after this call.

Link copied to clipboard

Ends the current NodeBuilder chain, and all objects processed by the nodes in the chain will be fed to the destination of the OutputRef provided. For compound node, outputRef connects the internal output of the builder chain to the output of the compound node in the main flow

Link copied to clipboard

Attaches a pump node to the builder chain, converting the builder chain from a pull output to a push output.

Link copied to clipboard
fun <ItemT, R> NodeBuilder<ItemT, *>.thenPushFork(label: String, lanes: List<(RegularNodeBuilder<PushForkNode<ItemT>, ItemT, ChannelType.Push>) -> R>, policy: ForkPolicy<ItemT> = forkPolicy(RandomPolicy())): List<R>
fun <ItemT, R> NodeBuilder<ItemT, *>.thenPushFork(label: String, numLanes: Int, policy: ForkPolicy<ItemT> = forkPolicy(RandomPolicy()), laneAction: (Int, RegularNodeBuilder<PushForkNode<ItemT>, ItemT, ChannelType.Push>) -> R): List<R>

Attaches a fork node to the builder chain, which splits the current builder chain to numLanes parallel lanes, whose behaviour is determined by laneAction. The subsequent lanes will commence with a push input connection from the fork.

Link copied to clipboard

Attaches a join node to the builder chain to join together a list of builder chains. The subsequent connection out of the join node will be a push connection.

Link copied to clipboard
fun <T> NodeBuilder<T, *>.thenQueue(label: String, policy: QueuePolicy<T> = FIFOQueuePolicy()): RegularNodeBuilder<QueueNode<T>, T, ChannelType.Pull>

Attaches an unbuffered queue (infinite capacity) into the builder chain, which can then be continued after this call.

Link copied to clipboard
fun <T> NodeBuilder<T, *>.thenService(label: String, delayProvider: DelayProvider, numServers: Int = 1): RegularNodeBuilder<ServiceNode<T>, T, ChannelType.Push>

Attaches a service node into the builder chain, which can then be continued after this call.

Link copied to clipboard
fun <T> NodeBuilder<T, *>.thenSink(label: String): SinkNode<T>

Attaches a sink and terminates the builder chain.

Link copied to clipboard

Attaches a split node into the builder chain. Then the different pathways for the splitter node outputs are defined. Split node simulates a location where one item splits into two items, such as

Link copied to clipboard

Used inline with the NodeBuilder DSL system.

Link copied to clipboard
context(metricsScope: MetricsBuilderScope)
inline fun <NodeT> trackAll(metricFactory: MetricFactory<NodeT>)

Tracks all applicable nodes in the scenario stored in the contextual MetricsBuilderScope with the metric factory provided.

Link copied to clipboard
context(metricsScope: MetricsBuilderScope)
fun trackGlobal(metricFactory: GlobalMetricFactory)

Tracks global metrics in the scenario stored in the contextual MetricsBuilderScope with the metric factory provided.

Link copied to clipboard

Attaches the metrics DSL calls within builder to this scenario