Copyright | Copyright (c) 2009-2016 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.1

This module defines a queue that can use the specified strategies. So, having only
the `FCFS`

, `LCFS`

, `SIRO`

and `StaticPriorities`

strategies, you can build
4 x 4 x 4 = 64 different types of the queue, each of them will have its own
behaviour.

- type FCFSQueue m a = Queue m FCFS FCFS FCFS a
- type LCFSQueue m a = Queue m FCFS LCFS FCFS a
- type SIROQueue m a = Queue m FCFS SIRO FCFS a
- type PriorityQueue m a = Queue m FCFS StaticPriorities FCFS a
- data Queue m si sm so a
- newFCFSQueue :: MonadDES m => Int -> Event m (FCFSQueue m a)
- newLCFSQueue :: MonadDES m => Int -> Event m (LCFSQueue m a)
- newSIROQueue :: (MonadDES m, QueueStrategy m SIRO) => Int -> Event m (SIROQueue m a)
- newPriorityQueue :: (MonadDES m, QueueStrategy m StaticPriorities) => Int -> Event m (PriorityQueue m a)
- newQueue :: (MonadDES m, QueueStrategy m si, QueueStrategy m sm, QueueStrategy m so) => si -> sm -> so -> Int -> Event m (Queue m si sm so a)
- enqueueStrategy :: Queue m si sm so a -> si
- enqueueStoringStrategy :: Queue m si sm so a -> sm
- dequeueStrategy :: Queue m si sm so a -> so
- queueNull :: MonadDES m => Queue m si sm so a -> Event m Bool
- queueFull :: MonadDES m => Queue m si sm so a -> Event m Bool
- queueMaxCount :: Queue m si sm so a -> Int
- queueCount :: MonadDES m => Queue m si sm so a -> Event m Int
- queueCountStats :: MonadDES m => Queue m si sm so a -> Event m (TimingStats Int)
- enqueueCount :: MonadDES m => Queue m si sm so a -> Event m Int
- enqueueLostCount :: MonadDES m => Queue m si sm so a -> Event m Int
- enqueueStoreCount :: MonadDES m => Queue m si sm so a -> Event m Int
- dequeueCount :: MonadDES m => Queue m si sm so a -> Event m Int
- dequeueExtractCount :: MonadDES m => Queue m si sm so a -> Event m Int
- queueLoadFactor :: MonadDES m => Queue m si sm so a -> Event m Double
- enqueueRate :: MonadDES m => Queue m si sm so a -> Event m Double
- enqueueStoreRate :: MonadDES m => Queue m si sm so a -> Event m Double
- dequeueRate :: MonadDES m => Queue m si sm so a -> Event m Double
- dequeueExtractRate :: MonadDES m => Queue m si sm so a -> Event m Double
- queueWaitTime :: MonadDES m => Queue m si sm so a -> Event m (SamplingStats Double)
- queueTotalWaitTime :: MonadDES m => Queue m si sm so a -> Event m (SamplingStats Double)
- enqueueWaitTime :: MonadDES m => Queue m si sm so a -> Event m (SamplingStats Double)
- dequeueWaitTime :: MonadDES m => Queue m si sm so a -> Event m (SamplingStats Double)
- queueRate :: MonadDES m => Queue m si sm so a -> Event m Double
- dequeue :: (MonadDES m, DequeueStrategy m si, DequeueStrategy m sm, EnqueueStrategy m so) => Queue m si sm so a -> Process m a
- dequeueWithOutputPriority :: (MonadDES m, DequeueStrategy m si, DequeueStrategy m sm, PriorityQueueStrategy m so po) => Queue m si sm so a -> po -> Process m a
- tryDequeue :: (MonadDES m, DequeueStrategy m si, DequeueStrategy m sm) => Queue m si sm so a -> Event m (Maybe a)
- enqueue :: (MonadDES m, EnqueueStrategy m si, EnqueueStrategy m sm, DequeueStrategy m so) => Queue m si sm so a -> a -> Process m ()
- enqueueWithInputPriority :: (MonadDES m, PriorityQueueStrategy m si pi, EnqueueStrategy m sm, DequeueStrategy m so) => Queue m si sm so a -> pi -> a -> Process m ()
- enqueueWithStoringPriority :: (MonadDES m, EnqueueStrategy m si, PriorityQueueStrategy m sm pm, DequeueStrategy m so) => Queue m si sm so a -> pm -> a -> Process m ()
- enqueueWithInputStoringPriorities :: (MonadDES m, PriorityQueueStrategy m si pi, PriorityQueueStrategy m sm pm, DequeueStrategy m so) => Queue m si sm so a -> pi -> pm -> a -> Process m ()
- tryEnqueue :: (MonadDES m, EnqueueStrategy m sm, DequeueStrategy m so) => Queue m si sm so a -> a -> Event m Bool
- tryEnqueueWithStoringPriority :: (MonadDES m, PriorityQueueStrategy m sm pm, DequeueStrategy m so) => Queue m si sm so a -> pm -> a -> Event m Bool
- enqueueOrLost :: (MonadDES m, EnqueueStrategy m sm, DequeueStrategy m so) => Queue m si sm so a -> a -> Event m Bool
- enqueueOrLost_ :: (MonadDES m, EnqueueStrategy m sm, DequeueStrategy m so) => Queue m si sm so a -> a -> Event m ()
- enqueueWithStoringPriorityOrLost :: (MonadDES m, PriorityQueueStrategy m sm pm, DequeueStrategy m so) => Queue m si sm so a -> pm -> a -> Event m Bool
- enqueueWithStoringPriorityOrLost_ :: (MonadDES m, PriorityQueueStrategy m sm pm, DequeueStrategy m so) => Queue m si sm so a -> pm -> a -> Event m ()
- queueDelete :: (MonadDES m, Eq a, DequeueStrategy m si, DeletingQueueStrategy m sm, DequeueStrategy m so) => Queue m si sm so a -> a -> Event m Bool
- queueDelete_ :: (MonadDES m, Eq a, DequeueStrategy m si, DeletingQueueStrategy m sm, DequeueStrategy m so) => Queue m si sm so a -> a -> Event m ()
- queueDeleteBy :: (MonadDES m, DequeueStrategy m si, DeletingQueueStrategy m sm, DequeueStrategy m so) => Queue m si sm so a -> (a -> Bool) -> Event m (Maybe a)
- queueDeleteBy_ :: (MonadDES m, DequeueStrategy m si, DeletingQueueStrategy m sm, DequeueStrategy m so) => Queue m si sm so a -> (a -> Bool) -> Event m ()
- queueContains :: (MonadDES m, Eq a, DeletingQueueStrategy m sm) => Queue m si sm so a -> a -> Event m Bool
- queueContainsBy :: (MonadDES m, DeletingQueueStrategy m sm) => Queue m si sm so a -> (a -> Bool) -> Event m (Maybe a)
- clearQueue :: (MonadDES m, DequeueStrategy m si, DequeueStrategy m sm) => Queue m si sm so a -> Event m ()
- waitWhileFullQueue :: MonadDES m => Queue m si sm so a -> Process m ()
- queueSummary :: (MonadDES m, Show si, Show sm, Show so) => Queue m si sm so a -> Int -> Event m ShowS
- queueNullChanged :: MonadDES m => Queue m si sm so a -> Signal m Bool
- queueNullChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- queueFullChanged :: MonadDES m => Queue m si sm so a -> Signal m Bool
- queueFullChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- queueCountChanged :: MonadDES m => Queue m si sm so a -> Signal m Int
- queueCountChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- enqueueCountChanged :: MonadDES m => Queue m si sm so a -> Signal m Int
- enqueueCountChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- enqueueLostCountChanged :: MonadDES m => Queue m si sm so a -> Signal m Int
- enqueueLostCountChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- enqueueStoreCountChanged :: MonadDES m => Queue m si sm so a -> Signal m Int
- enqueueStoreCountChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- dequeueCountChanged :: MonadDES m => Queue m si sm so a -> Signal m Int
- dequeueCountChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- dequeueExtractCountChanged :: MonadDES m => Queue m si sm so a -> Signal m Int
- dequeueExtractCountChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- queueLoadFactorChanged :: MonadDES m => Queue m si sm so a -> Signal m Double
- queueLoadFactorChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- queueWaitTimeChanged :: MonadDES m => Queue m si sm so a -> Signal m (SamplingStats Double)
- queueWaitTimeChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- queueTotalWaitTimeChanged :: MonadDES m => Queue m si sm so a -> Signal m (SamplingStats Double)
- queueTotalWaitTimeChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- enqueueWaitTimeChanged :: MonadDES m => Queue m si sm so a -> Signal m (SamplingStats Double)
- enqueueWaitTimeChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- dequeueWaitTimeChanged :: MonadDES m => Queue m si sm so a -> Signal m (SamplingStats Double)
- dequeueWaitTimeChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- queueRateChanged :: MonadDES m => Queue m si sm so a -> Signal m Double
- queueRateChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()
- enqueueInitiated :: MonadDES m => Queue m si sm so a -> Signal m a
- enqueueStored :: MonadDES m => Queue m si sm so a -> Signal m a
- enqueueLost :: MonadDES m => Queue m si sm so a -> Signal m a
- dequeueRequested :: MonadDES m => Queue m si sm so a -> Signal m ()
- dequeueExtracted :: MonadDES m => Queue m si sm so a -> Signal m a
- queueChanged_ :: MonadDES m => Queue m si sm so a -> Signal m ()

