Skip to content

Hierarchical Workflow

SimStadt simulations are executed via Workflows.

Workflow

workflow example

A workflow is a sequence of workflowsteps. For example:

  1. Read a CityGML file
  2. Create a SimStadtModel
  3. Preprocessing
  4. Get weather information for the location
  5. Calculate irradiance on every surface
  6. 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.

graph TD; START[ ] --> |Filename| A[Read CityGML]; A --> |File| B[Create SimStadtModel]; B --> |Model| C[Preprocessing]; C --> |Model| D[Get weather]; D --> |Model| E[Calculate irradiance]; E --> |Model| F[PV analysis]; F --> |CSV file| STOP[ ]; style START fill:#FFFFFF, stroke:#FFFFFF; style STOP fill:#FFFFFF, stroke:#FFFFFF;

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:

  1. Check geometry
  2. Look for roof, wall and ground surfaces
  3. Calculate volume
graph TD; START[ ] --> |Building| A[Check geometry]; A --> |Building| B[Analyse surfaces]; B --> |Building| C[Calculate volume]; C --> |Building| STOP[ ]; style START fill:#FFFFFF, stroke:#FFFFFF; style STOP fill:#FFFFFF, stroke:#FFFFFF;

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:

flowchart TD; START{Start} --> |Filename| A[Read CityGML]; A --> |File| B[Create SimStadtModel]; B --> |Model| Preprocessing; subgraph Preprocessing X[Check geometry] --> |Building| Y[Analyse surfaces]; Y --> |Building| Z[Calculate volume]; end Preprocessing --> |Model| D[Get weather]; D --> |Model| E[Calculate irradiance]; E --> |Model| F[PV analysis]; F --> |CSV file| STOP{Stop};

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()));
    }