howto.txt 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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-tasks, though it is possible.
  13. Invocation::
  14. python scripts/compile.py address file taskname 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. taskname Taskname to use when compiling test_task
  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 taskname file1 file2 ...
  31. ============== ======================================= =====================
  32. Parameter name Description Example
  33. ============== ======================================= =====================
  34. address Address of the Modelverse http://localhost:8001
  35. taskname Taskname 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 tasks 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-tasks.
  64. Invocation::
  65. python scripts/link_and_load.py address taskname object1 object2 ...
  66. ============== ======================================= =====================
  67. Parameter name Description Example
  68. ============== ======================================= =====================
  69. address Address of the Modelverse http://localhost:8001
  70. taskname Taskname 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. Invocation::
  77. python scripts/make_all.py address taskname file1 file2 ...
  78. ============== ======================================= =====================
  79. Parameter name Description Example
  80. ============== ======================================= =====================
  81. address Address of the Modelverse http://localhost:8001
  82. taskname Taskname to use when compiling test
  83. file File to compile (either .mvc or .alc) test.alc
  84. ============== ======================================= =====================
  85. make_parallel.py
  86. ----------------
  87. A parallel version of make_all.py.
  88. Invocation::
  89. python scripts/make_parallel.py address taskname file1 file2 ...
  90. ============== ======================================= =====================
  91. Parameter name Description Example
  92. ============== ======================================= =====================
  93. address Address of the Modelverse http://localhost:8001
  94. taskname Taskname to use when compiling test
  95. file File to compile (either .mvc or .alc) test.alc
  96. ============== ======================================= =====================
  97. prompt.py
  98. ---------
  99. A generic prompt interface to the Modelverse.
  100. You can log in as a specific task and start sending input messages to the Modelverse as that task.
  101. All output sent by the Modelverse will be printed in the console.
  102. There is no logic in the prompt itself, making it completely generic.
  103. Invocation::
  104. python scripts/prompt.py
  105. run_local_modelverse.py
  106. -----------------------
  107. Locally runs an instance of the Modelverse at the requested port.
  108. This combines MvK and MvS at the same system, and actually makes a direct link between them, omitting the slow use of sockets.
  109. While this is kind of a hack at the moment, it is really necessary for performance.
  110. To split them up, there just needs to be a statechart in between both of them (which is already written and working).
  111. Invocation::
  112. python scripts/run_local_modelverse.py port
  113. ============== ============================== =======
  114. Parameter name Description Example
  115. ============== ============================== =======
  116. port Port to host the Modelverse on 8001
  117. ============== ============================== =======
  118. run_tests.py
  119. ------------
  120. Run the tests for all parts of the Modelverse.
  121. Invocation::
  122. python scripts/run_tests.py
  123. run_MvC_server.py
  124. -----------------
  125. Run the Modelverse with a modelling interface pre-loaded and fully operational.
  126. This is probably the only command you will need to start the Modelverse server on your local machine.
  127. You are advised to check the global variables of the script for all configuration parameters, such as the server port and the username and password of the root user.
  128. Invocation::
  129. python scripts/run_MvC_server.py