Repository navigation
Running your own scenario
You describe your own system in an Excel scenario file and run it with run_scenarios.
Download one of the files from Home:
- the example scenario: easiest to learn from, because you can change a working model step by step;
- the empty scenario template: a clean file with all sheets and settings ready.
NOTE: Both files contain Excel data validation, so many simple errors (wrong types, missing values) are caught in Excel before you run aiphoria.
Before filling in your data, read the Concepts pages (How aiphoria works, Processes, flows and stocks). The sheet-by-sheet reference starts at The scenario file.
- Create a new file, for example run.py, with this code:
from aiphoria import run_scenarios
run_scenarios("path_to_settings_file.xlsx", "output_directory_name", remove_existing_output_dir=True)- Replace
path_to_settings_file.xlsxwith the path to your scenario file andoutput_directory_namewith the folder where the results should go. - Run it:
Windows:
python run.pyLinux/macOS:
python3 run.pyThe results are written to the output folder you gave. aiphoria creates one sub-folder for the baseline and one for every alternative scenario in the Scenarios sheet. See Output files.
While running, aiphoria prints what it is doing and checks your data first. If something is wrong, it tells you the sheet and row. See Troubleshooting for common messages.
Next: How aiphoria works
Getting started
Concepts
Building a scenario file
Results
Help