diff --git a/D01 Integration of INSEL Models and SimStadt/02 Concept.adoc b/D01 Integration of INSEL Models and SimStadt/02 Concept.adoc index 12d2baed2932ba5cdf12ec8659081a7175db879c..f152a46c31084884b0effbb26f636d58541729a3 100644 --- a/D01 Integration of INSEL Models and SimStadt/02 Concept.adoc +++ b/D01 Integration of INSEL Models and SimStadt/02 Concept.adoc @@ -15,27 +15,52 @@ This statement in an INSEL template [source,java] ---- -{{electricalEfficiency}} % Electrical efficiency [-] +{{building.yearOfConstruction}} ---- -will be replaced by the value of the attribute _electricalEfficiency_ in the INSEL model by the INSEL templater Workflow step per building. +will be replaced by the value of the attribute _yearOfConstruction_ of the class _Building_ in the INSEL model by the INSEL templater Workflow step per building. If an attribute is not set in an instance of an object in SimStadt, a default value can be defined in the template: [source,java] ---- -{{getOrDefault electricalEfficiency 0.20}} % Electrical efficiency [-] +{{getOrDefault building.yearOfConstruction 9999}} ---- -# implementation +In this example, yearOf Construction is set to 9999 if not available for a specific building. -INSEL_Templater_WFS.png +The following example shows an INSEL template that write the yearOfConstruction per building. The INSEL templater read the template and generate an INSEL model per building by replacing the variables {{building.yearOfConstruction}} and {{building.gmlId}} with the attributes of each instance of the class _Building_. The variable {{step.location}} is always replaced by the same attribute of the workflow step. +[source] +---- +b 1 DO +p 1 + 1 + {{getOrDefault building.yearOfConstruction 9999}} + 1 +b 2 WRITE 1.1 +p 2 + 1 + 0 + '{{step.location}}/OneToN-{{building.gmlId}}.txt' + '*' +---- -An example of an INSEL template for a heat pump that is applied to the simulation of every building in SimStadt can be found here: - -https://gitlab.com/volkercoors/neqmodplus-steinbeis/uploads/c977bb7ac8882d1b2105813d35ea0b63/2020-04-17_HP_central_simple_constants_incl_defaults.txt[] - -The example is provided by Verena Weiler. +The resulting INSEL model generated for a specific _Building_ be the workflow step may look like this: +[source] +---- +b 1 DO +p 1 + 1 + 1980 + 1 +b 2 WRITE 1.1 +p 2 + 1 + 0 + './OneToN-gmlid01.txt' + '*' +---- +Running this INSEL model writes a file that contains the year of construction of the building. If the workflow is applied to a CityGML model with 150 _Buildings_, 150 INSEL models will be stored and executed, and the same amount of resulting files will be written.