123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405 |
- <!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="Content-Type" content="text/html; charset=utf-8" />
-
- <title>How to run — Modelverse 0.4.0 documentation</title>
-
- <link rel="stylesheet" href="_static/classic.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: './',
- VERSION: '0.4.0',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- </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>
- <link rel="top" title="Modelverse 0.4.0 documentation" href="index.html" />
- <link rel="next" title="Action Language" href="actionlanguage.html" />
- <link rel="prev" title="Modelverse components" href="components.html" />
- </head>
- <body role="document">
- <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="actionlanguage.html" title="Action Language"
- accesskey="N">next</a> |</li>
- <li class="right" >
- <a href="components.html" title="Modelverse components"
- accesskey="P">previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">Modelverse 0.4.0 documentation</a> »</li>
- </ul>
- </div>
- <div class="document">
- <div class="documentwrapper">
- <div class="bodywrapper">
- <div class="body" role="main">
-
- <div class="section" id="how-to-run">
- <h1>How to run<a class="headerlink" href="#how-to-run" title="Permalink to this headline">¶</a></h1>
- <p>Running the Modelverse is all done through the use of scripts to coordinate the three different projects.</p>
- <p>The following scripts are included by default.</p>
- <div class="section" id="check-objects-py">
- <h2>check_objects.py<a class="headerlink" href="#check-objects-py" title="Permalink to this headline">¶</a></h2>
- <p>Checks whether all compiled objects can be found, and if their symbol table does not contain undefined references.
- This script cannot be executed directly and is only a helper.</p>
- </div>
- <div class="section" id="compile-py">
- <h2>compile.py<a class="headerlink" href="#compile-py" title="Permalink to this headline">¶</a></h2>
- <p>Compiles the provided code with the selected mode.
- This should also not be called by end-users, though it is possible.</p>
- <p>Invocation:</p>
- <div class="highlight-default"><div class="highlight"><pre><span class="n">python</span> <span class="n">scripts</span><span class="o">/</span><span class="nb">compile</span><span class="o">.</span><span class="n">py</span> <span class="n">address</span> <span class="n">file</span> <span class="n">username</span> <span class="nb">object</span> <span class="n">mode</span>
- </pre></div>
- </div>
- <table border="1" class="docutils">
- <colgroup>
- <col width="19%" />
- <col width="52%" />
- <col width="29%" />
- </colgroup>
- <thead valign="bottom">
- <tr class="row-odd"><th class="head">Parameter name</th>
- <th class="head">Description</th>
- <th class="head">Example</th>
- </tr>
- </thead>
- <tbody valign="top">
- <tr class="row-even"><td>address</td>
- <td>Address of the Modelverse</td>
- <td><a class="reference external" href="http://localhost:8001">http://localhost:8001</a></td>
- </tr>
- <tr class="row-odd"><td>file</td>
- <td>File to be compiled</td>
- <td>file.alc</td>
- </tr>
- <tr class="row-even"><td>username</td>
- <td>Username to use when compiling</td>
- <td>test_user</td>
- </tr>
- <tr class="row-odd"><td>object</td>
- <td>Object name to export to</td>
- <td>object.o</td>
- </tr>
- <tr class="row-even"><td>mode</td>
- <td>Either CO (constructors) or PO (graph)</td>
- <td>PO</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="execute-model-py">
- <h2>execute_model.py<a class="headerlink" href="#execute-model-py" title="Permalink to this headline">¶</a></h2>
- <p>Compile a model and action language files together, executing the action language.
- First, all models are added, and then the action language is executed, starting at function “main”.
- Models being created are temporary, so they need to be exported before they can be accessed in the action language.</p>
- <p>Invocation:</p>
- <div class="highlight-default"><div class="highlight"><pre><span class="n">python</span> <span class="n">scripts</span><span class="o">/</span><span class="n">execute_model</span><span class="o">.</span><span class="n">py</span> <span class="n">address</span> <span class="n">username</span> <span class="n">file1</span> <span class="n">file2</span> <span class="o">...</span>
- </pre></div>
- </div>
- <table border="1" class="docutils">
- <colgroup>
- <col width="19%" />
- <col width="53%" />
- <col width="28%" />
- </colgroup>
- <thead valign="bottom">
- <tr class="row-odd"><th class="head">Parameter name</th>
- <th class="head">Description</th>
- <th class="head">Example</th>
- </tr>
- </thead>
- <tbody valign="top">
- <tr class="row-even"><td>address</td>
- <td>Address of the Modelverse</td>
- <td><a class="reference external" href="http://localhost:8001">http://localhost:8001</a></td>
- </tr>
- <tr class="row-odd"><td>username</td>
- <td>Username to use when compiling</td>
- <td>test</td>
- </tr>
- <tr class="row-even"><td>file</td>
- <td>File to compile (either .mvc or .alc)</td>
- <td>test.alc</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="fix-files-py">
- <h2>fix_files.py<a class="headerlink" href="#fix-files-py" title="Permalink to this headline">¶</a></h2>
- <p>Fix some files that must be kept identical.
- This is sometimes necessary because if a file gets updated, the changes must propagate.
- Usually, this is done with symbolic links or similar, but there does not seem to be a nice cross-platform way of doing this in Git.</p>
- <p>Invocation:</p>
- <div class="highlight-default"><div class="highlight"><pre><span class="n">python</span> <span class="n">scripts</span><span class="o">/</span><span class="n">fix_files</span><span class="o">.</span><span class="n">py</span>
- </pre></div>
- </div>
- </div>
- <div class="section" id="flush-compiler-caches-py">
- <h2>flush_compiler_caches.py<a class="headerlink" href="#flush-compiler-caches-py" title="Permalink to this headline">¶</a></h2>
- <p>Clear all cached files from the compiler.
- The compiler will automatically reparse files when they have been changed, but changes to the compiler code itself will not be detected.
- When changing the compiler, this file should be executed to flush these file caches.</p>
- <p>Invocation:</p>
- <div class="highlight-default"><div class="highlight"><pre><span class="n">python</span> <span class="n">scripts</span><span class="o">/</span><span class="n">flush_compiler_caches</span><span class="o">.</span><span class="n">py</span>
- </pre></div>
- </div>
- </div>
- <div class="section" id="generate-bootstrap-py">
- <h2>generate_bootstrap.py<a class="headerlink" href="#generate-bootstrap-py" title="Permalink to this headline">¶</a></h2>
- <p>Creates the bootstrap file for the Modelverse State.
- This creates the necessary initial graph which contains links to all primitive code that is executed by the Modelverse before users can communicate with it.
- Generally, this needs to be executed when any file in the <em>bootstrap/</em> folder is modified.
- Compilation is fairly smart, only recompiling parts that have changed.</p>
- <p>Invocation:</p>
- <div class="highlight-default"><div class="highlight"><pre><span class="n">python</span> <span class="n">scripts</span><span class="o">/</span><span class="n">generate_bootstrap</span><span class="o">.</span><span class="n">py</span>
- </pre></div>
- </div>
- </div>
- <div class="section" id="link-and-load-py">
- <h2>link_and_load.py<a class="headerlink" href="#link-and-load-py" title="Permalink to this headline">¶</a></h2>
- <p>This takes a set of objects in the Modelverse, links them together in a single “executable” and executes it immediately.
- Generally not needed by end-users.</p>
- <p>Invocation:</p>
- <div class="highlight-default"><div class="highlight"><pre><span class="n">python</span> <span class="n">scripts</span><span class="o">/</span><span class="n">link_and_load</span><span class="o">.</span><span class="n">py</span> <span class="n">address</span> <span class="n">username</span> <span class="n">object1</span> <span class="n">object2</span> <span class="o">...</span>
- </pre></div>
- </div>
- <table border="1" class="docutils">
- <colgroup>
- <col width="19%" />
- <col width="53%" />
- <col width="28%" />
- </colgroup>
- <thead valign="bottom">
- <tr class="row-odd"><th class="head">Parameter name</th>
- <th class="head">Description</th>
- <th class="head">Example</th>
- </tr>
- </thead>
- <tbody valign="top">
- <tr class="row-even"><td>address</td>
- <td>Address of the Modelverse</td>
- <td><a class="reference external" href="http://localhost:8001">http://localhost:8001</a></td>
- </tr>
- <tr class="row-odd"><td>username</td>
- <td>Username to use when compiling</td>
- <td>test</td>
- </tr>
- <tr class="row-even"><td>object</td>
- <td>File to compile (either .mvc or .alc)</td>
- <td>test.alc</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="make-all-py">
- <h2>make_all.py<a class="headerlink" href="#make-all-py" title="Permalink to this headline">¶</a></h2>
- <p>Compile a set of files and executes them immediately.
- This uses constructors by default, which is the most elegant, but also the slowest.</p>
- <p>Invocation:</p>
- <div class="highlight-default"><div class="highlight"><pre><span class="n">python</span> <span class="n">scripts</span><span class="o">/</span><span class="n">make_all</span><span class="o">.</span><span class="n">py</span> <span class="n">address</span> <span class="n">username</span> <span class="n">file1</span> <span class="n">file2</span> <span class="o">...</span>
- </pre></div>
- </div>
- <table border="1" class="docutils">
- <colgroup>
- <col width="19%" />
- <col width="53%" />
- <col width="28%" />
- </colgroup>
- <thead valign="bottom">
- <tr class="row-odd"><th class="head">Parameter name</th>
- <th class="head">Description</th>
- <th class="head">Example</th>
- </tr>
- </thead>
- <tbody valign="top">
- <tr class="row-even"><td>address</td>
- <td>Address of the Modelverse</td>
- <td><a class="reference external" href="http://localhost:8001">http://localhost:8001</a></td>
- </tr>
- <tr class="row-odd"><td>username</td>
- <td>Username to use when compiling</td>
- <td>test</td>
- </tr>
- <tr class="row-even"><td>file</td>
- <td>File to compile (either .mvc or .alc)</td>
- <td>test.alc</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="make-parallel-py">
- <h2>make_parallel.py<a class="headerlink" href="#make-parallel-py" title="Permalink to this headline">¶</a></h2>
- <p>A parallel version of make_all.py.
- This uses the direct graph compilation, and compiles these graphs in parallel.
- This is much faster than make_all, though much less elegant.</p>
- <p>Invocation:</p>
- <div class="highlight-default"><div class="highlight"><pre><span class="n">python</span> <span class="n">scripts</span><span class="o">/</span><span class="n">make_parallel</span><span class="o">.</span><span class="n">py</span> <span class="n">address</span> <span class="n">username</span> <span class="n">file1</span> <span class="n">file2</span> <span class="o">...</span>
- </pre></div>
- </div>
- <table border="1" class="docutils">
- <colgroup>
- <col width="19%" />
- <col width="53%" />
- <col width="28%" />
- </colgroup>
- <thead valign="bottom">
- <tr class="row-odd"><th class="head">Parameter name</th>
- <th class="head">Description</th>
- <th class="head">Example</th>
- </tr>
- </thead>
- <tbody valign="top">
- <tr class="row-even"><td>address</td>
- <td>Address of the Modelverse</td>
- <td><a class="reference external" href="http://localhost:8001">http://localhost:8001</a></td>
- </tr>
- <tr class="row-odd"><td>username</td>
- <td>Username to use when compiling</td>
- <td>test</td>
- </tr>
- <tr class="row-even"><td>file</td>
- <td>File to compile (either .mvc or .alc)</td>
- <td>test.alc</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="prompt-py">
- <h2>prompt.py<a class="headerlink" href="#prompt-py" title="Permalink to this headline">¶</a></h2>
- <p>A generic prompt interface to the Modelverse.
- You can log in as a specific user and start sending input messages to the Modelverse as that user.
- All output sent by the Modelverse will be printed in the console.
- There is no logic in the prompt itself, making it completely generic.</p>
- <p>Invocation:</p>
- <div class="highlight-default"><div class="highlight"><pre><span class="n">python</span> <span class="n">scripts</span><span class="o">/</span><span class="n">prompt</span><span class="o">.</span><span class="n">py</span>
- </pre></div>
- </div>
- </div>
- <div class="section" id="run-local-modelverse-py">
- <h2>run_local_modelverse.py<a class="headerlink" href="#run-local-modelverse-py" title="Permalink to this headline">¶</a></h2>
- <p>Locally runs an instance of the Modelverse at the requested port.
- This combines MvK and MvS at the same system, and actually makes a direct link between them, omitting the slow use of sockets.
- While this is kind of a hack at the moment, it is really necessary with the current low performance.
- To split them up, there just needs to be a statechart in between both of them (which is already written and working).</p>
- <p>Invocation:</p>
- <div class="highlight-default"><div class="highlight"><pre><span class="n">python</span> <span class="n">scripts</span><span class="o">/</span><span class="n">run_local_modelverse</span><span class="o">.</span><span class="n">py</span> <span class="n">port</span>
- </pre></div>
- </div>
- <table border="1" class="docutils">
- <colgroup>
- <col width="27%" />
- <col width="59%" />
- <col width="14%" />
- </colgroup>
- <thead valign="bottom">
- <tr class="row-odd"><th class="head">Parameter name</th>
- <th class="head">Description</th>
- <th class="head">Example</th>
- </tr>
- </thead>
- <tbody valign="top">
- <tr class="row-even"><td>port</td>
- <td>Port to host the Modelverse on</td>
- <td>8001</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="section" id="run-tests-py">
- <h2>run_tests.py<a class="headerlink" href="#run-tests-py" title="Permalink to this headline">¶</a></h2>
- <p>Run the tests for all parts of the Modelverse.</p>
- <p>Invocation:</p>
- <div class="highlight-default"><div class="highlight"><pre><span class="n">python</span> <span class="n">scripts</span><span class="o">/</span><span class="n">run_tests</span><span class="o">.</span><span class="n">py</span>
- </pre></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
- <div class="sphinxsidebarwrapper">
- <h3><a href="index.html">Table Of Contents</a></h3>
- <ul>
- <li><a class="reference internal" href="#">How to run</a><ul>
- <li><a class="reference internal" href="#check-objects-py">check_objects.py</a></li>
- <li><a class="reference internal" href="#compile-py">compile.py</a></li>
- <li><a class="reference internal" href="#execute-model-py">execute_model.py</a></li>
- <li><a class="reference internal" href="#fix-files-py">fix_files.py</a></li>
- <li><a class="reference internal" href="#flush-compiler-caches-py">flush_compiler_caches.py</a></li>
- <li><a class="reference internal" href="#generate-bootstrap-py">generate_bootstrap.py</a></li>
- <li><a class="reference internal" href="#link-and-load-py">link_and_load.py</a></li>
- <li><a class="reference internal" href="#make-all-py">make_all.py</a></li>
- <li><a class="reference internal" href="#make-parallel-py">make_parallel.py</a></li>
- <li><a class="reference internal" href="#prompt-py">prompt.py</a></li>
- <li><a class="reference internal" href="#run-local-modelverse-py">run_local_modelverse.py</a></li>
- <li><a class="reference internal" href="#run-tests-py">run_tests.py</a></li>
- </ul>
- </li>
- </ul>
- <h4>Previous topic</h4>
- <p class="topless"><a href="components.html"
- title="previous chapter">Modelverse components</a></p>
- <h4>Next topic</h4>
- <p class="topless"><a href="actionlanguage.html"
- title="next chapter">Action Language</a></p>
- <div role="note" aria-label="source link">
- <h3>This Page</h3>
- <ul class="this-page-menu">
- <li><a href="_sources/howto.txt"
- rel="nofollow">Show Source</a></li>
- </ul>
- </div>
- <div id="searchbox" style="display: none" role="search">
- <h3>Quick search</h3>
- <form class="search" action="search.html" method="get">
- <div><input type="text" name="q" /></div>
- <div><input type="submit" value="Go" /></div>
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- </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="actionlanguage.html" title="Action Language"
- >next</a> |</li>
- <li class="right" >
- <a href="components.html" title="Modelverse components"
- >previous</a> |</li>
- <li class="nav-item nav-item-0"><a href="index.html">Modelverse 0.4.0 documentation</a> »</li>
- </ul>
- </div>
- <div class="footer" role="contentinfo">
- © Copyright 2016, Yentl Van Tendeloo.
- Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.6.
- </div>
- </body>
- </html>
|