%
% API Documentation for API Documentation
% Module coinor.blimpy.Queues
%
% Generated by epydoc 3.0.1
% [Fri Mar 28 15:03:09 2014]
%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                          Module Description                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}|(}
\section{Module coinor.blimpy.Queues}

    \label{coinor:blimpy:Queues}
This module implements a Queue class, a simple list-based queue data 
structure and a PriorityQueue class, which is a heap-based priority queue 
data structure.

\textbf{Version:} 1.1.0



\textbf{Author:} Aykut Bulut, Ted Ralphs (ayb211@lehigh.edu,ted@lehigh.edu)



\textbf{License:} BSD




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                               Variables                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsection{Variables}

    \vspace{-1cm}
\hspace{\varindent}\begin{longtable}{|p{\varnamewidth}|p{\vardescrwidth}|l}
\cline{1-2}
\cline{1-2} \centering \textbf{Name} & \centering \textbf{Description}& \\
\cline{1-2}
\endhead\cline{1-2}\multicolumn{3}{r}{\small\textit{continued on next page}}\\\endfoot\cline{1-2}
\endlastfoot\raggedright \_\-\_\-m\-a\-i\-n\-t\-a\-i\-n\-e\-r\-\_\-\_\- & \raggedright \textbf{Value:} 
{\tt \texttt{'}\texttt{Aykut Bulut}\texttt{'}}&\\
\cline{1-2}
\raggedright \_\-\_\-e\-m\-a\-i\-l\-\_\-\_\- & \raggedright \textbf{Value:} 
{\tt \texttt{'}\texttt{ayb211@lehigh.edu}\texttt{'}}&\\
\cline{1-2}
\raggedright \_\-\_\-u\-r\-l\-\_\-\_\- & \raggedright \textbf{Value:} 
{\tt None}&\\
\cline{1-2}
\raggedright \_\-\_\-t\-i\-t\-l\-e\-\_\-\_\- & \raggedright \textbf{Value:} 
{\tt \texttt{'}\texttt{Queue data structure}\texttt{'}}&\\
\cline{1-2}
\raggedright \_\-\_\-p\-a\-c\-k\-a\-g\-e\-\_\-\_\- & \raggedright \textbf{Value:} 
{\tt \texttt{'}\texttt{coinor.blimpy}\texttt{'}}&\\
\cline{1-2}
\end{longtable}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                           Class Description                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.Queue \textit{(class)}|(}
\subsection{Class Queue}

    \label{coinor:blimpy:Queues:Queue}
\begin{tabular}{cccccc}
% Line for object, linespec=[False]
\multicolumn{2}{r}{\settowidth{\BCL}{object}\multirow{2}{\BCL}{object}}
&&
  \\\cline{3-3}
  &&\multicolumn{1}{c|}{}
&&
  \\
&&\multicolumn{2}{l}{\textbf{coinor.blimpy.Queues.Queue}}
\end{tabular}

\begin{alltt}

A queue data structure built on top of a linked list
attributes:
    items:    A list that holds objects in the queue
              type: LinkedList
methods:
    \_\_init\_\_(self):        constructor of the class
    isEmpty(self):         returns True if the queue instance is empty
    push(self,item):       inserts item to the queue
    pop(self,item):        removes first item in the queue if no item is
                           specified removes the given item if item is
                           specified
    size(self):            returns the size of the queue
\end{alltt}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                Methods                                %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Methods}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{\_\_init\_\_}(\textit{self})

\setlength{\parskip}{2ex}
    x.\_\_init\_\_(...) initializes x; see help(type(x)) for signature

\setlength{\parskip}{1ex}
      Overrides: object.\_\_init\_\_ 	extit{(inherited documentation)}

    \end{boxedminipage}

    \label{coinor:blimpy:Queues:Queue:isEmpty}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.Queue \textit{(class)}!coinor.blimpy.Queues.Queue.isEmpty \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{isEmpty}(\textit{self})

