3 Simulation Setup
The simulation setup requires two different sets of inputs. These two sets of input data are contained in two separate files:
The config file: this file sets up the simulation scenario parameters
The model file: this defines the components, their connections, along with the fragility, loss, and recovery parameters for the infrastructure model.
These files, their parameters, data layout, and sample input data are presented in the remainder of this Section.
Naming Requirement of Input File: The model file name must begin or end with the term ‘model’. Similarly, the config file must have the term ‘config’ at the beginning or end of its name.
Location Requirement for Input Files: The input files must reside within a directory named input. The parent directory is named after the infrastructure asset by convention, but it can have any name allowed by the local file system. This dir can be located in any storage location where the user has access. The code is informed of the location with a flag -d at execution time.
The outputs generated from the simulation are stored in a directory called output within the same parent directory.
For illustration purposed we assume a hypothetical project “PROJECTX”, with the project folder located in the root directory. We also assume that within the project, we are modelling two systems named SYSTEM_D and SYSTEM_G. For this given setup, input-output dir structure for the project will be as follows:
.
└── <PROJECTX>
├── <SYSTEM_D>
│ ├── input
│ │ ├── config_system_D.json
│ │ └── model_system_D.json
│ └── output
│ ├── ...
│ ├── ...
│ └── ...
│
└── <SYSTEM_G>
├── input
│ ├── config_system_G.json
│ └── model_system_G.json
│
└── output
├── ...
├── ...
└── ...
3.1 Simulation Configuration File
The code needs a setup file for configuring the simulation scenario. The expected file format is JSON. The code can support any of three formats: ini, conf, or json, though formats other than JSON are discouraged and details of their implementation will not be discussed here.
The following table lists the parameters in the config file, with a brief description and representative values.
3.1.1 Scenario Parameters
Simulation Scenario Params
- CONFIGURATION_ID
- Description:
Unique ID for the scenario and model setup
- Data Type:
String
- Example:
“Project X scenario config - SS East Perth”
- SCENARIO_NAME
- Description:
Name for identifying simulation scenario
- Data Type:
String
- Example:
“Historical earthquake Meckering equiv”
- SCENARIO_NAME
- Description:
Name for identifying simulation scenario
- Data Type:
String
- Example:
“Historical earthquake Meckering equiv”
- OUTPUT_DIR
- Description:
Path where results should be stored
- Data Type:
String
- Example:
“./output_SS_WUN_array”
3.1.2 Hazard Parameters
Common Hazard Params
- HAZARD_TYPE
- Description:
The type of hazard for the impact simulation.
- Data Type:
String
- Example:
‘earthquake’
- Valid values:
[‘earthquake’, ‘tropical cyclone’, ‘flood’]
- HAZARD_INTENSITY_MEASURE_PARAM
- Description:
Engineering Demand Parameter
- Data Type:
String
- Example:
‘PGA’
- HAZARD_INTENSITY_MEASURE_UNIT
- Description:
Demand Parameter Unit
- Data Type:
String
- Example:
‘g’
- HAZARD_INPUT_METHOD
- Description:
How the hazard is supplied. Must be one of the following: [1] “calculated_array” or “hazard_array” – where an array of equally spaced values are calculated for generating the fragility or vulnerability of an asset. Can only be used for point assets. [2] “hazard_file” or “scenario_file” – where the system expects a file with predefined headers and structure an input for hazard data points. Can be used for point and geospatially distributed assets.
- Data Type:
String
- Example:
“calculated_array”
Hazard Params for Calculated Array
- HAZARD_INTENSITY_MEASURE_MIN
- Description:
Minimum value for internsity measurement (IM) parameter
- Data Type:
Float
- Example:
0.0
- HAZARD_INTENSITY_MEASURE_MAX
- Description:
Maximum value for internsity measurement (IM) parameter
- Data Type:
Float
- Example:
1.5
- HAZARD_INTENSITY_MEASURE_STEP
- Description:
Step size for incrementing the IM param
- Data Type:
Float
- Example:
0.01
- HAZARD_NUM_SAMPLES
- Description:
Iterations for Monte Carlo process
- Data Type:
Integer
- Example:
5000
Hazard Params for Hazard Input Files
- HAZARD_INPUT_DIR
- Description:
Path for hazard file location
- Data Type:
String
- Example:
“../PROJECTX_hazard_portfolio/scenario_files”
- HAZARD_INPUT_FILE
- Description:
Name of hazard input file
- Data Type:
String
- Example:
“./output_SS_WUN_array”
- HAZARD_INPUT_HEADER
- Description:
Columen name for the hazard values
- Data Type:
String
- Example:
“gmv_PGA”
- HAZARD_SCALING_FACTOR
- Description:
Multiplier factor for scaling the hazard values in the HAZARD_INPUT_HEADER column. Default is 1.0.
- Data Type:
Float
- Example:
1.2
Focus Scenarios for Detailed Vulnerability Analysis
- SCENARIO_FOCAL_HAZARD_SCENARIO_NAMES
- Description:
The name(s) of the focus scenarios for detailed assessment of system response
- Data Type:
List of strings
- Example:
[“Cunderdin RP1000”, “Cunderdin RP2500”]
- SCENARIO_FOCAL_HAZARD_SCENARIOS
- Description:
The value(s) or scenario(s) at which to undertake detailed assessment of system response
- Data Type:
List of floats or strings that can be interpreted as floats
- Example:
[0.121, 0.226]
3.1.3 Restoration Parameters
Restoration Params
- RESTORATION_STREAMS
- Description:
The number of simultaneous components to work on
- Data Type:
List of integers
- Example:
[5, 10, 20]
- RESTORATION_TIME_UNIT
- Description:
Unit of time for restoration time calculations
- Data Type:
String
- Example:
‘week’
- RESTORATION_TIME_MIN
- Description:
Minimum value for restoration period assessment. Default is 1.
- Data Type:
Integer
- Example:
1
- RESTORATION_TIME_MAX
- Description:
Maximum value for restoration period assessment. No default values.
- Data Type:
Integer
- Example:
300
- RESTORATION_TIME_STEP
- Description:
Time increment for restoration period. Default is 1.
- Data Type:
Integer
- Example:
1
- RESTORATION_PCT_CHECKPOINTS
- Description:
[DEPRECATED] Number of steps to assess functionality at
- Data Type:
Integer
- Example:
21
3.1.4 System Category Metadata Parameters
System Metadata
- SYSTEM_INFRASTRUCTURE_LEVEL
- Description:
Define infrastructure as a facility or network
- Data Type:
String
- Example:
facility
- SYSTEM_COMMODITY_FLOW_TYPES
- Description:
Number of input commodity types
- Data Type:
Integer
- Example:
2
- SYSTEM_CLASSES
- Description:
The allowed infrastructure system types
- Data Type:
List of strings
- Example:
[‘PowerStation’, ‘Substation’]
- SYSTEM_CLASS
- Description:
The infrastructure system type to be modelled
- Data Type:
String
- Example:
‘PowerStation’
- SYSTEM_SUBCLASS
- Description:
Sub-category of system
- Data Type:
String
- Example:
‘Coal Fired’
- SYSTEM_COMPONENT_LOCATION_CONF
- Description:
Defines whether the location data for each component is provided. Allowed values: [1] undefined: location data not given, [2] defined: location data given, [3] schematic: location data given for drawing in graphviz, [4] geospatial: actual geospatial location data given.
- Data Type:
String
- Example:
‘schematic’
- SYS_CONF_FILE_NAME
- Description:
[OPTIONAL] Define file name for system config and fragility info. Maybe useful when there are multiple models for same asset to test. Generally auto-detected in code. The model name must begin or end with the term ‘model’.
- Data Type:
String
- Example:
‘model_ps_xyz.json’
3.1.5 Simulation Configuration Flags
FLAGS
- FIT_PE_DATA
- Description:
[DEPRECATED] Flag for fitting Prob of Exceedance data. It is preferred to set this via the command line argument.
- Data Type:
Boolean
- Example:
True
- SWITCH_MULTIPROCESS
- Description:
Switch to indicate whether to use multi-core processing. 0 \(\rightarrow\) False, 1 \(\rightarrow\) True
- Data Type:
Integer
- Example:
1
- SWITCH_RUN_CONTEXT
- Description:
Switch to indicate whether to run a full simulation, or run test code. 0 \(\rightarrow\) run tests, 1 \(\rightarrow\) normal run.
- Data Type:
Integer
- Example:
1
- SWITCH_FIT_RESTORATION_DATA
- Description:
Fit model to simulated restoration data
- Data Type:
Boolean
- Example:
True
- SWITCH_SAVE_VARS_NPY
- Description:
Switch to indicate whether to save simulated values in binary numpy format
- Data Type:
Boolean
- Example:
True