Learn Naga¶
The learning path builds one model in six steps, and each page adds a few lines to the previous one and prints what the model does. Every script on these pages runs on its own, the output printed under it is made by running it, and the whole path takes about half an hour.
- One queue
- Two servers and a schedule
- A tank level
- Agents
- Replications and scenarios
- Reading the results and the event log
You need Python 3.11 or later and pip install nagasim. To run a step, copy its script into a file such as step1.py and run python step1.py: it prints what the page shows under the script. The path starts from a queue and ends with replications, scenarios and the event log. On the way, the same model meets discrete-event processes, a schedule, a continuous level and agents. When you have finished it, the modelling guide explains each part in depth and the gallery shows the bundled models. If you would rather start from a model file than from Python, use the Quick start.
If something goes wrong¶
| What happens | Likely cause | Fix |
|---|---|---|
ModuleNotFoundError: No module named 'nagasim' |
The engine is installed in another Python. | Run python -m pip install nagasim with the same python that runs the script. |
| The numbers differ from the page. | A changed seed, or an older engine. | Keep seed=1. If they still differ, update with python -m pip install -U nagasim. |
| A step fails on a name the step does not define. | Each script is the whole model so far, not only the new lines. | Copy the whole script of the page, not the changed lines. |
By goal¶
If you know what you want to do, find it here. Each row names one page, and a row without a page is a goal the docs do not teach yet.