aivika-4.3.3: A multi-paradigm simulation library

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

Simulation.Aivika.Gate

Description

Tested with: GHC 7.10.1

The module defines a gate which can be either opened or closed.

Synopsis

Documentation

data Gate Source

Represents a gate, which can be either opened or closed.

newGate :: Bool -> Simulation Gate Source

Create a new gate, specifying whether the gate is initially open.

newGateOpened :: Simulation Gate Source

Create a new initially open gate.

newGateClosed :: Simulation Gate Source

Create a new initially close gate.

openGate :: Gate -> Event () Source

Open the gate if it was closed.

closeGate :: Gate -> Event () Source

Close the gate if it was open.

gateOpened :: Gate -> Event Bool Source

Test whether the gate is open.

gateClosed :: Gate -> Event Bool Source

Test whether the gate is closed.

awaitGateOpened :: Gate -> Process () Source

Await the gate to be opened if required. If the gate is already open then the computation returns immediately.

awaitGateClosed :: Gate -> Process () Source

Await the gate to be closed if required. If the gate is already closed then the computation returns immediately.

gateChanged_ :: Gate -> Signal () Source

Signal triggered when the state of the gate changes.