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
- data QueueEntry = QueueEntry {}
- newQueue :: Event Queue
- queueNull :: Queue -> Event Bool
- queueContent :: Queue -> Event Int
- queueContentStats :: Queue -> Event (TimingStats Int)
- enqueueCount :: Queue -> Event Int
- enqueueZeroEntryCount :: Queue -> Event Int
- queueWaitTime :: Queue -> Event (SamplingStats Double)
- queueNonZeroEntryWaitTime :: Queue -> Event (SamplingStats Double)
- queueRate :: Queue -> Event Double
- enqueue :: Queue -> Transact a -> Int -> Event ()
- dequeue :: Queue -> Transact a -> Int -> Event ()
- resetQueue :: Queue -> Event ()
- queueNullChanged :: Queue -> Signal Bool
- queueNullChanged_ :: Queue -> Signal ()
- queueContentChanged :: Queue -> Signal Int
- queueContentChanged_ :: Queue -> Signal ()
- enqueueCountChanged :: Queue -> Signal Int
- enqueueCountChanged_ :: Queue -> Signal ()
- enqueueZeroEntryCountChanged :: Queue -> Signal Int
- enqueueZeroEntryCountChanged_ :: Queue -> Signal ()
- queueWaitTimeChanged :: Queue -> Signal (SamplingStats Double)
- queueWaitTimeChanged_ :: Queue -> Signal ()
- queueNonZeroEntryWaitTimeChanged :: Queue -> Signal (SamplingStats Double)
- queueNonZeroEntryWaitTimeChanged_ :: Queue -> Signal ()
- queueRateChanged :: Queue -> Signal Double
- queueRateChanged_ :: Queue -> Signal ()
- enqueued :: Queue -> Signal ()
- dequeued :: Queue -> Signal ()
- queueChanged_ :: Queue -> Signal ()
Queue Types
Represents the queue entity.
Instances
Eq Queue Source # | |
ResultProvider Queue Source # | |
Defined in Simulation.Aivika.GPSS.Results resultSource :: ResultName -> ResultDescription -> Queue -> ResultSource # resultSource3 :: ResultName -> ResultDescription -> ResultDescription -> Queue -> ResultSource # resultSource' :: ResultName -> [ResultName] -> ResultId -> [ResultId] -> Queue -> ResultSource # | |
Hashable Queue Source # | |
Defined in Simulation.Aivika.GPSS.Queue |
data QueueEntry Source #
The information about queue entry.
QueueEntry | |
|
Instances
Eq QueueEntry Source # | |
Defined in Simulation.Aivika.GPSS.Queue (==) :: QueueEntry -> QueueEntry -> Bool # (/=) :: QueueEntry -> QueueEntry -> Bool # |
Creating 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 the item.
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 (SamplingStats Double) Source #
Signal when the queueNonZeroEntryWaitTime
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
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.