Scripting PAT project
I have a fair amount of Measures each with several measure options, and therefore do not wish to create the various design alternatives by hand as it would be too tedious. I wish to compute the different permutations based on some inner logic like "Measure A" and "Measure B" are actually alternatives for the same Energy Efficiency Measure (EEM) so they should be treated as such.
Now that PAT 2.x has be revamped and seems to use a JSON format, can I script it? I guess I need to modify pat.json
, but I'm wondering if I can specifically use OpenStudio's API for this or if I need to just treat the JSON file like any other?
If I have to change the JSON itself, how can I set some parameters such as $$hashKey
for designAlternatives etc.?
pat.json stores the state of the PAT UI. The analysis JSON that PAT authors for use by the OpenStudio Meta CLI will show up as YourProjectName.json (an OSA) along w/ YourProjectName.zip. If you open the developer console in PAT, you'll see the Meta CLI invoked with those as arguments.
Question: In your proposed example, are Measures A and B mutually exclusive of one another? Depending upon what you're trying to achieve, it's possible you could set up a design of experiments with pivot variables in your OSA.
In my example Measure A and Measure B are mutually exclusive yes (eg: Measure A is a measure that insulate the roof of an unfinished attic, and measure B is another type of measure that will insulate the floor of the unfinished attic, but I don't want to do both). I also have cases where Measure C and measure D must be used in conjuction (eg: one measure to change the R-value of a wall, another to reduce the infiltration) meaning either an option of C and an option of D is used, or none of the two. You cannot have one option of C and none of D.
I was currently looking at the "algorithmic" option of PAT to see if that could suits my needs, but I'm not sure which algorithm to select to begin with. (I also have other doubt about whether it's usable the first time around... when you're not sure how to set it up, and if you do it correctly you still need to look at the results before you shut down the paid instances of EC2 that are running. It's scary for the lambda user that I am)
I can think of a couple ways to construct the kind of analysis you describe in algorithmic mode. The diagonal algorithm or as I mentioned above DOE w/ pivots could be made to work. If you're wanting to experiment with the algorithms while not incurring EC2 costs, you might consider standing up a local instance of OpenStudio-Server. I think several folks have had success following the docker-based provisioning instructions in that repo.
@Julien Marrec, not a complete answer, but for measure that need to be used in conjunction, I have an idea. Lets say anytime measure E is used, you also want to run measure E2, E3, and E4. But E2-4 never run if "E" isn't run.
In 2.x a measure has access to information about upstream measures. You can have a simple if statement in E2-4 that looks to see if a measure named "E" is in the workflow, if it is not found then the measure returns true with Not Applicable. Then put E-2 in the workflow for all datapoints, and it will know when to run or not.