# Queue Types

type FCFSQueue m a = Queue m FCFS FCFS FCFS a Source #

A type synonym for the ordinary FIFO queue also known as the FCFS (First Come - First Serviced) queue.

type LCFSQueue m a = Queue m FCFS LCFS FCFS a Source #

A type synonym for the ordinary LIFO queue also known as the LCFS (Last Come - First Serviced) queue.

type SIROQueue m a = Queue m FCFS SIRO FCFS a Source #

A type synonym for the SIRO (Serviced in Random Order) queue.

type PriorityQueue m a = Queue m FCFS StaticPriorities FCFS a Source #

A type synonym for the queue with static priorities applied when storing the elements in the queue.

data Queue m si sm so a Source #

Represents a queue using the specified strategies for enqueueing (input), `si`

,
internal storing (in memory), `sm`

, and dequeueing (output), `so`

, where `a`

denotes
the type of items stored in the queue. Type `m`

denotes the underlying monad within
which the simulation executes.

(MonadDES m, Show si, Show sm, Show so, ResultItemable (ResultValue si), ResultItemable (ResultValue sm), ResultItemable (ResultValue so)) => ResultProvider (Queue m si sm so a) m Source # | |

# Creating Queue

newFCFSQueue :: MonadDES m => Int -> Event m (FCFSQueue m a) Source #

