scripts.rst 4.1 KB

  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. Despite the various files, only ** is required for most cases.
  7. ------------
  8. Fix some files that must be kept identical.
  9. This is sometimes necessary because if a file gets updated, the changes must propagate.
  10. 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.
  11. Invocation::
  12. python scripts/
  14. ------------------------
  15. Clear all cached files from the compiler.
  16. The compiler will automatically reparse files when they have been changed, but changes to the compiler code itself will not be detected.
  17. When changing the compiler, this file should be executed to flush these file caches.
  18. Invocation::
  19. python scripts/
  21. ---------------------
  22. Creates the bootstrap file for the Modelverse State.
  23. 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.
  24. Generally, this needs to be executed when any file in the *bootstrap/* folder is modified.
  25. Compilation is fairly smart, only recompiling parts that have changed.
  26. Invocation::
  27. python scripts/
  29. ---------
  30. A generic prompt interface to the Modelverse.
  31. You can log in as a specific task and start sending input messages to the Modelverse as that task.
  32. All output sent by the Modelverse will be printed in the console.
  33. There is no logic in the prompt itself, making it completely generic.
  34. While this is not the most usable way of communicating with the Modelverse, it provides a minimal interface.
  35. Invocation::
  36. python scripts/
  38. -----------------------
  39. Locally runs an instance of the Modelverse at the requested port.
  40. This combines MvK and MvS at the same system, and actually makes a direct link between them, omitting the slow use of sockets.
  41. While this is kind of a hack at the moment, it is really necessary for performance.
  42. To split them up, there just needs to be a statechart in between both of them (which is already written and working).
  43. The port option is optional, and defaults to 8001.
  44. Invocation::
  45. python scripts/ port
  47. ------------
  48. Run the tests for all parts of the Modelverse.
  49. Invocation::
  50. python scripts/
  52. ------------------
  53. Run the relatively fast tests for the Modelverse.
  54. Invocation::
  55. python scripts/
  57. ---------------
  58. Run the compiler for a given input file, to detect whether it can be compiled or not.
  59. The command does not return anything if the file could be compiled, but prints an exception if there was a parsing error.
  60. Mostly used to validate large files for syntax errors or for profiling of the compiler.
  61. This script parses the file using Action Language syntax.
  62. Invocation::
  63. python scripts/ file.alc
  65. ---------------------
  66. Identical to, mentioned above, but now expects a HUTN modelling syntax.
  67. Invocation::
  68. python scripts/ file.mvc
  70. --------------
  71. Uploads the initial version of the bootstrap code as an actual Action Language model that will be loaded at startup.
  72. This does take some time and requires quite some resources of the Modelverse as well, as the bootstrap code is rather large.
  73. Normally this code is not necessary, although it would be if the bootstrap code has to be altered for different users.
  74. Note that this uploads the file stored in *bootstrap/merged.alm*, which is an automatically generated file from all bootstrap files.
  75. This file is automatically generated by the script **, but can be manually edited to change the core library of a running Modelverse.
  76. After the core is uploaded, the model can also be incrementally modified from within the Modelverse itself.
  77. Invocation::
  78. python scripts/