aivika-transformers-4.5: Transformers for the Aivika simulation library

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

Simulation.Aivika.Trans.Gate

Description

Tested with: GHC 8.0.1

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

Synopsis

Documentation

data Gate m Source #

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

newGate :: MonadDES m => Bool -> Simulation m (Gate m) Source #

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

newGateOpened :: MonadDES m => Simulation m (Gate m) Source #

Create a new initially open gate.

newGateClosed :: MonadDES m => Simulation m (Gate m) Source #

Create a new initially close gate.

openGate :: MonadDES m => Gate m -> Event m () Source #

Open the gate if it was closed.

closeGate :: MonadDES m => Gate m -> Event m () Source #

Close the gate if it was open.

gateOpened :: MonadDES m => Gate m -> Event m Bool Source #

Test whether the gate is open.

gateClosed :: MonadDES m => Gate m -> Event m Bool Source #

Test whether the gate is closed.

awaitGateOpened :: MonadDES m => Gate m -> Process m () Source #

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

awaitGateClosed :: MonadDES m => Gate m -> Process m () Source #

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

gateChanged_ :: MonadDES m => Gate m -> Signal m () Source #

Signal triggered when the state of the gate changes.