MatchNode

Combines entities from a main input and a side input into a single output. Each main entity is matched with a corresponding side entity using the combiner function. The node remains ready only when the side input is ready.

Parameters

MainInputT

the type of main input entities

SideInputT

the type of side input entities

OutputT

the type of combined output entities

ChannelT

the channel type (Push or Pull)

label

the name of this node

mainSource

the main input channel from which entities are received

sideSource

the side input channel from which entities are pulled

destination

the output channel where combined entities are sent

combiner

the function that combines main and side entities into output entities

Constructors

Link copied to clipboard
constructor(label: String, mainSource: InputChannel<MainInputT, ChannelT>, sideSource: PullInputChannel<SideInputT>, destination: OutputChannel<OutputT, ChannelT>, combiner: (MainInputT, SideInputT) -> OutputT)

Properties

Link copied to clipboard
override val incoming: List<InputChannel<*, *>>
Link copied to clipboard
Link copied to clipboard
override val outgoing: List<OutputChannel<*, *>>
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
context(_: Simulator)
open override fun isReady(): Boolean

The node is ready only when the side source has data available.

Link copied to clipboard
open override fun onMatch(callback: context(Simulator) (MainInputT, SideInputT, OutputT) -> Unit)

Registers a callback to be invoked when entities are matched and combined.

Link copied to clipboard
context(_: Simulator)
open override fun onStart()

Initializes readiness state on simulation start.

Link copied to clipboard
context(_: Simulator)
open override fun process(input: MainInputT): OutputT

Combines a main input entity with a side input entity using the provided combiner function.

Link copied to clipboard
Link copied to clipboard
open override fun toString(): String