aivika-5.3: A multi-method simulation library

Simulation.Aivika.Channel

Description

Tested with: GHC 8.0.1

The module defines a channel that transforms one Signal to another within the Composite computation.

Synopsis

# Channel Computation

newtype Channel a b Source #

It allows representing a signal transformation.

Constructors

 Channel FieldsrunChannel :: Signal a -> Composite (Signal b)Run the channel transform.

Instances

 Source # Methodsid :: cat a a #(.) :: cat b c -> cat a b -> cat a c #

# Delay Channel

Arguments

 :: Double the delay -> Channel a a the delay channel

Return a delayed signal.

This is actually the delaySignal function wrapped in the Channel type.

Arguments

 :: Event Double the delay -> Channel a a the delay channel

Like delayChannel, but it re-computes the delay each time.

This is actually the delaySignalM function wrapped in the Channel type.

# Sinking Signal

sinkSignal :: Signal a -> Composite () Source #

Sink the signal. It returns a computation that subscribes to the signal and then ignores the received data. The resulting computation can be a moving force to simulate the whole system of the interconnected signals and channels.

# Debugging

traceChannel :: String -> Channel a b -> Channel a b Source #

Show the debug message with the current simulation time, when emitting the output signal.