Create a new FCFS queue with the specified capacity.

newLCFSQueue :: MonadDES m => Int -> Event m (LCFSQueue m a) Source #

Create a new LCFS queue with the specified capacity.

newSIROQueue :: (MonadDES m, QueueStrategy m SIRO) => Int -> Event m (SIROQueue m a) Source #

Create a new SIRO queue with the specified capacity.

newPriorityQueue :: (MonadDES m, QueueStrategy m StaticPriorities) => Int -> Event m (PriorityQueue m a) Source #

Create a new priority queue with the specified capacity.

:: (MonadDES m, QueueStrategy m si, QueueStrategy m sm, QueueStrategy m so) | |

=> si | the strategy applied to the enqueueing (input) processes when the queue is full |

-> sm | the strategy applied when storing items in the queue |

-> so | the strategy applied to the dequeueing (output) processes when the queue is empty |

-> Int | the queue capacity |

-> Event m (Queue m si sm so a) |

Create a new queue with the specified strategies and capacity.

# Queue Properties and Activities

enqueueStrategy :: Queue m si sm so a -> si Source #

The strategy applied to the enqueueing (input) processes when the queue is full.

enqueueStoringStrategy :: Queue m si sm so a -> sm Source #

The strategy applied when storing (in memory) items in the queue.

dequeueStrategy :: Queue m si sm so a -> so Source #

The strategy applied to the dequeueing (output) processes when the queue is empty.

queueNull :: MonadDES m => Queue m si sm so a -> Event m Bool Source #

Test whether the queue is empty.

See also `queueNullChanged`

and `queueNullChanged_`

.

queueFull :: MonadDES m => Queue m si sm so a -> Event m Bool Source #

Test whether the queue is full.

See also `queueFullChanged`

and `queueFullChanged_`

.

queueMaxCount :: Queue m si sm so a -> Int Source #

The queue capacity.

queueCount :: MonadDES m => Queue m si sm so a -> Event m Int Source #

Return the current queue size.

See also `queueCountStats`

, `queueCountChanged`

and `queueCountChanged_`

.

queueCountStats :: MonadDES m => Queue m si sm so a -> Event m (TimingStats Int) Source #

Return the queue size statistics.

enqueueCount :: MonadDES m => Queue m si sm so a -> Event m Int Source #

Return the total number of input items that were enqueued.

See also `enqueueCountChanged`

and `enqueueCountChanged_`

.

