Organization of a Julia Script File
When making a Julia script file in ENERGY 2100, it is helpful to modify a Julia Script File - Modifying a Va
Each policy file contains Julia code and is set up with a standardized structure having the following 7 components:
Components of a Policy File:

- Load the EnergyModel to gain access to ENERGY 2100's variables, functions, etc.
- Define the policy file as a new module. Assign the module a name.
- Import global functions and constants defined in the EnergyModel to have access in the policy module.
- Define new data types, VariableArray and SetArray. These data types will be used structure variables as arrays of float64 numbers, and the sets to be vectors of strings.
- Create and initialize objects (variable arrays and sets) to be used in the policy file as a Julia struct. Assign a name to the struct ("RControl" in the figure below). The struct is defined using Julia's @kwdef macro (short for "keyword default") which is a helper utility for creating Julia structures allowing for user-defined VariableArrays and SetArrays to hold data.
- Write code in Julia function(s) to modify policy variables.
- Call to the functions written in #6 to execute the policy equations.