| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- <!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.tracers package — 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.tracers.FootprintTracer module" href="pypdevsbbl.tracers.FootprintTracer.html" />
- <link rel="prev" title="pypdevsbbl.generic.transformers module" href="pypdevsbbl.generic.transformers.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.tracers.FootprintTracer.html" title="pypdevsbbl.tracers.FootprintTracer module"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="pypdevsbbl.generic.transformers.html" title="pypdevsbbl.generic.transformers module"
- 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" accesskey="U">pypdevsbbl 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.tracers">
- <span id="pypdevsbbl-tracers-package"></span><h1>pypdevsbbl.tracers package<a class="headerlink" href="#module-pypdevsbbl.tracers" title="Permalink to this headline">¶</a></h1>
- <p>Create and use tracers for your models.</p>
- <p>This file provides a basic tracer (<a class="reference internal" href="#pypdevsbbl.tracers.BaseTracer" title="pypdevsbbl.tracers.BaseTracer"><code class="xref py py-class docutils literal notranslate"><span class="pre">BaseTracer</span></code></a>) that can
- be used as a superclass for all custom tracers. Furthermore, a
- <a class="reference internal" href="#pypdevsbbl.tracers.setTracer" title="pypdevsbbl.tracers.setTracer"><code class="xref py py-meth docutils literal notranslate"><span class="pre">setTracer()</span></code></a> function is provided to allow for more complex
- tracing possibilities.</p>
- <p>The subpackage also provides a few commonly used tracers in
- production-based models.</p>
- <dl class="data">
- <dt id="pypdevsbbl.tracers._hashes">
- <code class="descclassname">pypdevsbbl.tracers.</code><code class="descname">_hashes</code><em class="property"> = {}</em><a class="headerlink" href="#pypdevsbbl.tracers._hashes" title="Permalink to this definition">¶</a></dt>
- <dd><p>Helper variable that will allow the <a class="reference internal" href="#pypdevsbbl.tracers.setTracer" title="pypdevsbbl.tracers.setTracer"><code class="xref py py-meth docutils literal notranslate"><span class="pre">setTracer()</span></code></a> method to work.</p>
- <p>It is a dict of the <code class="xref py py-meth docutils literal notranslate"><span class="pre">id()</span></code>-value of a tracer and its arguments.</p>
- </dd></dl>
- <dl class="function">
- <dt id="pypdevsbbl.tracers._hashedTracer">
- <code class="descclassname">pypdevsbbl.tracers.</code><code class="descname">_hashedTracer</code><span class="sig-paren">(</span><em>uid</em>, <em>server</em>, <em>tracer</em>, <em>*hargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers.html#_hashedTracer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers._hashedTracer" title="Permalink to this definition">¶</a></dt>
- <dd><p>Helper function to set the tracer.</p>
- </dd></dl>
- <dl class="function">
- <dt id="pypdevsbbl.tracers.setTracer">
- <code class="descclassname">pypdevsbbl.tracers.</code><code class="descname">setTracer</code><span class="sig-paren">(</span><em>simulator</em>, <em>tracerclass</em>, <em>*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers.html#setTracer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.setTracer" title="Permalink to this definition">¶</a></dt>
- <dd><p>Assigns a custom tracer with variable arguments.</p>
- <p>In <cite>PythonPDEVS</cite>’ custom tracer registration process, all
- additional arguments are casted to a string before passed
- to an <code class="xref py py-meth docutils literal notranslate"><span class="pre">eval()</span></code> function call. Not all objects can be
- cast to a string and still retain their information.</p>
- <p>This function allows you to set a tracer with custom
- arguments that cannot be cast to a string.</p>
- <div class="admonition seealso">
- <p class="first admonition-title">See also</p>
- <p class="last"><code class="file docutils literal notranslate"><span class="pre">src/dependencies/pythonpdevs/src/pypdevs/tracer.py:40-42</span></code></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"><ul class="first last simple">
- <li><strong>simulator</strong> – The simulator to set the tracer on.</li>
- <li><strong>tracerclass</strong> – The tracer class to set as an
- instatiatable.</li>
- <li><strong>*args</strong> – All arguments to pass to the tracer’s
- <code class="xref py py-meth docutils literal notranslate"><span class="pre">__init__()</span></code>-call, <strong>except</strong> the
- <code class="docutils literal notranslate"><span class="pre">uid</span></code> and the <code class="docutils literal notranslate"><span class="pre">server</span></code>.</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="function">
- <dt id="pypdevsbbl.tracers.superTrace">
- <code class="descclassname">pypdevsbbl.tracers.</code><code class="descname">superTrace</code><span class="sig-paren">(</span><em>server</em>, <em>uid</em>, <em>model</em>, <em>args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers.html#superTrace"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.superTrace" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="class">
- <dt id="pypdevsbbl.tracers.BaseTracer">
- <em class="property">class </em><code class="descclassname">pypdevsbbl.tracers.</code><code class="descname">BaseTracer</code><span class="sig-paren">(</span><em>uid</em>, <em>server</em>, <em>filename</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers.html#BaseTracer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.BaseTracer" 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>Base for all custom tracers.</p>
- <p>Implements all required methods for a custom tracer.</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>uid</strong> – A unique identifier for distributed simulation.
- Can be ignored, but must be the first argument!</li>
- <li><strong>server</strong> – The server that runs the distributed simulation.
- Can be ignored, but must be the second argument!</li>
- <li><strong>filename</strong> – The name of the file to write the results to.
- When <code class="docutils literal notranslate"><span class="pre">None</span></code>, all results will be written to the
- standard output.</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="method">
- <dt id="pypdevsbbl.tracers.BaseTracer.startTracer">
- <code class="descname">startTracer</code><span class="sig-paren">(</span><em>recover</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers.html#BaseTracer.startTracer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.BaseTracer.startTracer" title="Permalink to this definition">¶</a></dt>
- <dd><p>Starts the Tracer</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>recover</strong> (<em>bool</em>) – Represents whether or not this is a recovered call.
- E.g., should the file be overwritten (<code class="docutils literal notranslate"><span class="pre">False</span></code>) or
- appended to (<code class="docutils literal notranslate"><span class="pre">True</span></code>)?</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.tracers.BaseTracer.stopTracer">
- <code class="descname">stopTracer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers.html#BaseTracer.stopTracer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.BaseTracer.stopTracer" title="Permalink to this definition">¶</a></dt>
- <dd><p>Stops the tracer (e.g., flush the file)</p>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.tracers.BaseTracer.trace">
- <code class="descname">trace</code><span class="sig-paren">(</span><em>*text</em>, <em>sep=' '</em>, <em>end=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers.html#BaseTracer.trace"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.BaseTracer.trace" title="Permalink to this definition">¶</a></dt>
- <dd><p>Actual tracing function.</p>
- <p>This function sort of works like the “print” function,
- but only takes strings or bytes as arguments.</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>text</strong> – The text to trace.</li>
- <li><strong>sep</strong> (<em>str</em>) – The text separator. Defaults to a space.</li>
- <li><strong>end</strong> (<em>str</em>) – The ending token of the stream to write.
- Defaults to the empty string.</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.tracers.BaseTracer.traceInternal">
- <code class="descname">traceInternal</code><span class="sig-paren">(</span><em>aDEVS</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers.html#BaseTracer.traceInternal"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.BaseTracer.traceInternal" title="Permalink to this definition">¶</a></dt>
- <dd><p>Called for each atomic DEVS model that does an internal transition.</p>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.tracers.BaseTracer.traceExternal">
- <code class="descname">traceExternal</code><span class="sig-paren">(</span><em>aDEVS</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers.html#BaseTracer.traceExternal"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.BaseTracer.traceExternal" title="Permalink to this definition">¶</a></dt>
- <dd><p>Called for each atomic DEVS model that does an external transition.</p>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.tracers.BaseTracer.traceConfluent">
- <code class="descname">traceConfluent</code><span class="sig-paren">(</span><em>aDEVS</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers.html#BaseTracer.traceConfluent"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.BaseTracer.traceConfluent" title="Permalink to this definition">¶</a></dt>
- <dd><p>Called for each atomic DEVS model that does a confluent transition.</p>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.tracers.BaseTracer.traceInit">
- <code class="descname">traceInit</code><span class="sig-paren">(</span><em>aDEVS</em>, <em>t</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers.html#BaseTracer.traceInit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.BaseTracer.traceInit" title="Permalink to this definition">¶</a></dt>
- <dd><p>Called upon initialization of a model.</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>t</strong> (<em>numeric</em>) – The time at which the model commences (likely 0).</td>
- </tr>
- </tbody>
- </table>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.tracers.BaseTracer.traceUser">
- <code class="descname">traceUser</code><span class="sig-paren">(</span><em>time</em>, <em>aDEVS</em>, <em>variable</em>, <em>value</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers.html#BaseTracer.traceUser"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.BaseTracer.traceUser" title="Permalink to this definition">¶</a></dt>
- <dd><p>Called upon so-called <em>god events</em> during debugging.</p>
- <p>A <em>god event</em> is an event where a user manually alters the state of an
- atomic DEVS instance.</p>
- </dd></dl>
- </dd></dl>
- <div class="section" id="submodules">
- <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
- <div class="toctree-wrapper compound">
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="pypdevsbbl.tracers.FootprintTracer.html">pypdevsbbl.tracers.FootprintTracer module</a></li>
- <li class="toctree-l1"><a class="reference internal" href="pypdevsbbl.tracers.PlotTracer.html">pypdevsbbl.tracers.PlotTracer module</a></li>
- <li class="toctree-l1"><a class="reference internal" href="pypdevsbbl.tracers.ProfileTracer.html">pypdevsbbl.tracers.ProfileTracer module</a></li>
- <li class="toctree-l1"><a class="reference internal" href="pypdevsbbl.tracers.StatisticsTracer.html">pypdevsbbl.tracers.StatisticsTracer module</a></li>
- </ul>
- </div>
- </div>
- </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.transformers.html"
- title="previous chapter">pypdevsbbl.generic.transformers module</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="pypdevsbbl.tracers.FootprintTracer.html"
- title="next chapter">pypdevsbbl.tracers.FootprintTracer 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.tracers.FootprintTracer.html" title="pypdevsbbl.tracers.FootprintTracer module"
- >next</a> |</li>
- <li class="right" >
- <a href="pypdevsbbl.generic.transformers.html" title="pypdevsbbl.generic.transformers module"
- >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>
- </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>
|