examples.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Examples &#8212; Modelverse 0.4.0 documentation</title>
  7. <link rel="stylesheet" href="_static/classic.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: './',
  12. VERSION: '0.4.0',
  13. COLLAPSE_INDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="_static/jquery.js"></script>
  19. <script type="text/javascript" src="_static/underscore.js"></script>
  20. <script type="text/javascript" src="_static/doctools.js"></script>
  21. <link rel="top" title="Modelverse 0.4.0 documentation" href="index.html" />
  22. <link rel="next" title="Advanced examples" href="advanced.html" />
  23. <link rel="prev" title="Modelling Language" href="modellanguage.html" />
  24. </head>
  25. <body role="document">
  26. <div class="related" role="navigation" aria-label="related navigation">
  27. <h3>Navigation</h3>
  28. <ul>
  29. <li class="right" style="margin-right: 10px">
  30. <a href="genindex.html" title="General Index"
  31. accesskey="I">index</a></li>
  32. <li class="right" >
  33. <a href="advanced.html" title="Advanced examples"
  34. accesskey="N">next</a> |</li>
  35. <li class="right" >
  36. <a href="modellanguage.html" title="Modelling Language"
  37. accesskey="P">previous</a> |</li>
  38. <li class="nav-item nav-item-0"><a href="index.html">Modelverse 0.4.0 documentation</a> &#187;</li>
  39. </ul>
  40. </div>
  41. <div class="document">
  42. <div class="documentwrapper">
  43. <div class="bodywrapper">
  44. <div class="body" role="main">
  45. <div class="section" id="examples">
  46. <h1>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h1>
  47. <p>To run this code, store it in a file (<em>e.g.</em>, test.alc), and execute the following commands:</p>
  48. <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="mi">8001</span> <span class="o">&amp;</span>
  49. <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">http</span><span class="p">:</span><span class="o">//</span><span class="n">localhost</span><span class="p">:</span><span class="mi">8001</span> <span class="n">test</span> <span class="n">test</span><span class="o">.</span><span class="n">alc</span> <span class="n">bootstrap</span><span class="o">/</span><span class="n">primitives</span><span class="o">.</span><span class="n">alc</span>
  50. <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>
  51. </pre></div>
  52. </div>
  53. <p>In the prompt, log on to <a class="reference external" href="http://localhost:8001">http://localhost:8001</a> as user <em>test</em>.
  54. Now, all input you send, will be caught in the <em>input()</em> calls seen in the code.
  55. Results will also be printed.</p>
  56. <p>Note that all content will, by default, be typed as string.
  57. If you want to send integers or so, prepend the input with a backslash (\), which allows you to directly input the JSON code.
  58. For example, input <em>5</em> will be received as the string &#8220;5&#8221;.
  59. To send the integer 5, the input should be <em>\5</em>.</p>
  60. <div class="section" id="simple-fibonacci-server">
  61. <h2>Simple Fibonacci Server<a class="headerlink" href="#simple-fibonacci-server" title="Permalink to this headline">¶</a></h2>
  62. </div>
  63. <div class="section" id="simple-petri-net-server">
  64. <h2>Simple Petri Net Server<a class="headerlink" href="#simple-petri-net-server" title="Permalink to this headline">¶</a></h2>
  65. </div>
  66. <div class="section" id="generic-modelling-server">
  67. <h2>Generic Modelling Server<a class="headerlink" href="#generic-modelling-server" title="Permalink to this headline">¶</a></h2>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  74. <div class="sphinxsidebarwrapper">
  75. <h3><a href="index.html">Table Of Contents</a></h3>
  76. <ul>
  77. <li><a class="reference internal" href="#">Examples</a><ul>
  78. <li><a class="reference internal" href="#simple-fibonacci-server">Simple Fibonacci Server</a></li>
  79. <li><a class="reference internal" href="#simple-petri-net-server">Simple Petri Net Server</a></li>
  80. <li><a class="reference internal" href="#generic-modelling-server">Generic Modelling Server</a></li>
  81. </ul>
  82. </li>
  83. </ul>
  84. <h4>Previous topic</h4>
  85. <p class="topless"><a href="modellanguage.html"
  86. title="previous chapter">Modelling Language</a></p>
  87. <h4>Next topic</h4>
  88. <p class="topless"><a href="advanced.html"
  89. title="next chapter">Advanced examples</a></p>
  90. <div role="note" aria-label="source link">
  91. <h3>This Page</h3>
  92. <ul class="this-page-menu">
  93. <li><a href="_sources/examples.txt"
  94. rel="nofollow">Show Source</a></li>
  95. </ul>
  96. </div>
  97. <div id="searchbox" style="display: none" role="search">
  98. <h3>Quick search</h3>
  99. <form class="search" action="search.html" method="get">
  100. <div><input type="text" name="q" /></div>
  101. <div><input type="submit" value="Go" /></div>
  102. <input type="hidden" name="check_keywords" value="yes" />
  103. <input type="hidden" name="area" value="default" />
  104. </form>
  105. </div>
  106. <script type="text/javascript">$('#searchbox').show(0);</script>
  107. </div>
  108. </div>
  109. <div class="clearer"></div>
  110. </div>
  111. <div class="related" role="navigation" aria-label="related navigation">
  112. <h3>Navigation</h3>
  113. <ul>
  114. <li class="right" style="margin-right: 10px">
  115. <a href="genindex.html" title="General Index"
  116. >index</a></li>
  117. <li class="right" >
  118. <a href="advanced.html" title="Advanced examples"
  119. >next</a> |</li>
  120. <li class="right" >
  121. <a href="modellanguage.html" title="Modelling Language"
  122. >previous</a> |</li>
  123. <li class="nav-item nav-item-0"><a href="index.html">Modelverse 0.4.0 documentation</a> &#187;</li>
  124. </ul>
  125. </div>
  126. <div class="footer" role="contentinfo">
  127. &#169; Copyright 2016, Yentl Van Tendeloo.
  128. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.6.
  129. </div>
  130. </body>
  131. </html>