Hierarchical Workflow
SimStadt simulations are executed via Workflows.
Workflow
A workflow is a sequence of workflowsteps. For example:
- Read a CityGML file
- Create a SimStadtModel
- Preprocessing
- Get weather information for the location
- Calculate irradiance on every surface
- Check if roof surfaces are suitable for photovoltaic.
This workflow needs a CityGML filename as an input, and outputs a CSV file with the suitable roofs. The output of each workflowstep needs to match the input of the following workflowstep.
This process will also work with a stream of CityGML filenames as input. In this case, the whole sequence will be run for every filename, and multiple CSV files will be written.
Sub-workflow
A complete workflow can be used as a workflowstep, inside a larger workflow.
For example, a Preprocessing sub-workflow can be defined as:
- Check geometry
- Look for roof, wall and ground surfaces
- Calculate volume
Top-level workflow
Since Preprocessing receives a SimStadtModel, it iterates over every SimStadtBuilding inside the SimStadtModel, before calling the inner workflowsteps. Once every step has been called for every building, Preprocessing returns a SimStadtModel so that the outer workflow can continue.
The complete workflow becomes:
Workflow builder
Workflows can be defined with a WorkflowBuilder. For example, in PhotovoltaicPotentialAnalysisWorkflowProvider
:
@Override
public CityGmlWorkflow<SimStadtModel> buildWorkflow() {
return new CityGmlWorkflow<>(WorkflowBuilder
.start(new ImportCityGml())
.next(new CreateSimStadtModel())
.next(new Preprocessing(WorkflowBuilder
.start(new GeometricPreprocessor())))
.next(new WeatherProcessor())
.next(new IrradianceProcessor())
.next(new PhotovoltaicPotential()));
}