aivika-transformers-2.0: Transformers for the Aivika simulation library

CopyrightCopyright (c) 2009-2014, David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simulation.Aivika.Trans.PriorityQueue

Description

Tested with: GHC 7.8.3

An imperative heap-based priority queue.

Synopsis

Documentation

data PriorityQueue m a Source

The PriorityQueue type represents an imperative heap-based priority queue.

queueNull :: ProtoMonadComp m => PriorityQueue m a -> m Bool Source

Test whether the priority queue is empty.

queueCount :: ProtoMonadComp m => PriorityQueue m a -> m Int Source

Return the number of elements in the priority queue.

newQueue :: ProtoMonadComp m => Session m -> m (PriorityQueue m a) Source

Create a new priority queue.

enqueue :: ProtoMonadComp m => PriorityQueue m a -> Double -> a -> m () Source

Enqueue a new element with the specified priority.

dequeue :: ProtoMonadComp m => PriorityQueue m a -> m () Source

Dequeue the element with the minimal priority.

queueFront :: ProtoMonadComp m => PriorityQueue m a -> m (Double, a) Source

Return the element with the minimal priority.