Creating Multiple Scenarios

This is an example of a script to create a multiple scenarios in an existing Iota project:

''' This scripts starts a new session, loads the project "Backhoe optimization" and creates 
new scenarios as per the list of scenarios defined in the script'''

import sys                              
import os
import iota
sys.path.append(os.getenv('IOTA_PATH'))                                         # Add iota directory to Python paths

username = 'stephen'                                                            # Set Iota username
home_path = 'C:/Users/stephen/'                                                 # Set user's home directory

ListOfScenarios = ['Design Alpha', 'Design Beta', 'Design Gamma']               # List of names for the scenarios

my_session = iota.session(username,home_path + 'ParticleAnalytics/config.ini')  # Start new session

my_new_project = my_session.get_project('Backhoe optimization')                 # Load the project "Backhoe optimization"        

for scenario_name in ListOfScenarios:                                           # For each name in the list of name for the scenarios
    my_new_project.add_scenario(name=scenario_name)                             # Create a new scenario

Last updated

Was this helpful?