GenericPolicy

abstract class GenericPolicy<ChannelT>

Generic base class for simple routing policies used in both fork and join nodes. Provides a unified interface for channel selection and availability tracking that can be adapted to either push (fork) or pull (join) semantics.

Parameters

ChannelT

the type of channel managed by the policy (either PushOutputChannel for forks or PullInputChannel for joins)

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
abstract fun allUnavailable(): Boolean

Checks if all channels are unavailable.

Link copied to clipboard
context(_: Simulator)
abstract fun initialize(channels: List<ChannelT>)

Initializes the policy with the list of channels it will manage.

Link copied to clipboard
abstract fun onChannelAvailable(channel: ChannelT)

Called when a channel becomes available (open for fork, ready for join).

Link copied to clipboard
abstract fun onChannelUnavailable(channel: ChannelT)

Called when a channel becomes unavailable (closed for fork, not ready for join).

Link copied to clipboard
abstract fun selectChannel(): ChannelT

Selects a channel from the available channels.