howto.rst 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. How to run
  2. ==========
  3. Running the Modelverse is all done through the use of scripts to coordinate the three different projects.
  4. The following scripts are included by default.
  5. check_objects.py
  6. ----------------
  7. Checks whether all compiled objects can be found, and if their symbol table does not contain undefined references.
  8. This script cannot be executed directly and is only a helper.
  9. compile.py
  10. ----------
  11. Compiles the provided code with the selected mode.
  12. This should also not be called by end-users, though it is possible.
  13. Invocation::
  14. python scripts/compile.py address file username object mode
  15. ============== ====================================== =====================
  16. Parameter name Description Example
  17. ============== ====================================== =====================
  18. address Address of the Modelverse http://localhost:8001
  19. file File to be compiled file.alc
  20. username Username to use when compiling test_user
  21. object Object name to export to object.o
  22. mode Either CO (constructors) or PO (graph) PO
  23. ============== ====================================== =====================
  24. execute_model.py
  25. ----------------
  26. Compile a model and action language files together, executing the action language.
  27. First, all models are added, and then the action language is executed, starting at function "main".
  28. Models being created are temporary, so they need to be exported before they can be accessed in the action language.
  29. Invocation::
  30. python scripts/execute_model.py address username file1 file2 ...
  31. ============== ======================================= =====================
  32. Parameter name Description Example
  33. ============== ======================================= =====================
  34. address Address of the Modelverse http://localhost:8001
  35. username Username to use when compiling test
  36. file File to compile (either .mvc or .alc) test.alc
  37. ============== ======================================= =====================
  38. fix_files.py
  39. ------------
  40. Fix some files that must be kept identical.
  41. This is sometimes necessary because if a file gets updated, the changes must propagate.
  42. 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.
  43. Invocation::
  44. python scripts/fix_files.py
  45. flush_compiler_caches.py
  46. ------------------------
  47. Clear all cached files from the compiler.
  48. The compiler will automatically reparse files when they have been changed, but changes to the compiler code itself will not be detected.
  49. When changing the compiler, this file should be executed to flush these file caches.
  50. Invocation::
  51. python scripts/flush_compiler_caches.py
  52. generate_bootstrap.py
  53. ---------------------
  54. Creates the bootstrap file for the Modelverse State.
  55. 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.
  56. Generally, this needs to be executed when any file in the *bootstrap/* folder is modified.
  57. Compilation is fairly smart, only recompiling parts that have changed.
  58. Invocation::
  59. python scripts/generate_bootstrap.py
  60. link_and_load.py
  61. ----------------
  62. This takes a set of objects in the Modelverse, links them together in a single "executable" and executes it immediately.
  63. Generally not needed by end-users.
  64. Invocation::
  65. python scripts/link_and_load.py address username object1 object2 ...
  66. ============== ======================================= =====================
  67. Parameter name Description Example
  68. ============== ======================================= =====================
  69. address Address of the Modelverse http://localhost:8001
  70. username Username to use when compiling test
  71. object File to compile (either .mvc or .alc) test.alc
  72. ============== ======================================= =====================
  73. make_all.py
  74. -----------
  75. Compile a set of files and executes them immediately.
  76. This uses constructors by default, which is the most elegant, but also the slowest.
  77. Invocation::
  78. python scripts/make_all.py address username file1 file2 ...
  79. ============== ======================================= =====================
  80. Parameter name Description Example
  81. ============== ======================================= =====================
  82. address Address of the Modelverse http://localhost:8001
  83. username Username to use when compiling test
  84. file File to compile (either .mvc or .alc) test.alc
  85. ============== ======================================= =====================
  86. make_parallel.py
  87. ----------------
  88. A parallel version of make_all.py.
  89. This uses the direct graph compilation, and compiles these graphs in parallel.
  90. This is much faster than make_all, though much less elegant.
  91. Invocation::
  92. python scripts/make_parallel.py address username file1 file2 ...
  93. ============== ======================================= =====================
  94. Parameter name Description Example
  95. ============== ======================================= =====================
  96. address Address of the Modelverse http://localhost:8001
  97. username Username to use when compiling test
  98. file File to compile (either .mvc or .alc) test.alc
  99. ============== ======================================= =====================
  100. prompt.py
  101. ---------
  102. A generic prompt interface to the Modelverse.
  103. You can log in as a specific user and start sending input messages to the Modelverse as that user.
  104. All output sent by the Modelverse will be printed in the console.
  105. There is no logic in the prompt itself, making it completely generic.
  106. Invocation::
  107. python scripts/prompt.py
  108. run_local_modelverse.py
  109. -----------------------
  110. Locally runs an instance of the Modelverse at the requested port.
  111. This combines MvK and MvS at the same system, and actually makes a direct link between them, omitting the slow use of sockets.
  112. While this is kind of a hack at the moment, it is really necessary with the current low performance.
  113. To split them up, there just needs to be a statechart in between both of them (which is already written and working).
  114. Invocation::
  115. python scripts/run_local_modelverse.py port
  116. ============== ============================== =======
  117. Parameter name Description Example
  118. ============== ============================== =======
  119. port Port to host the Modelverse on 8001
  120. ============== ============================== =======
  121. run_tests.py
  122. ------------
  123. Run the tests for all parts of the Modelverse.
  124. Invocation::
  125. python scripts/run_tests.py