\setlength{\parskip}{2ex}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{coinor:blimpy:Queues:Queue:enqueue}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.Queue \textit{(class)}!coinor.blimpy.Queues.Queue.enqueue \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{enqueue}(\textit{self}, \textit{item})

\setlength{\parskip}{2ex}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{coinor:blimpy:Queues:Queue:push}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.Queue \textit{(class)}!coinor.blimpy.Queues.Queue.push \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{push}(\textit{self}, \textit{item})

\setlength{\parskip}{2ex}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{coinor:blimpy:Queues:Queue:dequeue}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.Queue \textit{(class)}!coinor.blimpy.Queues.Queue.dequeue \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{dequeue}(\textit{self}, \textit{item}={\tt None})

\setlength{\parskip}{2ex}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{coinor:blimpy:Queues:Queue:remove}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.Queue \textit{(class)}!coinor.blimpy.Queues.Queue.remove \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{remove}(\textit{self}, \textit{item}={\tt None})

\setlength{\parskip}{2ex}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{coinor:blimpy:Queues:Queue:pop}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.Queue \textit{(class)}!coinor.blimpy.Queues.Queue.pop \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{pop}(\textit{self}, \textit{item}={\tt None})

\setlength{\parskip}{2ex}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{coinor:blimpy:Queues:Queue:peek}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.Queue \textit{(class)}!coinor.blimpy.Queues.Queue.peek \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{peek}(\textit{self}, \textit{item}={\tt None})

\setlength{\parskip}{2ex}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{coinor:blimpy:Queues:Queue:size}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.Queue \textit{(class)}!coinor.blimpy.Queues.Queue.size \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{size}(\textit{self})

\setlength{\parskip}{2ex}
\setlength{\parskip}{1ex}
    \end{boxedminipage}


\large{\textbf{\textit{Inherited from object}}}

\begin{quote}
\_\_delattr\_\_(), \_\_format\_\_(), \_\_getattribute\_\_(), \_\_hash\_\_(), \_\_new\_\_(), \_\_reduce\_\_(), \_\_reduce\_ex\_\_(), \_\_repr\_\_(), \_\_setattr\_\_(), \_\_sizeof\_\_(), \_\_str\_\_(), \_\_subclasshook\_\_()
\end{quote}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                              Properties                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Properties}

    \vspace{-1cm}
\hspace{\varindent}\begin{longtable}{|p{\varnamewidth}|p{\vardescrwidth}|l}
\cline{1-2}
\cline{1-2} \centering \textbf{Name} & \centering \textbf{Description}& \\
\cline{1-2}
\endhead\cline{1-2}\multicolumn{3}{r}{\small\textit{continued on next page}}\\\endfoot\cline{1-2}
\endlastfoot\multicolumn{2}{|l|}{\textit{Inherited from object}}\\
\multicolumn{2}{|p{\varwidth}|}{\raggedright \_\_class\_\_}\\
\cline{1-2}
\end{longtable}

    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.Queue \textit{(class)}|)}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                           Class Description                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.PriorityQueue \textit{(class)}|(}
\subsection{Class PriorityQueue}

    \label{coinor:blimpy:Queues:PriorityQueue}
\begin{tabular}{cccccc}
% Line for object, linespec=[False]
\multicolumn{2}{r}{\settowidth{\BCL}{object}\multirow{2}{\BCL}{object}}
&&
  \\\cline{3-3}
  &&\multicolumn{1}{c|}{}
&&
  \\
&&\multicolumn{2}{l}{\textbf{coinor.blimpy.Queues.PriorityQueue}}
\end{tabular}

\begin{alltt}

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
\end{alltt}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                Methods                                %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Methods}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{\_\_init\_\_}(\textit{self}, \textit{aList}={\tt None})

\setlength{\parskip}{2ex}
    x.\_\_init\_\_(...) initializes x; see help(type(x)) for signature

