| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- <!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.FootprintTracer 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.tracers.PlotTracer module" href="pypdevsbbl.tracers.PlotTracer.html" />
- <link rel="prev" title="pypdevsbbl.tracers package" href="pypdevsbbl.tracers.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.PlotTracer.html" title="pypdevsbbl.tracers.PlotTracer module"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="pypdevsbbl.tracers.html" title="pypdevsbbl.tracers 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.tracers.html" accesskey="U">pypdevsbbl.tracers 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.FootprintTracer">
- <span id="pypdevsbbl-tracers-footprinttracer-module"></span><h1>pypdevsbbl.tracers.FootprintTracer module<a class="headerlink" href="#module-pypdevsbbl.tracers.FootprintTracer" title="Permalink to this headline">¶</a></h1>
- <p>This file contains a tracer that can can gather the execution cost of a simulation.</p>
- <p>The execution cost is either measured at the input port(s) or the output port(s) of a
- block. For readability, choose one and keep it consistent whenever possible.</p>
- <dl class="class">
- <dt id="pypdevsbbl.tracers.FootprintTracer.FootprintTracer">
- <em class="property">class </em><code class="descclassname">pypdevsbbl.tracers.FootprintTracer.</code><code class="descname">FootprintTracer</code><span class="sig-paren">(</span><em>uid</em>, <em>server</em>, <em>filename</em>, <em>name</em>, <em>mapping</em>, <em>full=True</em>, <em>cpi=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers/FootprintTracer.html#FootprintTracer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.FootprintTracer.FootprintTracer" title="Permalink to this definition">¶</a></dt>
- <dd><p>Bases: <a class="reference internal" href="pypdevsbbl.tracers.html#pypdevsbbl.tracers.BaseTracer" title="pypdevsbbl.tracers.BaseTracer"><code class="xref py py-class docutils literal notranslate"><span class="pre">pypdevsbbl.tracers.BaseTracer</span></code></a></p>
- <p>Gathers cost information of the simulation.</p>
- <p>The provided cost can be whatever is required in the current simulation.
- It can be the carbon footprint, the pricetag or even the amount of
- electricity. For this reason, multiple <a class="reference internal" href="#pypdevsbbl.tracers.FootprintTracer.FootprintTracer" title="pypdevsbbl.tracers.FootprintTracer.FootprintTracer"><code class="xref py py-class docutils literal notranslate"><span class="pre">FootprintTracer</span></code></a> may be
- registered to the simulation. Give each <a class="reference internal" href="#pypdevsbbl.tracers.FootprintTracer.FootprintTracer" title="pypdevsbbl.tracers.FootprintTracer.FootprintTracer"><code class="xref py py-class docutils literal notranslate"><span class="pre">FootprintTracer</span></code></a> a name
- to correctly associate the traced cost with the real-life consequences.</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.
- Will be set automatically.</li>
- <li><strong>server</strong> – The server that runs the distributed simulation.
- Will be set automatically.</li>
- <li><strong>filename</strong> (<em>str</em>) – 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>
- <li><strong>name</strong> (<em>str</em>) – The name of the <a class="reference internal" href="#pypdevsbbl.tracers.FootprintTracer.FootprintTracer" title="pypdevsbbl.tracers.FootprintTracer.FootprintTracer"><code class="xref py py-class docutils literal notranslate"><span class="pre">FootprintTracer</span></code></a>. Used to
- differentiate the results of different instances.</li>
- <li><strong>mapping</strong> (<em>dict</em>) – A mapping from a port of a building block to a
- number or a function that returns a number. This
- number represents the cost for each item that is
- inputted or outputted on that port. The function
- takes the item as an argument. E.g. an object with
- a weight of 60 kilograms might be more expensive
- when compared to an object that weighs 10 kilograms.</li>
- <li><strong>full</strong> (<em>bool</em>) – When <code class="docutils literal notranslate"><span class="pre">True</span></code>, output the full trace. Otherwise,
- only output the results.</li>
- <li><strong>cpi</strong> (<em>bool</em>) – Whether or not to print the cost per item at the
- end. These costs will be sorted with the largest
- cost first. Defaults to <code class="docutils literal notranslate"><span class="pre">False</span></code>.</li>
- </ul>
- </td>
- </tr>
- </tbody>
- </table>
- <dl class="method">
- <dt id="pypdevsbbl.tracers.FootprintTracer.FootprintTracer.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/FootprintTracer.html#FootprintTracer.startTracer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.FootprintTracer.FootprintTracer.startTracer" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.tracers.FootprintTracer.FootprintTracer.stopTracer">
- <code class="descname">stopTracer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers/FootprintTracer.html#FootprintTracer.stopTracer"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.FootprintTracer.FootprintTracer.stopTracer" title="Permalink to this definition">¶</a></dt>
- <dd></dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.tracers.FootprintTracer.FootprintTracer.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/FootprintTracer.html#FootprintTracer.traceExternal"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.FootprintTracer.FootprintTracer.traceExternal" title="Permalink to this definition">¶</a></dt>
- <dd><p>Traces all items arriving on input ports.</p>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.tracers.FootprintTracer.FootprintTracer.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/FootprintTracer.html#FootprintTracer.traceInternal"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.FootprintTracer.FootprintTracer.traceInternal" title="Permalink to this definition">¶</a></dt>
- <dd><p>Traces all items arriving on output ports.</p>
- </dd></dl>
- <dl class="method">
- <dt id="pypdevsbbl.tracers.FootprintTracer.FootprintTracer.total">
- <code class="descname">total</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pypdevsbbl/tracers/FootprintTracer.html#FootprintTracer.total"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pypdevsbbl.tracers.FootprintTracer.FootprintTracer.total" title="Permalink to this definition">¶</a></dt>
- <dd><p>Obtain the total footprint of the simulation.</p>
- </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.tracers.html"
- title="previous chapter">pypdevsbbl.tracers package</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="pypdevsbbl.tracers.PlotTracer.html"
- title="next chapter">pypdevsbbl.tracers.PlotTracer 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.PlotTracer.html" title="pypdevsbbl.tracers.PlotTracer module"
- >next</a> |</li>
- <li class="right" >
- <a href="pypdevsbbl.tracers.html" title="pypdevsbbl.tracers 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.tracers.html" >pypdevsbbl.tracers 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>
|