Running a Model in the Optilogic Software Development Kit (SDK)
Running a model from Atlas via the SDK requires the following inputs:
- A model location with data loaded for that model
- A completed run_model.py file with the information needed to solve the model such as:
- MODEL – either file string or .frog model name
- ENGINE – neo or throg
- SCENARIOS – use ‘all’ to run scenarios or individually run scenarios by placing the scenario name within single quotes
- RESOURCE_CONFIG – the machine size used to solve the model
- WORKSPACE – the name of Atlas workspace, most likely this will be called ‘Studio’
1. Model Storage
Model data can be stored in two common locations:
1. Cosmic Frog model (denoted by a .frog suffix) stored within Postgres SQL database in the platform
2. .CSV files stored within Atlas
For #1 simply enter the database name within single quotes. For example to run a model called Satellite_Sleep I will need to enter this data in the run_model.py file
For #2 you will need to create a folder within Atlas to store your .CSV modeling files:
- Create a folder for your model inputs within your library – right-click the my_models folder to create a new folder
- Items to place in your folder:
- input_modeler
- Contains the tables where model data will reside
- Unused tables are not needed within the model file structure
- input_modeler
- Add your model tables to the input_modeler folder using your preferred data utility
2. Setting up Run Model (run_model.py)
Each Atlas account is loaded with a run_model.py file located within the SDK folder in your Model Library
Double click the file to open it within Atlas and enter the following data:
- MODEL – either file string or .frog model name
- ENGINE – neo or throg
- SCENARIOS – use ‘all’ to run scenarios or individually run scenarios by placing the scenario name within single quotes
- RESOURCE_CONFIG – the machine size used to solve the model
- WORKSPACE – the name of Atlas workspace, most likely this will be called ‘Studio’
Tips:
- If your model is saved in Atlas, you will need to enter the file location of the model. This can be done by right-clicking the model folder and selecting “Copy Path” to get the full path
- If you running a .frog model, the model name must match exactly this includes items like blank spaces.
- you can copy the model name from your browser window