Stability | experimental |
---|---|
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Safe Haskell | Safe-Inferred |
Tested with: GHC 7.6.3
This module defines the queue strategies.
- class QueueStrategy s q | s -> q where
- newStrategyQueue :: s -> Simulation (q i)
- strategyQueueNull :: s -> q i -> Event Bool
- class QueueStrategy s q => DequeueStrategy s q | s -> q where
- strategyDequeue :: s -> q i -> Event i
- class DequeueStrategy s q => EnqueueStrategy s q | s -> q where
- strategyEnqueue :: s -> q i -> i -> Event ()
- class DequeueStrategy s q => PriorityQueueStrategy s q | s -> q where
- strategyEnqueueWithPriority :: s -> q i -> Double -> i -> Event ()
- class DequeueStrategy s q => DynamicPriorityQueueStrategy s q | s -> q where
- strategyEnqueueWithDynamicPriority :: s -> q i -> Event Double -> i -> Event ()
- data FCFS = FCFS
- data LCFS = LCFS
- data SIRO = SIRO
- data StaticPriorities = StaticPriorities
Documentation
class QueueStrategy s q | s -> q whereSource
Defines the basic queue strategy.
newStrategyQueue :: s -> Simulation (q i)Source
Create a new queue by the specified strategy.
strategyQueueNull :: s -> q i -> Event BoolSource
Test whether the queue is empty.
class QueueStrategy s q => DequeueStrategy s q | s -> q whereSource
Defines a strategy with support of the dequeuing operation.
strategyDequeue :: s -> q i -> Event iSource
Dequeue the front element and return it.
class DequeueStrategy s q => EnqueueStrategy s q | s -> q whereSource
It defines a strategy when we can enqueue a single element.
strategyEnqueue :: s -> q i -> i -> Event ()Source
Enqueue an element.
class DequeueStrategy s q => PriorityQueueStrategy s q | s -> q whereSource
It defines a strategy when we can enqueue an element with the specified priority.
strategyEnqueueWithPriority :: s -> q i -> Double -> i -> Event ()Source
Enqueue an element with the specified priority.
class DequeueStrategy s q => DynamicPriorityQueueStrategy s q | s -> q whereSource
It defines a strategy when we can enqueue an element with the dynamic priority.
strategyEnqueueWithDynamicPriority :: s -> q i -> Event Double -> i -> Event ()Source
Enqueue an element with the specified priority.
Strategy: First Come - First Served (FCFS).
Strategy: Last Come - First Served (LCFS)
Strategy: Service in Random Order (SIRO).
data StaticPriorities Source
Strategy: Static Priorities. It uses the priority queue.