src/workflow/RunOpenStudioMeasures.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /*********************************************************************************************************************** | ||
| 2 | * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC. | ||
| 3 | * See also https://openstudio.net/license | ||
| 4 | ***********************************************************************************************************************/ | ||
| 5 | |||
| 6 | #include "OSWorkflow.hpp" | ||
| 7 | |||
| 8 | #include "../model/Model.hpp" | ||
| 9 | |||
| 10 | #include "../utilities/filetypes/WorkflowJSON.hpp" | ||
| 11 | #include "../utilities/filetypes/RunOptions.hpp" | ||
| 12 | #include "../utilities/core/Filesystem.hpp" | ||
| 13 | |||
| 14 | namespace openstudio { | ||
| 15 | |||
| 16 | 13 | void OSWorkflow::runOpenStudioMeasures() { | |
| 17 | 13 | state = State::OpenStudioMeasures; | |
| 18 | |||
| 19 | // Weather file is handled in runInitialization | ||
| 20 | |||
| 21 |
5/5✓ Branch 1 taken 13 times.
✓ Branch 4 taken 13 times.
✓ Branch 7 taken 13 times.
✓ Branch 10 taken 13 times.
✓ Branch 13 taken 13 times.
|
13 | LOG(Info, "Beginning to execute OpenStudio Measures"); |
| 22 |
2/2✓ Branch 1 taken 13 times.
✓ Branch 4 taken 12 times.
|
13 | applyMeasures(MeasureType::ModelMeasure, ApplyMeasureType::Regular); |
| 23 |
5/5✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 7 taken 12 times.
✓ Branch 10 taken 12 times.
✓ Branch 13 taken 12 times.
|
12 | LOG(Info, "Finished applying OpenStudio Measures."); |
| 24 | |||
| 25 |
5/5✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 7 taken 12 times.
✓ Branch 10 taken 12 times.
✓ Branch 13 taken 12 times.
|
12 | LOG(Info, "Beginning to execute Reporting Measures's Model Output Requests"); |
| 26 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
12 | applyMeasures(MeasureType::ReportingMeasure, ApplyMeasureType::ModelOutputRequests); |
| 27 |
5/5✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 7 taken 12 times.
✓ Branch 10 taken 12 times.
✓ Branch 13 taken 12 times.
|
12 | LOG(Info, "Finished applying Reporting Measures's Model Output Requests.") |
| 28 | |||
| 29 | // Save final OSM | ||
| 30 |
4/5✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
✓ Branch 7 taken 12 times.
✓ Branch 10 taken 12 times.
✗ Branch 11 not taken.
|
12 | if (!workflowJSON.runOptions()->fast()) { |
| 31 | // Save to run dir | ||
| 32 |
1/1✓ Branch 1 taken 12 times.
|
24 | auto savePath = workflowJSON.absoluteRunDir() / "in.osm"; |
| 33 |
2/2✓ Branch 1 taken 12 times.
✓ Branch 4 taken 12 times.
|
24 | detailedTimeBlock("Saving Final OSM to Run Dir", [this, &savePath]() { |
| 34 | // TODO: workflow gem was actually serializating via model.to_s for speed... | ||
| 35 | 12 | model.save(savePath, true); | |
| 36 | 12 | }); | |
| 37 | 12 | } | |
| 38 | |||
| 39 | 12 | communicateMeasureAttributes(); | |
| 40 | 12 | saveOSMToRootDirIfDebug(); | |
| 41 | 12 | } | |
| 42 | |||
| 43 | } // namespace openstudio | ||
| 44 |