This section covers how to use batch files to execute policy files and scenarios

Existing Policy Files

The easiest method of creating a new policy file is to use an existing policy file as a template. Values can be specified by direct input, an equation, or a set of equations. Equations allow the values to be specified as a fraction of an existing model variable, including a percent change from a base case or reference case. Setting values of a policy variable in relation an existing model variable greatly facilitates and improves the accuracy of the representation of complex policies.

To simulate the impact of single policy in the forecast, a policy file is developed that makes changes to all the relevant model variables. An appropriate base line or reference scenario is identified, and a new model run is executed with the new policy added on top of the forecast that it is being compared to. The impact of the policy is the difference in the model results between the two cases. A portfolio of policies can be individually tested then added together to develop entire forecast scenarios.

New Policy Files

To translate a policy into model variables and equations requires an understanding of the model structure and may require support from Systematic Solutions, Inc (SSI). ENERGY 2100 has been designed to be flexible and to facilitate the addition of new polices; however, often a policy is new and unique and requires revisions to the model (for example, adding a new policy variable into model equations that simulate the energy consumers’ or suppliers’ decision-making process). Revising the model variables or structure generally requires assistance from SSI. 

Policy Scenarios

Multiple policies are grouped into scenarios by using Julia files that list all policies included in a forecast. The files are given the same name as the scenario so that the model can locate the appropriate list when the scenario is included in a run. For example, ā€˜Policy/Base.jl’ will contain all the policy files included in the ā€˜Base’ scenario.

Scenario files consist of two sections. First, all the policy files that will be included in the run are added to the model compilation. This section will contain ā€˜include’ statements that point to the file name in the Policy subfolder. Second, the function that modifies the data in each policy file is called. By convention, these functions are named ā€˜PolicyControl’ and are designed to execute the functions within each policy file that modifies the desired values.

Viewing these scenario files allows the user to understand exactly which policies are included in a forecast scenario. Policies can be added to a scenario by saving a policy to the /Policy subdirectory and adding new lines in each section that point to the file and function names.

Testing Policy Files

Individual or groups of policies can be tested without modifying a scenario by including it in a ā€˜PolicyTest’ file. These files are designed as a quick way of testing the impacts of a new policy on top of an existing scenario. A template file is available in the Policy subfolder that can be used to test a policy by following the steps below:

  1. Editing ā€˜PolicyTestTemplate.jl’ to include the files to be tested in the first section and adding the PolicyControl functions to be called in the IncorporatePolicyTest() function.
  2. Save the file with a different name describing the policies being tested. For example, a collection of building standard policies could be named ā€˜BuildStdTest.jl’
  3. Edit the batch file used to call the desired scenario to include the newly created file as the third parameter. The default is ā€˜TestEmpty’, which tells the model that there are no additional files to test. Modifying this to ā€˜BuildStdTest’ will add the files from ā€˜BuildStdTest.jl’ on top of the existing scenario in the second parameter.


To test execution of one or more policy files that have been :



  1. Let's say you have created two new policy files, PolicyFile1.jl and PolicyFile2.jl, saved to the \Policy folder. 


  1. To test the impact of these two policies in the model, create an additional Julia script file in the \Policy folder that includes these policy files in the model and calls them. Save the file with any name. 


Below shows the contents of a policy test file named PolicyTest.jl that incorporates PolicyFile1.jl and PolicyFile2.jl into the model. 



ā˜‘

Important:  For the below code to work properly, both PolicyFile1.jl and PolicyFile2.jl must contain a function at the bottom of those files named PolicyControl.


Sample Module to Test Policies

#

# PolicyTest.jl - Test a Set of New Policies

#


module PolicyTest


import ...EnergyModel: DB


include("PolicyFile1.jl")

include("PolicyFile2.jl")


function IncorporatePolicyTest()

  @info "IncorporatePolicyTest - PolicyTest.jl"


PolicyFile1.PolicyControl(DB)

PolicyFile2.PolicyControl(DB)

end


end

       



RunE2100.bat is designed to execute non-integrated runs of Base, OGRef, Ref25, and Ref25A, as well as, test new policies.  


This batch file has a parameter to allow for testing one individual policy file - ā€œTest Policy Fileā€.  This parameter points to a Julia file which creates the module PolicyTest.  When we execute the model, Julia will include and execute Policy.jl and PolicyText.jl. This policy file gets added on top of the Ref25 policies (whatever is in Policy.jl).


The model will execute the Policy.jl (which will probably be Ref25) to run all the reference policies.  It will then run PolicyTest.jl which is a file which contains one or many policy files which the user wants to test.