|
@@ -51,11 +51,282 @@
|
|
|
|
|
|
<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>
|
|
|
-<div class="section" id="understanding-the-components">
|
|
|
-<h2>Understanding the components<a class="headerlink" href="#understanding-the-components" title="Permalink to this headline">¶</a></h2>
|
|
|
+<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 class="section" id="scripts">
|
|
|
-<h2>Scripts<a class="headerlink" href="#scripts" title="Permalink to this headline">¶</a></h2>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -68,8 +339,18 @@
|
|
|
<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="#understanding-the-components">Understanding the components</a></li>
|
|
|
-<li><a class="reference internal" href="#scripts">Scripts</a></li>
|
|
|
+<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>
|