\setlength{\parskip}{1ex}
      Overrides: object.\_\_init\_\_ 	extit{(inherited documentation)}

    \end{boxedminipage}

    \label{coinor:blimpy:Queues:PriorityQueue:isEmpty}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.PriorityQueue \textit{(class)}!coinor.blimpy.Queues.PriorityQueue.isEmpty \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{isEmpty}(\textit{self})

\setlength{\parskip}{2ex}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{coinor:blimpy:Queues:PriorityQueue:heapify}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.PriorityQueue \textit{(class)}!coinor.blimpy.Queues.PriorityQueue.heapify \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{heapify}(\textit{self})

\setlength{\parskip}{2ex}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{coinor:blimpy:Queues:PriorityQueue:pop}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.PriorityQueue \textit{(class)}!coinor.blimpy.Queues.PriorityQueue.pop \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{pop}(\textit{self}, \textit{key}={\tt None})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}
    Remove and return the lowest priority task. Raise KeyError if empty.

\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{coinor:blimpy:Queues:PriorityQueue:peek}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.PriorityQueue \textit{(class)}!coinor.blimpy.Queues.PriorityQueue.peek \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{peek}(\textit{self}, \textit{key}={\tt None})

\setlength{\parskip}{2ex}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{coinor:blimpy:Queues:PriorityQueue:get_priority}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.PriorityQueue \textit{(class)}!coinor.blimpy.Queues.PriorityQueue.get\_priority \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{get\_priority}(\textit{self}, \textit{key})

\setlength{\parskip}{2ex}
\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{coinor:blimpy:Queues:PriorityQueue:push}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.PriorityQueue \textit{(class)}!coinor.blimpy.Queues.PriorityQueue.push \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{push}(\textit{self}, \textit{key}, \textit{priority}={\tt None}, \textit{item}={\tt None})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}
    Add to the heap or update the priority of an existing task.

\setlength{\parskip}{1ex}
    \end{boxedminipage}

    \label{coinor:blimpy:Queues:PriorityQueue:remove}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.PriorityQueue \textit{(class)}!coinor.blimpy.Queues.PriorityQueue.remove \textit{(method)}}

    \vspace{0.5ex}

\hspace{.8\funcindent}\begin{boxedminipage}{\funcwidth}

    \raggedright \textbf{remove}(\textit{self}, \textit{key})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}
\setlength{\parskip}{2ex}
    Mark an existing task as REMOVED.  Raise KeyError if not found.

\setlength{\parskip}{1ex}
    \end{boxedminipage}


\large{\textbf{\textit{Inherited from object}}}

\begin{quote}
\_\_delattr\_\_(), \_\_format\_\_(), \_\_getattribute\_\_(), \_\_hash\_\_(), \_\_new\_\_(), \_\_reduce\_\_(), \_\_reduce\_ex\_\_(), \_\_repr\_\_(), \_\_setattr\_\_(), \_\_sizeof\_\_(), \_\_str\_\_(), \_\_subclasshook\_\_()
\end{quote}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                              Properties                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Properties}

    \vspace{-1cm}
\hspace{\varindent}\begin{longtable}{|p{\varnamewidth}|p{\vardescrwidth}|l}
\cline{1-2}
\cline{1-2} \centering \textbf{Name} & \centering \textbf{Description}& \\
\cline{1-2}
\endhead\cline{1-2}\multicolumn{3}{r}{\small\textit{continued on next page}}\\\endfoot\cline{1-2}
\endlastfoot\multicolumn{2}{|l|}{\textit{Inherited from object}}\\
\multicolumn{2}{|p{\varwidth}|}{\raggedright \_\_class\_\_}\\
\cline{1-2}
\end{longtable}

    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}!coinor.blimpy.Queues.PriorityQueue \textit{(class)}|)}
    \index{coinor \textit{(package)}!coinor.blimpy \textit{(package)}!coinor.blimpy.Queues \textit{(module)}|)}
