Copyright | Copyright (c) 2017 David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Tested with: GHC 8.0.2
This module defines a GPSS queue entity.
Synopsis
- data Queue m
- data QueueEntry m = QueueEntry {
- entryQueue :: Queue m
- entryEnqueueTime :: Double
- newQueue :: MonadDES m => Event m (Queue m)
- queueNull :: MonadDES m => Queue m -> Event m Bool
- queueContent :: MonadDES m => Queue m -> Event m Int
- queueContentStats :: MonadDES m => Queue m -> Event m (TimingStats Int)
- enqueueCount :: MonadDES m => Queue m -> Event m Int
- enqueueZeroEntryCount :: MonadDES m => Queue m -> Event m Int
- queueWaitTime :: MonadDES m => Queue m -> Event m (SamplingStats Double)
- queueNonZeroEntryWaitTime :: MonadDES m => Queue m -> Event m (SamplingStats Double)
- queueRate :: MonadDES m => Queue m -> Event m Double
- enqueue :: MonadDES m => Queue m -> Transact m a -> Int -> Event m ()
- dequeue :: MonadDES m => Queue m -> Transact m a -> Int -> Event m ()
- resetQueue :: MonadDES m => Queue m -> Event m ()
- queueNullChanged :: MonadDES m => Queue m -> Signal m Bool
- queueNullChanged_ :: MonadDES m => Queue m -> Signal m ()
- queueContentChanged :: MonadDES m => Queue m -> Signal m Int
- queueContentChanged_ :: MonadDES m => Queue m -> Signal m ()
- enqueueCountChanged :: MonadDES m => Queue m -> Signal m Int
- enqueueCountChanged_ :: MonadDES m => Queue m -> Signal m ()
- enqueueZeroEntryCountChanged :: MonadDES m => Queue m -> Signal m Int
- enqueueZeroEntryCountChanged_ :: MonadDES m => Queue m -> Signal m ()
- queueWaitTimeChanged :: MonadDES m => Queue m -> Signal m (SamplingStats Double)
- queueWaitTimeChanged_ :: MonadDES m => Queue m -> Signal m ()
- queueNonZeroEntryWaitTimeChanged :: MonadDES m => Queue m -> Signal m (SamplingStats Double)
- queueNonZeroEntryWaitTimeChanged_ :: MonadDES m => Queue m -> Signal m ()
- queueRateChanged :: MonadDES m => Queue m -> Signal m Double
- queueRateChanged_ :: MonadDES m => Queue m -> Signal m ()
- enqueued :: MonadDES m => Queue m -> Signal m ()
- dequeued :: MonadDES m => Queue m -> Signal m ()
- queueChanged_ :: MonadDES m => Queue m -> Signal m ()
Queue Types
Represents the queue entity.
Instances
MonadDES m => Eq (Queue m) Source # | |
Hashable (Queue m) Source # | |
Defined in Simulation.Aivika.Trans.GPSS.Queue | |
MonadDES m => ResultProvider (Queue m) m Source # | |
Defined in Simulation.Aivika.Trans.GPSS.Results resultSource :: ResultName -> ResultDescription -> Queue m -> ResultSource m # resultSource3 :: ResultName -> ResultDescription -> ResultDescription -> Queue m -> ResultSource m # resultSource' :: ResultName -> [ResultName] -> ResultId -> [ResultId] -> Queue m -> ResultSource m # |
data QueueEntry m Source #
The information about queue entry.
QueueEntry | |
|
Instances
MonadDES m => Eq (QueueEntry m) Source # | |
Defined in Simulation.Aivika.Trans.GPSS.Queue (==) :: QueueEntry m -> QueueEntry m -> Bool # (/=) :: QueueEntry m -> QueueEntry m -> Bool # |
Creating Queue
Queue Properties and Activities
queueNull :: MonadDES m => Queue m -> Event m Bool Source #
Test whether the queue is empty.
See also queueNullChanged
and queueNullChanged_
.
queueContent :: MonadDES m => Queue m -> Event m Int Source #
Return the current queue content.
See also queueContentStats
, queueContentChanged
and queueContentChanged_
.
queueContentStats :: MonadDES m => Queue m -> Event m (TimingStats Int) Source #
Return the queue content statistics.
enqueueCount :: MonadDES m => Queue m -> Event m Int Source #
Return the total number of input items that were enqueued.
See also enqueueCountChanged
and enqueueCountChanged_
.
enqueueZeroEntryCount :: MonadDES m => Queue m -> Event m Int Source #
Return the total number of zero entry items.
See also enqueueZeroEntryCountChanged
and enqueueZeroEntryCountChanged_
.
queueWaitTime :: MonadDES m => Queue m -> Event m (SamplingStats Double) Source #
Return the wait (or residence) time.
See also queueWaitTimeChanged
and queueWaitTimeChanged_
.
queueNonZeroEntryWaitTime :: MonadDES m => Queue m -> Event m (SamplingStats Double) Source #
Return the wait (or residence) time excluding zero entries.
See also queueNonZeroEntryWaitTimeChanged
and queueNonZeroEntryWaitTimeChanged_
.
queueRate :: MonadDES m => Queue m -> Event m Double Source #
Return a long-term average queue rate calculated as the average queue size divided by the average wait time.
See also queueRateChanged
and queueRateChanged_
.
Dequeuing and Enqueuing
:: MonadDES m | |
=> Queue m | the queue |
-> Transact m a | the item to be enqueued |
-> Int | the content increment |
-> Event m () |
Enqueue the item.
:: MonadDES m | |
=> Queue m | the queue |
-> Transact m a | the item to be dequeued |
-> Int | the content decrement |
-> Event m () |
Dequeue the item.
Statistics Reset
Derived Signals for Properties
queueNullChanged :: MonadDES m => Queue m -> Signal m Bool Source #
Signal when the queueNull
property value has changed.
queueNullChanged_ :: MonadDES m => Queue m -> Signal m () Source #
Signal when the queueNull
property value has changed.
queueContentChanged :: MonadDES m => Queue m -> Signal m Int Source #
Signal when the queueContent
property value has changed.
queueContentChanged_ :: MonadDES m => Queue m -> Signal m () Source #
Signal when the queueContent
property value has changed.
enqueueCountChanged :: MonadDES m => Queue m -> Signal m Int Source #
Signal when the enqueueCount
property value has changed.
enqueueCountChanged_ :: MonadDES m => Queue m -> Signal m () Source #
Signal when the enqueueCount
property value has changed.
enqueueZeroEntryCountChanged :: MonadDES m => Queue m -> Signal m Int Source #
Signal when the enqueueZeroEntryCount
property value has changed.
enqueueZeroEntryCountChanged_ :: MonadDES m => Queue m -> Signal m () Source #
Signal when the enqueueZeroEntryCount
property value has changed.
queueWaitTimeChanged :: MonadDES m => Queue m -> Signal m (SamplingStats Double) Source #
Signal when the queueWaitTime
property value has changed.
queueWaitTimeChanged_ :: MonadDES m => Queue m -> Signal m () Source #
Signal when the queueWaitTime
property value has changed.
queueNonZeroEntryWaitTimeChanged :: MonadDES m => Queue m -> Signal m (SamplingStats Double) Source #
Signal when the queueNonZeroEntryWaitTime
property value has changed.
queueNonZeroEntryWaitTimeChanged_ :: MonadDES m => Queue m -> Signal m () Source #
Signal when the queueNonZeroEntryWaitTime
property value has changed.
queueRateChanged :: MonadDES m => Queue m -> Signal m Double Source #
Signal when the queueRate
property value has changed.
queueRateChanged_ :: MonadDES m => Queue m -> Signal m () Source #
Signal when the queueRate
property value has changed.
Basic Signals
enqueued :: MonadDES m => Queue m -> Signal m () Source #
Return a signal that notifies when enqueuing an item.
dequeued :: MonadDES m => Queue m -> Signal m () Source #
Return a signal that notifies when the dequeuing the item.
Overall Signal
queueChanged_ :: MonadDES m => Queue m -> Signal m () 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.