jakobaxelsson / sossim

A system-of-systems (SoS) simulator
MIT License
0 stars 0 forks source link

Refactor SoSSim as a package #25

Closed jakobaxelsson closed 9 months ago

jakobaxelsson commented 9 months ago

Currently, it takes quite long to load SoSSim in the browser. Some options to investigate:

The potential drawbacks of these solutions are:

Making SoSSim into a package has other benefits. At some point, it will probably be desirable to put an outer loop that calls the simulator for a number of different scenarios and collects statistics, e.g. to evaluate how well a proposed SoS mechanism performs in different situations.

jakobaxelsson commented 9 months ago

Implementation steps:

jakobaxelsson commented 9 months ago

It turns out that the current stable version of pyscript does not support json config files, it is planned for the next release. Here is an alternative plan:

jakobaxelsson commented 9 months ago

A problem when generating the packages is that there is currently also the copy of domed in this directory. A solution that packages sossim also requires to finally remove domed from this repo.

jakobaxelsson commented 9 months ago

The repository has been refactored as follows:

jakobaxelsson commented 9 months ago

To make the app html file completely generic, the title element from the head has been removed. The intention was to set this dynamically in the user interface, but there does not seem to be an easy and obvious way to do this in domed?

jakobaxelsson commented 9 months ago

Issue with title now resolved.

jakobaxelsson commented 9 months ago

Returning to the issue with pyodide vs. pyscript. Given that the pyscript html file for the app is now completely generic, a similar generic file can be made for pyodide. It only needs to get information about what packages to load, otherwise all the rest can be hardcoded as in the case for pyscript.

To get the package information, the pyconfig.toml file needs to be parsed, at least rudimentary.

jakobaxelsson commented 9 months ago

The file app/sossim_pyodide.html is now working. It does the same thing as sossim.html but without using pyscript. However, the startup time is almost the same, so it does not provide much benefit.