enqueueLostCount :: MonadDES m => Queue m si sm so a -> Event m Int Source #

Return the number of lost items.

See also `enqueueLostCountChanged`

and `enqueueLostCountChanged_`

.

enqueueStoreCount :: MonadDES m => Queue m si sm so a -> Event m Int Source #

Return the total number of input items that were stored.

See also `enqueueStoreCountChanged`

and `enqueueStoreCountChanged_`

.

dequeueCount :: MonadDES m => Queue m si sm so a -> Event m Int Source #

Return the total number of requests for dequeueing the items, not taking into account the failed attempts to dequeue immediately without suspension.

See also `dequeueCountChanged`

and `dequeueCountChanged_`

.

dequeueExtractCount :: MonadDES m => Queue m si sm so a -> Event m Int Source #

Return the total number of output items that were actually dequeued.

See also `dequeueExtractCountChanged`

and `dequeueExtractCountChanged_`

.

queueLoadFactor :: MonadDES m => Queue m si sm so a -> Event m Double Source #

Return the load factor: the queue size divided by its maximum size.

See also `queueLoadFactorChanged`

and `queueLoadFactorChanged_`

.

enqueueRate :: MonadDES m => Queue m si sm so a -> Event m Double Source #

Return the rate of the input items that were enqueued: how many items per time.

enqueueStoreRate :: MonadDES m => Queue m si sm so a -> Event m Double Source #

Return the rate of the items that were stored: how many items per time.

dequeueRate :: MonadDES m => Queue m si sm so a -> Event m Double Source #

Return the rate of the requests for dequeueing the items: how many requests per time. It does not include the failed attempts to dequeue immediately without suspension.

dequeueExtractRate :: MonadDES m => Queue m si sm so a -> Event m Double Source #

Return the rate of the output items that were actually dequeued: how many items per time.

queueWaitTime :: MonadDES m => Queue m si sm so a -> Event m (SamplingStats Double) Source #

Return the wait time from the time at which the item was stored in the queue to the time at which it was dequeued.

See also `queueWaitTimeChanged`

and `queueWaitTimeChanged_`

.

queueTotalWaitTime :: MonadDES m => Queue m si sm so a -> Event m (SamplingStats Double) Source #

Return the total wait time from the time at which the enqueueing operation was initiated to the time at which the item was dequeued.

In some sense, `queueTotalWaitTime == enqueueWaitTime + queueWaitTime`

.

See also `queueTotalWaitTimeChanged`

and `queueTotalWaitTimeChanged_`

.

enqueueWaitTime :: MonadDES m => Queue m si sm so a -> Event m (SamplingStats Double) Source #

Return the enqueue wait time from the time at which the enqueueing operation was initiated to the time at which the item was stored in the queue.

See also `enqueueWaitTimeChanged`

and `enqueueWaitTimeChanged_`

.

dequeueWaitTime :: MonadDES m => Queue m si sm so a -> Event m (SamplingStats Double) Source #

Return the dequeue wait time from the time at which the item was requested for dequeueing to the time at which it was actually dequeued.

See also `dequeueWaitTimeChanged`

and `dequeueWaitTimeChanged_`

.

queueRate :: MonadDES m => Queue m si sm so a -> Event m Double Source #

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

This value may be less than the actual arrival rate as the queue is finite and new arrivals may be locked while the queue remains full.

See also `queueRateChanged`

and `queueRateChanged_`

.

# Dequeuing and Enqueuing

