| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>pypdevsbbl.generic.collectors module — Python(P)DEVS-BBL documentation</title>
- <link rel="stylesheet" href="_static/nature.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
- <link rel="stylesheet" type="text/css" href="_static/custom.css" />
- <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
- <script type="text/javascript" src="_static/jquery.js"></script>
- <script type="text/javascript" src="_static/underscore.js"></script>
- <script type="text/javascript" src="_static/doctools.js"></script>
- <script type="text/javascript" src="_static/language_data.js"></script>
- <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>
- <link rel="index" title="Index" href="genindex.html" />
- <link rel="search" title="Search" href="search.html" />
- <link rel="next" title="pypdevsbbl.generic.generators module" href="pypdevsbbl.generic.generators.html" />
- <link rel="prev" title="pypdevsbbl.generic package" href="pypdevsbbl.generic.html" />
- </head><body>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="pypdevsbbl.generic.generators.html" title="pypdevsbbl.generic.generators module"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="pypdevsbbl.generic.html" title="pypdevsbbl.generic package"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">Python(P)DEVS-BBL documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="pypdevsbbl.html" >pypdevsbbl package</a> »</li>
- <li class="nav-item nav-item-2"><a href="pypdevsbbl.generic.html" accesskey="U">pypdevsbbl.generic package</a> »</li>
- </ul>
- </div>
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="module-pypdevsbbl.generic.collectors">
- <span id="pypdevsbbl-generic-collectors-module"></span><h1>pypdevsbbl.generic.collectors module<a class="headerlink" href="#module-pypdevsbbl.generic.collectors" title="Permalink to this headline">¶</a></h1>
- <p>Set of PythonPDEVS collectors for keeping track of all data.</p>
- <p>The classes in this file will allow for obtaining some well
- required statistical data from your models.</p>
- <dl class="class">
- <dt id="pypdevsbbl.generic.collectors.BaseCollector">
- <em class="property">class </em><code class="descclassname">pypdevsbbl.generic.collectors.</code><code class="descname">BaseCollector</code><span class="sig-paren">(</span><em>name: str</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#BaseCollector"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.BaseCollector" title="Permalink to this definition">¶</a></dt>
- <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevs.DEVS.AtomicDEVS</span></code></p>
- <p>Base class for all the collectors.</p>
- <p>This building block itself is not useful, but mainly acts as a root
- from which all collectors can inherit.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>name</strong> (<em>str</em>) – The name of the Collector.</p>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Input Ports:</th><td class="field-body"><ul class="first last simple">
- <li><strong>input</strong> (<em>any</em>) – Obtains values.</li>
- <li><strong>clear</strong> (<em>any</em>) – Clears the contents of the block.</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.BaseCollector.clearContents">
- <code class="descname">clearContents</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#BaseCollector.clearContents"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.BaseCollector.clearContents" title="Permalink to this definition">¶</a></dt>
- <dd><p>Clears the contents of the block.</p>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.BaseCollector.plot">
- <code class="descname">plot</code><span class="sig-paren">(</span><em>axis</em>, <em>arg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#BaseCollector.plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.BaseCollector.plot" title="Permalink to this definition">¶</a></dt>
- <dd><p>Plots the data of the collector.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
- <li><strong>axis</strong> – The <code class="xref py py-mod docutils literal notranslate"><span class="pre">matplotlib</span></code> axis to plot on.</li>
- <li><strong>arg</strong> – Additional argument.</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- </dd></dl>
- <dl class="class">
- <dt id="pypdevsbbl.generic.collectors.Collector">
- <em class="property">class </em><code class="descclassname">pypdevsbbl.generic.collectors.</code><code class="descname">Collector</code><span class="sig-paren">(</span><em>name: str</em>, <em>positive: bool = False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Collector"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Collector" title="Permalink to this definition">¶</a></dt>
- <dd><p>Bases: <a class="reference internal" href="#pypdevsbbl.generic.collectors.BaseCollector" title="pypdevsbbl.generic.collectors.BaseCollector"><code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.generic.collectors.BaseCollector</span></code></a></p>
- <p>Collects base information about items that arrive on <cite>input</cite>.</p>
- <p>The Collector block keeps track of the basic information about all items that
- arrive. This includes minima, maxima, means, sums, sums of squares and the
- amount of items that it has seen.</p>
- <p>Using this data, the min, max, mean, variance, standard derivation and count
- of the passed items can be obtained. See their respective functions below.</p>
- <div class="admonition note">
- <p class="first admonition-title">Note</p>
- <p class="last">In order to do this, the items must be numeric and therefore have the
- <code class="docutils literal notranslate"><span class="pre">__lt__</span></code>, <code class="docutils literal notranslate"><span class="pre">__gt__</span></code>, <code class="docutils literal notranslate"><span class="pre">__add__</span></code>, <code class="docutils literal notranslate"><span class="pre">__pow__</span></code> and <code class="docutils literal notranslate"><span class="pre">__div__</span></code> operators
- available.</p>
- </div>
- <div align="center" class="align-center"><img alt="_images/collector.svg" src="_images/collector.svg" /></div>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>name</strong> (<em>str</em>) – The name for the Collector.</li>
- <li><strong>positive</strong> (<em>bool</em>) – When <code class="docutils literal notranslate"><span class="pre">True</span></code>, only data from strict positive values will be
- captured. Defaults to <code class="docutils literal notranslate"><span class="pre">False</span></code>.</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">State:</th><td class="field-body"><ul class="first simple">
- <li><strong>min</strong> (<em>numeric</em>) – The minimal value that arrived. When no items passed
- through, this will be INFINITY.</li>
- <li><strong>max</strong> (<em>numeric</em>) – The maximal value that arrived. When no items passed
- through, this will be -INFINITY.</li>
- <li><strong>n</strong> (<em>int</em>) – The amount of items that have arrived.</li>
- <li><strong>sum</strong> (<em>numeric</em>) – The sum of all values that have arrived.</li>
- <li><strong>squares</strong> (<em>numeric</em>) – The sum of the squares of all values that have arrived.</li>
- </ul>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Input Ports:</th><td class="field-body"><ul class="first last simple">
- <li><strong>input</strong> (<em>numeric</em>) – Obtains values.
- Note that INFINITY inputs will shape the data in an undefined way.</li>
- <li><strong>clear</strong> (<em>any</em>) – Clears the contents of the block.</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Collector.plot">
- <code class="descname">plot</code><span class="sig-paren">(</span><em>axis</em>, <em>cols=1</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Collector.plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Collector.plot" title="Permalink to this definition">¶</a></dt>
- <dd><p>Plots the data of the collector.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
- <li><strong>axis</strong> – The <code class="xref py py-mod docutils literal notranslate"><span class="pre">matplotlib</span></code> axis to plot on.</li>
- <li><strong>cols</strong> – How many columns to split the info into.
- Defaults to 1.</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Collector.extTransition">
- <code class="descname">extTransition</code><span class="sig-paren">(</span><em>inputs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Collector.extTransition"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Collector.extTransition" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Collector.clearContents">
- <code class="descname">clearContents</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Collector.clearContents"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Collector.clearContents" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Collector.min">
- <code class="descname">min</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Collector.min"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Collector.min" title="Permalink to this definition">¶</a></dt>
- <dd><p>Conveniance method to obtain the minimal value.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The minimal value that arrived.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Collector.max">
- <code class="descname">max</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Collector.max"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Collector.max" title="Permalink to this definition">¶</a></dt>
- <dd><p>Conveniance method to obtain the maximal value.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The maximal value that arrived.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Collector.count">
- <code class="descname">count</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Collector.count"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Collector.count" title="Permalink to this definition">¶</a></dt>
- <dd><p>Conveniance method to obtain the amount of items.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The amount of items that have arrived.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Collector.sum">
- <code class="descname">sum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Collector.sum"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Collector.sum" title="Permalink to this definition">¶</a></dt>
- <dd><p>Conveniance method to obtain the sum.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The sum of the items that have arrived.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Collector.sumOfSquares">
- <code class="descname">sumOfSquares</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Collector.sumOfSquares"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Collector.sumOfSquares" title="Permalink to this definition">¶</a></dt>
- <dd><p>Conveniance method to obtain the sum of squares.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The sum of squares of the items that have arrived.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Collector.mean">
- <code class="descname">mean</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Collector.mean"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Collector.mean" title="Permalink to this definition">¶</a></dt>
- <dd><p>Get the mean of all values that have arrived.</p>
- <p>It is computed as <span class="math notranslate nohighlight">\(\mu = \dfrac{\sum_i i}{n}\)</span>, with
- <span class="math notranslate nohighlight">\(i\)</span> an item that arrived.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The mean or 0 if no items have arrived.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Collector.variance">
- <code class="descname">variance</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Collector.variance"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Collector.variance" title="Permalink to this definition">¶</a></dt>
- <dd><p>Get the variance of all values that have arrived.</p>
- <p>It is computed as
- <span class="math notranslate nohighlight">\(\sigma^2 = \dfrac{\sum_i i^2}{n} + \mu^2 - \dfrac{2\mu\sum_i i}{n}\)</span>,
- with <span class="math notranslate nohighlight">\(i\)</span> an item that arrived.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The variance or 0 if no items have arrived.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Collector.std">
- <code class="descname">std</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Collector.std"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Collector.std" title="Permalink to this definition">¶</a></dt>
- <dd><p>Get the standard derivation of all values that have arrived.</p>
- <p>It is computed as <span class="math notranslate nohighlight">\(\sigma = \sqrt{v}\)</span>, with
- <span class="math notranslate nohighlight">\(v\)</span> the result from the <a class="reference internal" href="#pypdevsbbl.generic.collectors.Collector.variance" title="pypdevsbbl.generic.collectors.Collector.variance"><code class="xref py py-meth docutils literal notranslate"><span class="pre">variance()</span></code></a> function.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The standard derivation or 0 if no items have arrived.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- </dd></dl>
- <dl class="class">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector">
- <em class="property">class </em><code class="descclassname">pypdevsbbl.generic.collectors.</code><code class="descname">EstimateCollector</code><span class="sig-paren">(</span><em>name: str</em>, <em>b: int = 4</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector" title="Permalink to this definition">¶</a></dt>
- <dd><p>Bases: <a class="reference internal" href="#pypdevsbbl.generic.collectors.BaseCollector" title="pypdevsbbl.generic.collectors.BaseCollector"><code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.generic.collectors.BaseCollector</span></code></a></p>
- <p>Collects information about items that arrive.</p>
- <p>The EstimateCollector block is a block that keeps track of everything that
- passes through, allowing it to yield important information.</p>
- <p>Whereas the <a class="reference internal" href="#pypdevsbbl.generic.collectors.Collector" title="pypdevsbbl.generic.collectors.Collector"><code class="xref py py-class docutils literal notranslate"><span class="pre">Collector</span></code></a> can collect general information data, this
- collector will use the <cite>P-squared Algorithm for Dynamic Calculation of
- Quantiles and Histograms without Scoring Observations</cite>.</p>
- <p>It has a <a class="reference internal" href="#pypdevsbbl.generic.collectors.EstimateCollector.CollectorState" title="pypdevsbbl.generic.collectors.EstimateCollector.CollectorState"><code class="xref py py-class docutils literal notranslate"><span class="pre">CollectorState</span></code></a> class, which is used to handle the information
- of passed-through items. Besides the <code class="docutils literal notranslate"><span class="pre">PythonPDEVS</span></code>-functionality, it also
- has a function that can obtain all boxplot- and histogram-data, called
- <a class="reference internal" href="#pypdevsbbl.generic.collectors.EstimateCollector.CollectorState.histoplot" title="pypdevsbbl.generic.collectors.EstimateCollector.CollectorState.histoplot"><code class="xref py py-meth docutils literal notranslate"><span class="pre">CollectorState.histoplot()</span></code></a>.</p>
- <div class="admonition seealso">
- <p class="first admonition-title">See also</p>
- <ul class="last simple">
- <li><a class="reference internal" href="pypdevsbbl.extra.mathutils.html#pypdevsbbl.extra.mathutils.histogram" title="pypdevsbbl.extra.mathutils.histogram"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pypdevsbbl.extra.mathutils.histogram()</span></code></a></li>
- <li><a class="reference internal" href="pypdevsbbl.extra.mathutils.html#pypdevsbbl.extra.mathutils.histostep" title="pypdevsbbl.extra.mathutils.histostep"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pypdevsbbl.extra.mathutils.histostep()</span></code></a></li>
- </ul>
- </div>
- <div align="center" class="align-center"><img alt="_images/estimate-collector.svg" src="_images/estimate-collector.svg" /></div>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
- <li><strong>name</strong> (<em>str</em>) – The name of the EstimateCollector.</li>
- <li><strong>b</strong> (<em>int</em>) – The amount of cells you want for the histogram.
- 4 is often used, because it yields [min, Q1, median, Q3, max].
- When 1 or less, the histogram will only keep track of the min
- and the max. Defaults to 4.</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">State:</th><td class="field-body"><p class="first">See <a class="reference internal" href="#pypdevsbbl.generic.collectors.EstimateCollector.CollectorState" title="pypdevsbbl.generic.collectors.EstimateCollector.CollectorState"><code class="xref py py-class docutils literal notranslate"><span class="pre">EstimateCollector.CollectorState</span></code></a>.</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Input Ports:</th><td class="field-body"><ul class="first last simple">
- <li><strong>input</strong> (<em>numeric</em>) – Obtains values.
- Note that <code class="docutils literal notranslate"><span class="pre">INFINITY</span></code> inputs will shape the data in an undefined way.</li>
- <li><strong>clear</strong> (<em>any</em>) – Clears the contents of the block.</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="class">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector.CollectorState">
- <em class="property">class </em><code class="descname">CollectorState</code><span class="sig-paren">(</span><em>b=4</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector.CollectorState"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector.CollectorState" title="Permalink to this definition">¶</a></dt>
- <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
- <p>Helperclass for the EstimateCollector.</p>
- <div class="admonition note">
- <p class="first admonition-title">Note</p>
- <p class="last">This class allows for the creation of boxplots and histogram, thanks to the
- <a class="reference internal" href="pypdevsbbl.extra.mathutils.html#module-pypdevsbbl.extra.mathutils" title="pypdevsbbl.extra.mathutils"><code class="xref py py-mod docutils literal notranslate"><span class="pre">pypdevsbbl.extra.mathutils</span></code></a> module. This makes use of the <code class="docutils literal notranslate"><span class="pre">_hq</span></code>, <code class="docutils literal notranslate"><span class="pre">_hq0</span></code>,
- <code class="docutils literal notranslate"><span class="pre">_hn</span></code> and <code class="docutils literal notranslate"><span class="pre">_hn0</span></code> attributes. Changing these will make it so the histogram,
- min, max, median, Q1 and Q3 also changes, so please… <strong>DON’T</strong>.</p>
- </div>
- <p>For the sake of the P^2 algorithm, b (number of cells) is chosen to be 4.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Variables:</th><td class="field-body"><ul class="first simple">
- <li><strong>N</strong> (<em>int</em>) – The total number of items that have arrived.</li>
- <li><strong>N0</strong> (<em>int</em>) – The total number of non-zero items that have arrived.</li>
- <li><strong>_b</strong> (<em>int</em>) – The amount of cells in the histogram.</li>
- <li><strong>_hq</strong> (<em>list</em>) – Datavalues of the bars in the histogram of all items.
- <strong>DON’T CHANGE THIS LIST!</strong></li>
- <li><strong>_hq0</strong> (<em>list</em>) – Datavalues of the bars in the histogram of all non-zero items.
- <strong>DON’T CHANGE THIS LIST!</strong></li>
- <li><strong>_hn</strong> (<em>list</em>) – Positions of the bars in the histogram of all items.
- <strong>DON’T CHANGE THIS LIST!</strong></li>
- <li><strong>_hn0</strong> (<em>list</em>) – Positions of the bars in the histogram of all non-zero items.
- <strong>DON’T CHANGE THIS LIST!</strong></li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first last"><strong>b</strong> (<em>int</em>) – The amount of cells you want for the histogram.
- When 1 or less, the histogram will only keep track of the min and
- the max. Defaults to 4.</p>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector.CollectorState._hstep">
- <code class="descname">_hstep</code><span class="sig-paren">(</span><em>val</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector.CollectorState._hstep"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector.CollectorState._hstep" title="Permalink to this definition">¶</a></dt>
- <dd><p>Do the histostep function of the mathutils on this state.</p>
- <p>Additionally, this will do some size checks to make sure histostep can be executed correctly.
- The general histogram will change.</p>
- <div class="admonition seealso">
- <p class="first admonition-title">See also</p>
- <p class="last"><a class="reference internal" href="pypdevsbbl.extra.mathutils.html#pypdevsbbl.extra.mathutils.histogram" title="pypdevsbbl.extra.mathutils.histogram"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pypdevsbbl.extra.mathutils.histogram()</span></code></a></p>
- </div>
- <div class="admonition warning">
- <p class="first admonition-title">Warning</p>
- <p class="last">Only use this function if you know what you’re doing.</p>
- </div>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>val</strong> (<em>numeric</em>) – A value that passes through and must update the histogram.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector.CollectorState._hstep0">
- <code class="descname">_hstep0</code><span class="sig-paren">(</span><em>val</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector.CollectorState._hstep0"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector.CollectorState._hstep0" title="Permalink to this definition">¶</a></dt>
- <dd><p>Do the histostep function of the mathutils on this state.</p>
- <p>Additionally, this will do some size checks to make sure histostep can be executed correctly.
- The non-zero histogram will change.</p>
- <div class="admonition seealso">
- <p class="first admonition-title">See also</p>
- <p class="last"><a class="reference internal" href="pypdevsbbl.extra.mathutils.html#pypdevsbbl.extra.mathutils.histogram" title="pypdevsbbl.extra.mathutils.histogram"><code class="xref py py-meth docutils literal notranslate"><span class="pre">pypdevsbbl.extra.mathutils.histogram()</span></code></a></p>
- </div>
- <div class="admonition warning">
- <p class="first admonition-title">Warning</p>
- <p class="last">Only use this function if you know what you’re doing.</p>
- </div>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>val</strong> (<em>numeric</em>) – A non-zero value that passes through and must update the histogram.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector.CollectorState.min">
- <code class="descname">min</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector.CollectorState.min"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector.CollectorState.min" title="Permalink to this definition">¶</a></dt>
- <dd><p>Get the smallest value that has arrived.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The smallest value, or INFINITY if no values have arrived yet.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector.CollectorState.min0">
- <code class="descname">min0</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector.CollectorState.min0"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector.CollectorState.min0" title="Permalink to this definition">¶</a></dt>
- <dd><p>Get the smallest non-zero value that has arrived.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The smallest non-zero value, or INFINITY if no values have arrived yet.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector.CollectorState.max">
- <code class="descname">max</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector.CollectorState.max"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector.CollectorState.max" title="Permalink to this definition">¶</a></dt>
- <dd><p>Get the largest value that has arrived.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The largest value, or -INFINITY if no values have arrived yet.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector.CollectorState.max0">
- <code class="descname">max0</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector.CollectorState.max0"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector.CollectorState.max0" title="Permalink to this definition">¶</a></dt>
- <dd><p>Get the largest non-zero value that has arrived.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The largest non-zero value, or -INFINITY if no values have arrived yet.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector.CollectorState.histoplot">
- <code class="descname">histoplot</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector.CollectorState.histoplot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector.CollectorState.histoplot" title="Permalink to this definition">¶</a></dt>
- <dd><p>Obtain all boxplot and histogram data from the state.</p>
- <p>This function is meant to be used as an unpacking of all data and only
- reads from the state. In fact, its result is a <em>copy</em> of the actual data,
- making sure it remains immutable.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><dl class="docutils">
- <dt>A 4-tuple (q, h, q0, h0), where</dt>
- <dd><ul class="first last simple">
- <li>q (list): Datavalues of the bars in the histogram of all items.</li>
- <li>h (list): Heights of the bars in the histogram, w.r.t. the item count.</li>
- <li>q0 (list): Datavalues of the bars in the histogram of all non-zero items.</li>
- <li>h0 (list): Heights of the bars in the histogram, w.r.t. the non-zero item count.</li>
- </ul>
- </dd>
- </dl>
- </td>
- </tr>
- </tbody>
- </table>
- <p class="rubric">Examples</p>
- <ul class="simple">
- <li>To plot the histogram of all items, use q as x-values and h as its y-values.</li>
- <li>To plot the histogram of all non-zero items, use q0 as x-values and h0 as its y-values.</li>
- <li>To plot the boxplot of all items, unpack q and use it as input in the
- mathutils.draw_boxplot function (and plot it thereafter).</li>
- <li>To plot the boxplot of all non-zero items, unpack q0 and use it as input in the
- mathutils.draw_boxplot function (and plot it thereafter).</li>
- </ul>
- </dd></dl>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector.plot">
- <code class="descname">plot</code><span class="sig-paren">(</span><em>axis</em>, <em>type='hist'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector.plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector.plot" title="Permalink to this definition">¶</a></dt>
- <dd><p>Plots the data of the collector.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
- <li><strong>axis</strong> – The <code class="xref py py-mod docutils literal notranslate"><span class="pre">matplotlib</span></code> axis to plot on.</li>
- <li><strong>type</strong> – <p>A string indicating which plot to create.
- Defaults to <cite>‘hist’</cite>.</p>
- <p>For the histogram, use any of
- <code class="docutils literal notranslate"><span class="pre">['hist',</span> <span class="pre">'histogram',</span> <span class="pre">'bars',</span> <span class="pre">'H',</span> <span class="pre">'h',</span> <span class="pre">0]</span></code>.</p>
- <p>For the boxplot, use any of
- <code class="docutils literal notranslate"><span class="pre">['bxpt',</span> <span class="pre">'boxplot',</span> <span class="pre">'box',</span> <span class="pre">'B',</span> <span class="pre">'b',</span> <span class="pre">1]</span></code></p>
- </li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector.plot_boxplot">
- <code class="descname">plot_boxplot</code><span class="sig-paren">(</span><em>axis</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector.plot_boxplot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector.plot_boxplot" title="Permalink to this definition">¶</a></dt>
- <dd><p>Plots the data of the collector as a boxplot.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>axis</strong> – The <code class="xref py py-mod docutils literal notranslate"><span class="pre">matplotlib</span></code> axis to plot on.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector.plot_histogram">
- <code class="descname">plot_histogram</code><span class="sig-paren">(</span><em>axis</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector.plot_histogram"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector.plot_histogram" title="Permalink to this definition">¶</a></dt>
- <dd><p>Plots the data of the collector as a histogram.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>axis</strong> – The <code class="xref py py-mod docutils literal notranslate"><span class="pre">matplotlib</span></code> axis to plot on.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector.extTransition">
- <code class="descname">extTransition</code><span class="sig-paren">(</span><em>inputs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector.extTransition"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector.extTransition" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.EstimateCollector.clearContents">
- <code class="descname">clearContents</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#EstimateCollector.clearContents"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.EstimateCollector.clearContents" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- </dd></dl>
- <dl class="class">
- <dt id="pypdevsbbl.generic.collectors.TableCollector">
- <em class="property">class </em><code class="descclassname">pypdevsbbl.generic.collectors.</code><code class="descname">TableCollector</code><span class="sig-paren">(</span><em>name: str</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#TableCollector"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.TableCollector" title="Permalink to this definition">¶</a></dt>
- <dd><p>Bases: <a class="reference internal" href="#pypdevsbbl.generic.collectors.BaseCollector" title="pypdevsbbl.generic.collectors.BaseCollector"><code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.generic.collectors.BaseCollector</span></code></a></p>
- <p>Builds a table of all collected data.</p>
- <p>Contrary to the other collectors, the TableCollector will create
- a table from ALL data that arrived. This implies that the usage
- of this component will allocate a lot of memory and, if you’re using
- mere numerical data, will be overkill. Nevertheless, if your data is
- not numerical, or you require to know when certain data arrived, this
- collector is the one you need.</p>
- <p>For every item that arrives, it will add another record in a table,
- which is accessible as a dictionary (see the <a class="reference internal" href="#pypdevsbbl.generic.collectors.TableCollector.table" title="pypdevsbbl.generic.collectors.TableCollector.table"><code class="xref py py-meth docutils literal notranslate"><span class="pre">table()</span></code></a> method).</p>
- <div align="center" class="align-center"><img alt="_images/table-collector.svg" src="_images/table-collector.svg" /></div>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>name</strong> (<em>str</em>) – The name for the TableizeCollector.</p>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">State:</th><td class="field-body"><p class="first"><strong>table</strong> (<em>list</em>) – The table, as a pair/tuple of (<cite>elapsed time</cite>, <cite>item</cite>)</p>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Input Ports:</th><td class="field-body"><ul class="first last simple">
- <li><strong>input</strong> (<em>any</em>) – Obtains values.</li>
- <li><strong>clear</strong> (<em>any</em>) – Clears the contents of the block.</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.TableCollector.clearContents">
- <code class="descname">clearContents</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#TableCollector.clearContents"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.TableCollector.clearContents" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.TableCollector.extTransition">
- <code class="descname">extTransition</code><span class="sig-paren">(</span><em>inputs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#TableCollector.extTransition"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.TableCollector.extTransition" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.TableCollector.plot">
- <code class="descname">plot</code><span class="sig-paren">(</span><em>axis</em>, <em>kwargs=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#TableCollector.plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.TableCollector.plot" title="Permalink to this definition">¶</a></dt>
- <dd><p>Plots the data of the collector.</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
- <li><strong>axis</strong> – The <code class="xref py py-mod docutils literal notranslate"><span class="pre">matplotlib</span></code> axis to plot on.</li>
- <li><strong>kwargs</strong> – Dictionary of keyword arguments to pass to the
- <code class="xref py py-meth docutils literal notranslate"><span class="pre">matplotlib.axes.Axes.plot()</span></code> function.
- Defaults to <code class="docutils literal notranslate"><span class="pre">None</span></code> (= no arguments).</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.TableCollector.table">
- <code class="descname">table</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#TableCollector.table"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.TableCollector.table" title="Permalink to this definition">¶</a></dt>
- <dd><p>Fetches the table that was built upto this point in time.</p>
- <dl class="docutils">
- <dt>This table will be returned as a dict, in the form of</dt>
- <dd><cite>elapsed time</cite> -> <cite>item</cite></dd>
- </dl>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">The table.</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- </dd></dl>
- <dl class="class">
- <dt id="pypdevsbbl.generic.collectors.Counter">
- <em class="property">class </em><code class="descclassname">pypdevsbbl.generic.collectors.</code><code class="descname">Counter</code><span class="sig-paren">(</span><em>name: str</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Counter"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Counter" title="Permalink to this definition">¶</a></dt>
- <dd><p>Bases: <a class="reference internal" href="#pypdevsbbl.generic.collectors.BaseCollector" title="pypdevsbbl.generic.collectors.BaseCollector"><code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.generic.collectors.BaseCollector</span></code></a></p>
- <p>Counts the amount of arrived messages.</p>
- <div align="center" class="align-center"><img alt="_images/counter.svg" src="_images/counter.svg" /></div>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>name</strong> (<em>str</em>) – The name of the block.</p>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">State:</th><td class="field-body"><ul class="first simple">
- <li><strong>item</strong> (<em>any</em>) – The current item.</li>
- <li><strong>count</strong> (<em>int</em>) – The current count.</li>
- </ul>
- </td>
- </tr>
- <tr class="field-odd field"><th class="field-name">Input Ports:</th><td class="field-body"><ul class="first simple">
- <li><strong>input</strong> (<em>any</em>) – The items that need to be counted.</li>
- <li><strong>clear</strong> (<em>any</em>) – Clears the contents of the block.</li>
- </ul>
- </td>
- </tr>
- <tr class="field-even field"><th class="field-name">Output Ports:</th><td class="field-body"><ul class="first last simple">
- <li><strong>output</strong> (<em>any</em>) – The item that was counted.</li>
- <li><strong>count</strong> (<em>int</em>) – How many items have been counted, including the one
- outputted on the <cite>output</cite> port.</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Counter.plot">
- <code class="descname">plot</code><span class="sig-paren">(</span><em>axis</em>, <em>pos=(0.5</em>, <em>0.5)</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Counter.plot"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Counter.plot" title="Permalink to this definition">¶</a></dt>
- <dd><p>Plots the counted info</p>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
- <li><strong>axis</strong> – The <code class="xref py py-mod docutils literal notranslate"><span class="pre">matplotlib</span></code> axis to plot on.</li>
- <li><strong>pos</strong> – The position to plot the data. Must be
- in [0, 1] for both x and y to be visible.
- Defaults to <code class="docutils literal notranslate"><span class="pre">(0.5,</span> <span class="pre">0.5)</span></code>.</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Counter.clearContents">
- <code class="descname">clearContents</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Counter.clearContents"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Counter.clearContents" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Counter.timeAdvance">
- <code class="descname">timeAdvance</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Counter.timeAdvance"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Counter.timeAdvance" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Counter.extTransition">
- <code class="descname">extTransition</code><span class="sig-paren">(</span><em>inputs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Counter.extTransition"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Counter.extTransition" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Counter.outputFnc">
- <code class="descname">outputFnc</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Counter.outputFnc"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Counter.outputFnc" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.generic.collectors.Counter.intTransition">
- <code class="descname">intTransition</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/generic/collectors.html#Counter.intTransition"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.generic.collectors.Counter.intTransition" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- </dd></dl>
- </div>
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <h4>Previous topic</h4>
- <p class="topless"><a href="pypdevsbbl.generic.html"
- title="previous chapter">pypdevsbbl.generic package</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="pypdevsbbl.generic.generators.html"
- title="next chapter">pypdevsbbl.generic.generators module</a></p>
- <div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <div class="searchformwrapper">
- <form class="search" action="search.html" method="get">
- <input type="text" name="q" />
- <input type="submit" value="Go" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- </div>
- </div>
- <script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- </div>
- <div class="clearer"></div>
- </div>
- <div class="related" role="navigation" aria-label="related navigation">
- <h3>Navigation</h3>
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="genindex.html" title="General Index"
- >index</a></li>
- <li class="right" >
- <a href="py-modindex.html" title="Python Module Index"
- >modules</a> |</li>
- <li class="right" >
- <a href="pypdevsbbl.generic.generators.html" title="pypdevsbbl.generic.generators module"
- >next</a> |</li>
- <li class="right" >
- <a href="pypdevsbbl.generic.html" title="pypdevsbbl.generic package"
- >previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">Python(P)DEVS-BBL documentation</a> »</li>
- <li class="nav-item nav-item-1"><a href="pypdevsbbl.html" >pypdevsbbl package</a> »</li>
- <li class="nav-item nav-item-2"><a href="pypdevsbbl.generic.html" >pypdevsbbl.generic package</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright 2020, Randy Paredis.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.5.
- </div>
- </body>
- </html>
|