aivika-6.1: A multi-method simulation library
CopyrightCopyright (c) 2009-2017 David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

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 

Fields

Instances

Instances details
Category Channel Source # 
Instance details

Defined in Simulation.Aivika.Channel

Methods

id :: forall (a :: k). Channel a a #

(.) :: forall (b :: k) (c :: k) (a :: k). Channel b c -> Channel a b -> Channel a c #

Delay Channel

delayChannel Source #

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.

delayChannelM Source #

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.