Write a Simulation
After having installed the CLI you can get started writing your first simulation. This is not an easy process and will take a while to get a good grasp on how to do.
1. Setup development environment
To make writing this simulation easier you should setup your local development environment first.
Create a folder and optionally add version control to it.
mkdir ~/code/almanak-simulation
cd ~/code/almanak-simulation
git init
You can now open this folder in your favorite IDE, in this guide we will be using Visual Studio Code but feel free to use any IDE that supports Python and YAML formatting.
code .
2. Create the necessary files
Now that we have the folder setup let's create the necessary files.
configuration.yaml
/models/
For now it's failry simple.
3. Start writing
Open the configuration.yaml
and start writing your simulation using the
configuration specification here. A suggestion would be to
copy the sample provided in the Introduction into your
configuration.yaml
and edit it from there.
4. Start a simulation
Use the CLI to run a simulation with your configuration.
simcli create
This will return an ID for the simulation and if there weren't any errors will start running the simulation.
5. Retreive results from your simulation
Keep checking the status of your simulation every once in a while using the CLI with the ID that you received when you started the simulation.
simcli get id
Once it's done you will see URLs to files in Google Cloud Storage with the result and metrics that were logged.