:: (MonadDES m, DequeueStrategy m si, DequeueStrategy m sm, EnqueueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> Process m a | the dequeued value |

Dequeue suspending the process if the queue is empty.

dequeueWithOutputPriority Source #

:: (MonadDES m, DequeueStrategy m si, DequeueStrategy m sm, PriorityQueueStrategy m so po) | |

=> Queue m si sm so a | the queue |

-> po | the priority for output |

-> Process m a | the dequeued value |

Dequeue with the output priority suspending the process if the queue is empty.

:: (MonadDES m, DequeueStrategy m si, DequeueStrategy m sm) | |

=> Queue m si sm so a | the queue |

-> Event m (Maybe a) | the dequeued value of |

Try to dequeue immediately.

:: (MonadDES m, EnqueueStrategy m si, EnqueueStrategy m sm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> a | the item to enqueue |

-> Process m () |

Enqueue the item suspending the process if the queue is full.

enqueueWithInputPriority Source #

:: (MonadDES m, PriorityQueueStrategy m si pi, EnqueueStrategy m sm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> pi | the priority for input |

-> a | the item to enqueue |

-> Process m () |

Enqueue with the input priority the item suspending the process if the queue is full.

enqueueWithStoringPriority Source #

:: (MonadDES m, EnqueueStrategy m si, PriorityQueueStrategy m sm pm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> pm | the priority for storing |

-> a | the item to enqueue |

-> Process m () |

Enqueue with the storing priority the item suspending the process if the queue is full.

enqueueWithInputStoringPriorities Source #

:: (MonadDES m, PriorityQueueStrategy m si pi, PriorityQueueStrategy m sm pm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> pi | the priority for input |

-> pm | the priority for storing |

-> a | the item to enqueue |

-> Process m () |

Enqueue with the input and storing priorities the item suspending the process if the queue is full.

:: (MonadDES m, EnqueueStrategy m sm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> a | the item which we try to enqueue |

-> Event m Bool |

Try to enqueue the item. Return `False`

in the monad if the queue is full.

tryEnqueueWithStoringPriority Source #

:: (MonadDES m, PriorityQueueStrategy m sm pm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> pm | the priority for storing |

-> a | the item which we try to enqueue |

-> Event m Bool |

Try to enqueue with the storing priority the item. Return `False`

in
the monad if the queue is full.

:: (MonadDES m, EnqueueStrategy m sm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> a | the item which we try to enqueue |

-> Event m Bool |

Try to enqueue the item. If the queue is full then the item will be lost
and `False`

will be returned.

:: (MonadDES m, EnqueueStrategy m sm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> a | the item which we try to enqueue |

-> Event m () |

Try to enqueue the item. If the queue is full then the item will be lost.

enqueueWithStoringPriorityOrLost Source #

:: (MonadDES m, PriorityQueueStrategy m sm pm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> pm | the priority for storing |

-> a | the item which we try to enqueue |

-> Event m Bool |

Try to enqueue with the storing priority the item. If the queue is full
then the item will be lost and `False`

will be returned.

enqueueWithStoringPriorityOrLost_ Source #

:: (MonadDES m, PriorityQueueStrategy m sm pm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> pm | the priority for storing |

-> a | the item which we try to enqueue |

-> Event m () |

Try to enqueue with the storing priority the item. If the queue is full then the item will be lost.

:: (MonadDES m, Eq a, DequeueStrategy m si, DeletingQueueStrategy m sm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> a | the item to remove from the queue |

-> Event m Bool | whether the item was found and removed |

Remove the item from the queue and return a flag indicating whether the item was found and actually removed.

:: (MonadDES m, Eq a, DequeueStrategy m si, DeletingQueueStrategy m sm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> a | the item to remove from the queue |

-> Event m () |

Remove the specified item from the queue.

:: (MonadDES m, DequeueStrategy m si, DeletingQueueStrategy m sm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> (a -> Bool) | the predicate |

-> Event m (Maybe a) |

Remove an item satisfying the specified predicate and return the item if found.

:: (MonadDES m, DequeueStrategy m si, DeletingQueueStrategy m sm, DequeueStrategy m so) | |

=> Queue m si sm so a | the queue |

-> (a -> Bool) | the predicate |

-> Event m () |

Remove an item satisfying the specified predicate.

:: (MonadDES m, Eq a, DeletingQueueStrategy m sm) | |

=> Queue m si sm so a | the queue |

-> a | the item to search the queue for |

-> Event m Bool | whether the item was found |

Detect whether the item is contained in the queue.

:: (MonadDES m, DeletingQueueStrategy m sm) | |

=> Queue m si sm so a | the queue |

-> (a -> Bool) | the predicate |

-> Event m (Maybe a) | the item if it was found |

Detect whether an item satisfying the specified predicate is contained in the queue.

:: (MonadDES m, DequeueStrategy m si, DequeueStrategy m sm) | |

=> Queue m si sm so a | the queue |

-> Event m () |

Clear the queue immediately.

# Awaiting

waitWhileFullQueue :: MonadDES m => Queue m si sm so a -> Process m () Source #

Wait while the queue is full.

# Summary

queueSummary :: (MonadDES m, Show si, Show sm, Show so) => Queue m si sm so a -> Int -> Event m ShowS Source #

Return the summary for the queue with desciption of its properties and activities using the specified indent.

# Derived Signals for Properties

queueNullChanged :: MonadDES m => Queue m si sm so a -> Signal m Bool Source #

Signal when the `queueNull`

property value has changed.

queueNullChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `queueNull`

property value has changed.

queueFullChanged :: MonadDES m => Queue m si sm so a -> Signal m Bool Source #

Signal when the `queueFull`

property value has changed.

queueFullChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `queueFull`

property value has changed.

queueCountChanged :: MonadDES m => Queue m si sm so a -> Signal m Int Source #

Signal when the `queueCount`

property value has changed.

queueCountChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `queueCount`

property value has changed.

enqueueCountChanged :: MonadDES m => Queue m si sm so a -> Signal m Int Source #

Signal when the `enqueueCount`

property value has changed.

enqueueCountChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `enqueueCount`

property value has changed.

enqueueLostCountChanged :: MonadDES m => Queue m si sm so a -> Signal m Int Source #

Signal when the `enqueueLostCount`

property value has changed.

enqueueLostCountChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `enqueueLostCount`

property value has changed.

enqueueStoreCountChanged :: MonadDES m => Queue m si sm so a -> Signal m Int Source #

Signal when the `enqueueStoreCount`

property value has changed.

enqueueStoreCountChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `enqueueStoreCount`

property value has changed.

dequeueCountChanged :: MonadDES m => Queue m si sm so a -> Signal m Int Source #

Signal when the `dequeueCount`

property value has changed.

dequeueCountChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `dequeueCount`

property value has changed.

dequeueExtractCountChanged :: MonadDES m => Queue m si sm so a -> Signal m Int Source #

Signal when the `dequeueExtractCount`

property value has changed.

dequeueExtractCountChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `dequeueExtractCount`

property value has changed.

queueLoadFactorChanged :: MonadDES m => Queue m si sm so a -> Signal m Double Source #

Signal when the `queueLoadFactor`

property value has changed.

queueLoadFactorChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `queueLoadFactor`

property value has changed.

queueWaitTimeChanged :: MonadDES m => Queue m si sm so a -> Signal m (SamplingStats Double) Source #

Signal when the `queueWaitTime`

property value has changed.

queueWaitTimeChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `queueWaitTime`

property value has changed.

queueTotalWaitTimeChanged :: MonadDES m => Queue m si sm so a -> Signal m (SamplingStats Double) Source #

Signal when the `queueTotalWaitTime`

property value has changed.

queueTotalWaitTimeChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `queueTotalWaitTime`

property value has changed.

enqueueWaitTimeChanged :: MonadDES m => Queue m si sm so a -> Signal m (SamplingStats Double) Source #

Signal when the `enqueueWaitTime`

property value has changed.

enqueueWaitTimeChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `enqueueWaitTime`

property value has changed.

dequeueWaitTimeChanged :: MonadDES m => Queue m si sm so a -> Signal m (SamplingStats Double) Source #

Signal when the `dequeueWaitTime`

property value has changed.

dequeueWaitTimeChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `dequeueWaitTime`

property value has changed.

queueRateChanged :: MonadDES m => Queue m si sm so a -> Signal m Double Source #

Signal when the `queueRate`

property value has changed.

queueRateChanged_ :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Signal when the `queueRate`

property value has changed.

# Basic Signals

enqueueInitiated :: MonadDES m => Queue m si sm so a -> Signal m a Source #

Return a signal that notifies when the enqueuing operation is initiated.

enqueueStored :: MonadDES m => Queue m si sm so a -> Signal m a Source #

Return a signal that notifies when the enqueuing operation is completed and the item is stored in the internal memory of the queue.

enqueueLost :: MonadDES m => Queue m si sm so a -> Signal m a Source #

Return a signal which notifies that the item was lost when
attempting to add it to the full queue with help of
`enqueueOrLost`

, `enqueueOrLost_`

or similar functions that imply
that the element can be lost. All their names are ending with `OrLost`

or `OrLost_`

.

In other cases the enqueued items are not lost but the corresponded process
can suspend until the internal queue storage is freed. Although there is one
exception from this rule. If the process trying to enqueue a new element was
suspended but then canceled through `cancelProcess`

from the outside then
the item will not be added.

dequeueRequested :: MonadDES m => Queue m si sm so a -> Signal m () Source #

Return a signal that notifies when the dequeuing operation was requested.

dequeueExtracted :: MonadDES m => Queue m si sm so a -> Signal m a Source #

Return a signal that notifies when the item was extracted from the internal storage of the queue and prepared for immediate receiving by the dequeuing process.

# Overall Signal

queueChanged_ :: MonadDES m => Queue m si sm so a -> 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.