aivika-gpss-0.6.1: 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.GPSS.Queue

Contents

Description

Tested with: GHC 8.0.2

This module defines a GPSS queue entity.

Synopsis

Queue Types

data Queue Source #

Represents the queue entity.

Instances

Eq Queue Source # 

Methods

(==) :: Queue -> Queue -> Bool #

(/=) :: Queue -> Queue -> Bool #

Hashable Queue Source # 

Methods

hashWithSalt :: Int -> Queue -> Int #

hash :: Queue -> Int #

data QueueEntry Source #

The information about queue entry.

Constructors

QueueEntry 

Fields

Creating Queue

newQueue :: Event Queue Source #

Create a new queue.

Queue Properties and Activities

queueNull :: Queue -> Event Bool Source #

Test whether the queue is empty.

See also queueNullChanged and queueNullChanged_.

queueContent :: Queue -> Event Int Source #

Return the current queue content.

See also queueContentStats, queueContentChanged and queueContentChanged_.

queueContentStats :: Queue -> Event (TimingStats Int) Source #

Return the queue content statistics.

enqueueCount :: Queue -> Event Int Source #

Return the total number of input items that were enqueued.

See also enqueueCountChanged and enqueueCountChanged_.

enqueueZeroEntryCount :: Queue -> Event Int Source #

Return the total number of zero entry items.

See also enqueueZeroEntryCountChanged and enqueueZeroEntryCountChanged_.

queueWaitTime :: Queue -> Event (SamplingStats Double) Source #

Return the wait (or residence) time.

See also queueWaitTimeChanged and queueWaitTimeChanged_.

queueNonZeroEntryWaitTime :: Queue -> Event (SamplingStats Double) Source #

Return the wait (or residence) time excluding zero entries.

See also queueNonZeroEntryWaitTimeChanged and queueNonZeroEntryWaitTimeChanged_.

queueRate :: Queue -> Event Double Source #

Return a long-term average queue rate calculated as the average queue content divided by the average wait time.

See also queueRateChanged and queueRateChanged_.

Dequeuing and Enqueuing

enqueue Source #

Arguments

:: Queue

the queue

-> Transact a

the item to be enqueued

-> Int

the content increment

-> Event () 

Enqueue the item.

dequeue Source #

Arguments

:: Queue

the queue

-> Transact a

the item to be dequeued

-> Int

the content decrement

-> Event () 

Dequeue the item.

Statistics Reset

resetQueue :: Queue -> Event () Source #

Reset the statistics.

Derived Signals for Properties

queueNullChanged :: Queue -> Signal Bool Source #

Signal when the queueNull property value has changed.

queueNullChanged_ :: Queue -> Signal () Source #

Signal when the queueNull property value has changed.

queueContentChanged :: Queue -> Signal Int Source #

Signal when the queueContent property value has changed.

queueContentChanged_ :: Queue -> Signal () Source #

Signal when the queueContent property value has changed.

enqueueCountChanged :: Queue -> Signal Int Source #

Signal when the enqueueCount property value has changed.

enqueueCountChanged_ :: Queue -> Signal () Source #

Signal when the enqueueCount property value has changed.

enqueueZeroEntryCountChanged :: Queue -> Signal Int Source #

Signal when the enqueueZeroEntryCount property value has changed.

enqueueZeroEntryCountChanged_ :: Queue -> Signal () Source #

Signal when the enqueueZeroEntryCount property value has changed.

queueWaitTimeChanged :: Queue -> Signal (SamplingStats Double) Source #

Signal when the queueWaitTime property value has changed.

queueWaitTimeChanged_ :: Queue -> Signal () Source #

Signal when the queueWaitTime property value has changed.

queueNonZeroEntryWaitTimeChanged_ :: Queue -> Signal () Source #

Signal when the queueNonZeroEntryWaitTime property value has changed.

queueRateChanged :: Queue -> Signal Double Source #

Signal when the queueRate property value has changed.

queueRateChanged_ :: Queue -> Signal () Source #

Signal when the queueRate property value has changed.

Basic Signals

enqueued :: Queue -> Signal () Source #

Return a signal that notifies when enqueuing an item.

dequeued :: Queue -> Signal () Source #

Return a signal that notifies when the dequeuing the item.

Overall Signal

queueChanged_ :: Queue -> Signal () Source #

Signal whenever any property of the queue changes.

The property must have the corresponded signal. There are also characteristics similar to the properties but that have no signals. As a rule, such characteristics already depend on the simulation time and therefore they may change at any time point.