coinor.blimpy.Queues.PriorityQueue

Package coinor :: Package blimpy :: Module Queues :: Class PriorityQueue |
[hide private]
[frames] | no frames]

# Class PriorityQueue

source code

    A priority queue based on a heap.
    attributes:
        heap:                  A heap-ordered list that holds objects in the
                               queue
                               type: list
        entry_finder:          A (map) dictionary for finding items in the heap
        counter:               A unique sequence generator
        size:                  Number of items in the queue
    methods:
        __init__(self):        constructor of the class
        isEmpty(self):         returns True if the queue is empty, False
                               otherwise
        push(self,key,item,priority): inserts item with given key and
                               priority into the queue
        pop(self,index):       removes item with index from the queue
                               if no item is specified or removes the given
                               item if item is specified
        size(self):            returns the size of the queue

Instance Methods | [hide private]
__init__(self, aList=None) x.__init__(...) initializes x; see help(type(x)) for signature | source code
isEmpty(self) | source code
heapify(self) | source code
pop(self, key=None) Remove and return the lowest priority task. | source code
peek(self, key=None) | source code
get_priority(self, key) | source code
push(self, key, priority=None, item=None) Add to the heap or update the priority of an existing task. | source code
remove(self, key) Mark an existing task as REMOVED. | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, aList=None) (Constructor) | source code
x.__init__(...) initializes x; see help(type(x)) for signature Overrides: object.__init__ (inherited documentation)

### pop(self, key=None) | source code
Remove and return the lowest priority task. Raise KeyError if empty.

### remove(self, key) | source code
Mark an existing task as REMOVED. Raise KeyError if not found.