aivika-5.7: A multi-method simulation library

CopyrightCopyright (c) 2009-2017 David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Simulation.Aivika.Channel

Contents

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

Category * Channel Source # 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat 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.