pypdevsbbl.extra.queues.html 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <title>pypdevsbbl.extra.queues module &#8212; Python(P)DEVS-BBL documentation</title>
  8. <link rel="stylesheet" href="_static/nature.css" type="text/css" />
  9. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  10. <link rel="stylesheet" type="text/css" href="_static/custom.css" />
  11. <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
  12. <script type="text/javascript" src="_static/jquery.js"></script>
  13. <script type="text/javascript" src="_static/underscore.js"></script>
  14. <script type="text/javascript" src="_static/doctools.js"></script>
  15. <script type="text/javascript" src="_static/language_data.js"></script>
  16. <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
  17. <link rel="index" title="Index" href="genindex.html" />
  18. <link rel="search" title="Search" href="search.html" />
  19. <link rel="next" title="pypdevsbbl.extra.spatial module" href="pypdevsbbl.extra.spatial.html" />
  20. <link rel="prev" title="pypdevsbbl.extra.packaging module" href="pypdevsbbl.extra.packaging.html" />
  21. </head><body>
  22. <div class="related" role="navigation" aria-label="related navigation">
  23. <h3>Navigation</h3>
  24. <ul>
  25. <li class="right" style="margin-right: 10px">
  26. <a href="genindex.html" title="General Index"
  27. accesskey="I">index</a></li>
  28. <li class="right" >
  29. <a href="py-modindex.html" title="Python Module Index"
  30. >modules</a> |</li>
  31. <li class="right" >
  32. <a href="pypdevsbbl.extra.spatial.html" title="pypdevsbbl.extra.spatial module"
  33. accesskey="N">next</a> |</li>
  34. <li class="right" >
  35. <a href="pypdevsbbl.extra.packaging.html" title="pypdevsbbl.extra.packaging module"
  36. accesskey="P">previous</a> |</li>
  37. <li class="nav-item nav-item-0"><a href="index.html">Python(P)DEVS-BBL documentation</a> &#187;</li>
  38. <li class="nav-item nav-item-1"><a href="pypdevsbbl.html" >pypdevsbbl package</a> &#187;</li>
  39. <li class="nav-item nav-item-2"><a href="pypdevsbbl.extra.html" accesskey="U">pypdevsbbl.extra package</a> &#187;</li>
  40. </ul>
  41. </div>
  42. <div class="document">
  43. <div class="documentwrapper">
  44. <div class="bodywrapper">
  45. <div class="body" role="main">
  46. <div class="section" id="module-pypdevsbbl.extra.queues">
  47. <span id="pypdevsbbl-extra-queues-module"></span><h1>pypdevsbbl.extra.queues module<a class="headerlink" href="#module-pypdevsbbl.extra.queues" title="Permalink to this headline">¶</a></h1>
  48. <p>Helper file for <a class="reference internal" href="pypdevsbbl.generic.queues.html#module-pypdevsbbl.generic.queues" title="pypdevsbbl.generic.queues"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pypdevsbbl.generic.queues</span></code></a>.</p>
  49. <p>This file contains common queueing disciplines and the element that
  50. will be enqueued in the <a class="reference internal" href="pypdevsbbl.generic.queues.html#pypdevsbbl.generic.queues.SimpleQueue" title="pypdevsbbl.generic.queues.SimpleQueue"><code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.generic.queues.SimpleQueue</span></code></a> and
  51. <a class="reference internal" href="pypdevsbbl.generic.queues.html#pypdevsbbl.generic.queues.Queue" title="pypdevsbbl.generic.queues.Queue"><code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.generic.queues.Queue</span></code></a> building blocks.</p>
  52. <dl class="function">
  53. <dt id="pypdevsbbl.extra.queues.FIFO">
  54. <code class="descclassname">pypdevsbbl.extra.queues.</code><code class="descname">FIFO</code><span class="sig-paren">(</span><em>time</em>, <em>val</em>, <em>ix</em><span class="sig-paren">)</span><a class="headerlink" href="#pypdevsbbl.extra.queues.FIFO" title="Permalink to this definition">¶</a></dt>
  55. <dd><p>First-In-First-Out kind of queue. This is the most commonly used one.</p>
  56. <div class="admonition note">
  57. <p class="first admonition-title">Note</p>
  58. <p class="last">Keep in mind that we use a maxheap in our queue.</p>
  59. </div>
  60. </dd></dl>
  61. <dl class="function">
  62. <dt id="pypdevsbbl.extra.queues.FCFS">
  63. <code class="descclassname">pypdevsbbl.extra.queues.</code><code class="descname">FCFS</code><span class="sig-paren">(</span><em>time</em>, <em>val</em>, <em>ix</em><span class="sig-paren">)</span><a class="headerlink" href="#pypdevsbbl.extra.queues.FCFS" title="Permalink to this definition">¶</a></dt>
  64. <dd><p>Alias for <a class="reference internal" href="#pypdevsbbl.extra.queues.FIFO" title="pypdevsbbl.extra.queues.FIFO"><code class="xref py py-meth docutils literal notranslate"><span class="pre">FIFO()</span></code></a>.</p>
  65. </dd></dl>
  66. <dl class="function">
  67. <dt id="pypdevsbbl.extra.queues.LIFO">
  68. <code class="descclassname">pypdevsbbl.extra.queues.</code><code class="descname">LIFO</code><span class="sig-paren">(</span><em>time</em>, <em>val</em>, <em>ix</em><span class="sig-paren">)</span><a class="headerlink" href="#pypdevsbbl.extra.queues.LIFO" title="Permalink to this definition">¶</a></dt>
  69. <dd><p>Last-In-First-Out kind of queue. This is used for stacks etc.</p>
  70. <div class="admonition note">
  71. <p class="first admonition-title">Note</p>
  72. <p class="last">Keep in mind that we use a maxheap in our queue.</p>
  73. </div>
  74. </dd></dl>
  75. <dl class="class">
  76. <dt id="pypdevsbbl.extra.queues.QueueElement">
  77. <em class="property">class </em><code class="descclassname">pypdevsbbl.extra.queues.</code><code class="descname">QueueElement</code><span class="sig-paren">(</span><em>priority</em>, <em>item</em>, <em>arrival_time</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/extra/queues.html#QueueElement"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.extra.queues.QueueElement" title="Permalink to this definition">¶</a></dt>
  78. <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
  79. <p>Simple Queue Element for storing all necessary information and doing valid comparisons.</p>
  80. <p>Creates a special kind of tuple for enqueueing items, allowing for sorting on priorities
  81. and remembering their arrival times (which is used for reneging).</p>
  82. <div class="admonition warning">
  83. <p class="first admonition-title">Warning</p>
  84. <p class="last">This is not a DEVS building block.</p>
  85. </div>
  86. <table class="docutils field-list" frame="void" rules="none">
  87. <col class="field-name" />
  88. <col class="field-body" />
  89. <tbody valign="top">
  90. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  91. <li><strong>priority</strong> (<em>comparable</em>) – The priority of the item in the queue.</li>
  92. <li><strong>item</strong> (<em>any</em>) – The item to enqueue.</li>
  93. <li><strong>arrival_time</strong> (<em>numeric</em>) – (Absolute) time of arrival of the item.</li>
  94. </ul>
  95. </td>
  96. </tr>
  97. <tr class="field-even field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first last simple">
  98. <li><strong>priority</strong> (<em>comparable</em>) – The priority of the item in the queue.</li>
  99. <li><strong>item</strong> (<em>any</em>) – The item to enqueue.</li>
  100. <li><strong>arrival_time</strong> (<em>numeric</em>) – (Absolute) time of arrival of the item.</li>
  101. </ul>
  102. </td>
  103. </tr>
  104. </tbody>
  105. </table>
  106. </dd></dl>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  112. <div class="sphinxsidebarwrapper">
  113. <h4>Previous topic</h4>
  114. <p class="topless"><a href="pypdevsbbl.extra.packaging.html"
  115. title="previous chapter">pypdevsbbl.extra.packaging module</a></p>
  116. <h4>Next topic</h4>
  117. <p class="topless"><a href="pypdevsbbl.extra.spatial.html"
  118. title="next chapter">pypdevsbbl.extra.spatial module</a></p>
  119. <div id="searchbox" style="display: none" role="search">
  120. <h3>Quick search</h3>
  121. <div class="searchformwrapper">
  122. <form class="search" action="search.html" method="get">
  123. <input type="text" name="q" />
  124. <input type="submit" value="Go" />
  125. <input type="hidden" name="check_keywords" value="yes" />
  126. <input type="hidden" name="area" value="default" />
  127. </form>
  128. </div>
  129. </div>
  130. <script type="text/javascript">$('#searchbox').show(0);</script>
  131. </div>
  132. </div>
  133. <div class="clearer"></div>
  134. </div>
  135. <div class="related" role="navigation" aria-label="related navigation">
  136. <h3>Navigation</h3>
  137. <ul>
  138. <li class="right" style="margin-right: 10px">
  139. <a href="genindex.html" title="General Index"
  140. >index</a></li>
  141. <li class="right" >
  142. <a href="py-modindex.html" title="Python Module Index"
  143. >modules</a> |</li>
  144. <li class="right" >
  145. <a href="pypdevsbbl.extra.spatial.html" title="pypdevsbbl.extra.spatial module"
  146. >next</a> |</li>
  147. <li class="right" >
  148. <a href="pypdevsbbl.extra.packaging.html" title="pypdevsbbl.extra.packaging module"
  149. >previous</a> |</li>
  150. <li class="nav-item nav-item-0"><a href="index.html">Python(P)DEVS-BBL documentation</a> &#187;</li>
  151. <li class="nav-item nav-item-1"><a href="pypdevsbbl.html" >pypdevsbbl package</a> &#187;</li>
  152. <li class="nav-item nav-item-2"><a href="pypdevsbbl.extra.html" >pypdevsbbl.extra package</a> &#187;</li>
  153. </ul>
  154. </div>
  155. <div class="footer" role="contentinfo">
  156. &#169; Copyright 2020, Randy Paredis.
  157. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.5.
  158. </div>
  159. </body>
  160. </html>