aivika-gpss-0.6: GPSS-like DSL for Aivika

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

Simulation.Aivika.Trans.GPSS.Storage

Contents

Description

Tested with: GHC 8.0.1

This module defines the GPSS Storage entity.

Synopsis

Storage Type

data Storage m Source #

Represents a GPSS Storage entity.

Instances

MonadDES m => Eq (Storage m) Source # 

Methods

(==) :: Storage m -> Storage m -> Bool #

(/=) :: Storage m -> Storage m -> Bool #

Creating Storage

newStorage :: MonadDES m => Int -> Event m (Storage m) Source #

Create a new storage by the specified capacity.

Storage Properties

storageCapacity :: Storage m -> Int Source #

Return the storage capacity.

storageEmpty :: MonadDES m => Storage m -> Event m Bool Source #

Whether the storage is empty, i.e. completely unused.

storageFull :: MonadDES m => Storage m -> Event m Bool Source #

Whether the storage is full, i.e. completely used.

storageContent :: MonadDES m => Storage m -> Event m Int Source #

Return the current storage content available for use.

storageContentStats :: MonadDES m => Storage m -> Event m (TimingStats Int) Source #

Return the statistics of the storage content available for use.

storageUseCount :: MonadDES m => Storage m -> Event m Int Source #

Return the total use count of the storage.

storageUsedContent :: MonadDES m => Storage m -> Event m Int Source #

Return the total used content of the storage.

storageUtilisationCount :: MonadDES m => Storage m -> Event m Int Source #

Return the current utilisation count of the storage.

storageUtilisationCountStats :: MonadDES m => Storage m -> Event m (TimingStats Int) Source #

Return the statistics for the utilisation count of the storage.

storageQueueCount :: MonadDES m => Storage m -> Event m Int Source #

Return the current queue length of the storage.

storageQueueCountStats :: MonadDES m => Storage m -> Event m (TimingStats Int) Source #

Return the statistics for the queue length of the storage.

storageTotalWaitTime :: MonadDES m => Storage m -> Event m Double Source #

Return the total wait time of the storage.

storageWaitTime :: MonadDES m => Storage m -> Event m (SamplingStats Double) Source #

Return the statistics for the wait time of the storage.

storageAverageHoldingTime :: MonadDES m => Storage m -> Event m Double Source #

Return the average holding time per unit.

Entering-Leaving Storage

enterStorage Source #

Arguments

:: MonadDES m 
=> Storage m

the requested storage

-> Transact m a

a transact that makes the request

-> Int

the content decrement

-> Process m () 

Enter the storage.

leaveStorage Source #

Arguments

:: MonadDES m 
=> Storage m

the storage to leave

-> Int

the content increment

-> Process m () 

Leave the storage.

leaveStorageWithinEvent Source #

Arguments

:: MonadDES m 
=> Storage m

the storage to leave

-> Int

the content increment

-> Event m () 

Leave the storage.

Statistics Reset

resetStorage :: MonadDES m => Storage m -> Event m () Source #

Reset the statistics.

Signals

storageContentChanged :: MonadDES m => Storage m -> Signal m Int Source #

Signal triggered when the storageContent property changes.

storageContentChanged_ :: MonadDES m => Storage m -> Signal m () Source #

Signal triggered when the storageContent property changes.

storageUseCountChanged :: MonadDES m => Storage m -> Signal m Int Source #

Signal triggered when the storageUseCount property changes.

storageUseCountChanged_ :: MonadDES m => Storage m -> Signal m () Source #

Signal triggered when the storageUseCount property changes.

storageUsedContentChanged :: MonadDES m => Storage m -> Signal m Int Source #

Signal triggered when the storageUsedContent property changes.

storageUsedContentChanged_ :: MonadDES m => Storage m -> Signal m () Source #

Signal triggered when the storageUsedContent property changes.

storageUtilisationCountChanged :: MonadDES m => Storage m -> Signal m Int Source #

Signal triggered when the storageUtilisationCount property changes.

storageUtilisationCountChanged_ :: MonadDES m => Storage m -> Signal m () Source #

Signal triggered when the storageUtilisationCount property changes.

storageQueueCountChanged :: MonadDES m => Storage m -> Signal m Int Source #

Signal triggered when the storageQueueCount property changes.

storageQueueCountChanged_ :: MonadDES m => Storage m -> Signal m () Source #

Signal triggered when the storageQueueCount property changes.

storageWaitTimeChanged :: MonadDES m => Storage m -> Signal m (SamplingStats Double) Source #

Signal triggered when the storageTotalWaitTime and storageWaitTime properties change.

storageWaitTimeChanged_ :: MonadDES m => Storage m -> Signal m () Source #

Signal triggered when the storageTotalWaitTime and storageWaitTime properties change.

storageChanged_ :: MonadDES m => Storage m -> Signal m () Source #

Signal triggered when one of the storage counters changes.