Commit 5ea2f5d1 authored by Kai-Holger Brassel's avatar Kai-Holger Brassel
Browse files

Simplified Eclipse setup; honor current versions

parent 0bcb1392
Pipeline #6137 passed with stage
in 6 seconds
......@@ -10,9 +10,9 @@ image:https://mirrors.creativecommons.org/presskit/icons/by.svg[by,20]
image:https://mirrors.creativecommons.org/presskit/icons/nc.svg[nc,20]
image:https://mirrors.creativecommons.org/presskit/icons/nd.svg[nd,20]
Non-final version: January 31, 2022.
Non-final version: April 8th, 2022.
Go to link:https://www.khbrassel.de/parametercatalogs/ParameterCatalogs.pdf[PDF-Version as of January 31, 2022]
Go to link:https://www.khbrassel.de/parametercatalogs/ParameterCatalogs.pdf[PDF-Version as of April 8th, 2022]
include::ParameterCatalogs1Overview.adoc[]
......
......@@ -458,16 +458,16 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#trueeclipse-basics">Eclipse Basics</a></li>
<li><a href="#truesetup-eclipse-modeling-tools">Setup Eclipse Modeling Tools</a></li>
<li><a href="#trueexercise-modeling-a-parameter-catalog-with-ecore">Exercise: Modeling a Parameter Catalog with Ecore</a></li>
<li><a href="#truemaking-an-application-to-create-and-edit-data">Making an Application to Create and Edit Data</a></li>
<li><a href="#truemaking-a-prototype-application-to-create-and-edit-data">Making a Prototype Application to Create and Edit Data</a></li>
<li><a href="#trueworking-with-git-hosted-parameter-catalogs">Working with Git Hosted Parameter Catalogs</a></li>
<li><a href="#truesummary">Summary</a></li>
</ul>
</li>
<li><a href="#using-parameter-catalogs">TBD: Accessing and Using Parameter Catalogs</a>
<ul class="sectlevel2">
<li><a href="#trueaccessing-xml-catalogs-from-java">Accessing XML-Catalogs from Java</a></li>
<li><a href="#trueusing-ecore-catalog-data-with-java">Using Ecore Catalog Data with Java</a></li>
<li><a href="#trueusing-ecore-catalog-data-with-python">Using Ecore Catalog Data with Python</a></li>
<li><a href="#truecreate-insel-models-with-handlebars-templates">Create Insel Models with Handlebars Templates</a></li>
<li><a href="#trueaccessing-xml-catalogs-from-python">Accessing XML-Catalogs from Python</a></li>
</ul>
</li>
<li><a href="#truetbd-distribution-of-parameter-catalogs">TBD: Distribution of Parameter Catalogs</a>
......@@ -492,10 +492,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<span class="image"><img src="https://mirrors.creativecommons.org/presskit/icons/nd.svg" alt="nd" width="20"></span></p>
</div>
<div class="paragraph">
<p>Non-final version: January 31, 2022.</p>
<p>Non-final version: April 8th, 2022.</p>
</div>
<div class="paragraph">
<p>Go to <a href="https://www.khbrassel.de/parametercatalogs/ParameterCatalogs.pdf">PDF-Version as of January 31, 2022</a></p>
<p>Go to <a href="https://www.khbrassel.de/parametercatalogs/ParameterCatalogs.pdf">PDF-Version as of April 8th, 2022</a></p>
</div>
</div>
</div>
......@@ -838,7 +838,7 @@ Eclipse RCP is foundation of a plethora of general-purpose applications, too.</p
<p>An Eclipse package is an Eclipse distribution dedicated to a specific type of task.<sup class="footnote">[<a id="_footnoteref_3" class="footnote" href="#_footnotedef_3" title="View footnote.">3</a>]</sup>
A list of packages is available at <a href="https://www.eclipse.org/downloads/packages/">eclipse.org</a>.
Beside others it contains <em>Eclipse IDE for Java Developers</em>, <em>Eclipse IDE for Scientific Computing</em>, and <em>Eclipse Modeling Tools</em>.
Note that third parties offer many other packages, e.g. <em>GAMA</em> for multi-agent-simulation or <em>Obeo Designer Community</em> for creating diagram and form editors. This is the package we will use later.</p>
Note that third parties offer many other packages, e.g. <em>GAMA</em> for multi-agent-simulation.</p>
</div>
<div class="admonitionblock note">
<table>
......@@ -953,39 +953,32 @@ That way, we can follow the convention that local Git repositories should all be
<div class="sect2">
<h3 id="truesetup-eclipse-modeling-tools"><a class="anchor" href="#truesetup-eclipse-modeling-tools"></a>Setup Eclipse Modeling Tools</h3>
<div class="paragraph">
<div class="title">Install Java</div>
<p>Eclipse runs on 64-bit versions of Windows, Linux, and macOS and requires an according Java Development Kit (JDK), version 17 or higher, to be installed on your machine.
Even if such JDK is already installed on your machine, please download the JDK version <strong>17</strong> for your operating system from <a href="https://adoptium.net">Adoptium</a>.
Installation process is straight forward, but you can also find links to exhaustive instructions for your operating system.</p>
</div>
<div class="paragraph">
<p>New Java versions appear every six months, but we will stick for the coming years with version 17, since it comes with long time support (LTS).</p>
</div>
<div class="paragraph">
<p>Note that different versions of Java coexist peacefully.</p>
<div class="title"><span class="line-through">Install Java</span></div>
<p>Starting with version 2022-03 Eclipse packages come with a bundled Java Development Kit (JDK), version 17.
Thus, there is no need anymore to install a JDK manually.</p>
</div>
<div class="paragraph">
<div class="title">Install Eclipse Modeling Tools</div>
<p>Our graphical and form based modeling tools, e.g. Insel 9.0 and Parameter Catalogs, run on top of Eclipse Sirius, an open source framework that provides a set of features and plugins that can be added to any Eclipse package to transform it into a very flexible modeling workbench.</p>
</div>
<div class="paragraph">
<p>In the past, we used the pre-configured Eclipse package <em>Obeo Designer Community</em> from <a href="https://www.obeodesigner.com">Obeo</a>, but it wasn&#8217;t updated for a while and, thus, is stucked at Java version 14.</p>
</div>
<div class="paragraph">
<p>Instead, we install the Eclipse package <em>Eclipse Modeling Tools</em> first and, then, Eclipse Sirius on top. To get current version 4.22 (2021‑12) of <em>Eclipse Modeling Tools</em>, go to <a href="https://www.eclipse.org/downloads/packages/">www.eclipse.org/downloads/packages/</a>.
<p>We will install Eclipse package <em>Eclipse Modeling Tools</em> first and, then, Eclipse Sirius on top. To get current version 4.23 (2022‑03) of <em>Eclipse Modeling Tools</em>, go to <a href="https://www.eclipse.org/downloads/packages/">www.eclipse.org/downloads/packages/</a>.
On this page you may see <em>"Try the Eclipse Installer"</em> or similar.
Do <strong>not</strong> follow this advice, since we want more control over what versions of Java and Eclipse shall be installed.
Instead, look for package <em>Eclipse Modeling Tools</em> and follow the link for your operating system and system architecture displayed on the right:</p>
Do <strong>not</strong> follow this advice, since we want more control over what will be installed.
Instead, look for package <em>Eclipse Modeling Tools</em> and click the download link for your operating system and system architecture displayed on the right:</p>
</div>
<div class="imageblock thumb">
<div class="content">
<img src="ParameterCatalogs2Images/EclipseDownload.gif" alt="EclipseDownload" width="500">
<img src="ParameterCatalogs2Images/EclipseModelingDownload.png" alt="Eclipse Modeling Download" width="500">
</div>
<div class="title">Figure 1. Download links for Eclipse Modeling Tools package</div>
</div>
<div class="paragraph">
<p>Finally, click on <code>Download</code> and wait for the 450 something MB package to arrive.
Unzip the downloaded file and possibly rename the resulting application <code>Eclipse</code> to something more specific like <code>EclipseModeling2112</code>. Then, move the application to a suited directory. This would be <code>Applications</code> on macOS, similar on Linux, but <strong>not</strong> <code>Programs</code> or <code>Programs (x86)</code> on Windows!</p>
<p>Finally, click on <code>Download</code> and wait for the 550 something MB package to arrive.
On macOS this is a disk image file (.dmg) that is mounted by a double click. Drag and drop <code>Eclipse</code> to folder <em>Applications</em> and rename the copy to something more specific like <code>EclipseModeling2203</code>.</p>
</div>
<div class="paragraph">
<p>On windows and Linux unzip/extract the downloaded file and possibly rename the resulting application to <code>EclipseModeling2203</code> or similar. Then, move the application to a suited directory, but <strong>not</strong> <code>Programs</code> or <code>Programs (x86)</code> on Windows!</p>
</div>
<div class="admonitionblock warning">
<table>
......@@ -1070,60 +1063,84 @@ Especially under <code>Workbench Basics</code> you will find exhaustive document
</div>
<div class="paragraph">
<div class="title">Install Eclipse Sirius</div>
<p>While package <em>Eclipse Modeling Tools</em> already contains Sirius features that let you create graphical Ecore models, features for specifying your own forms and graphical editors are still missing. You can add these features easily from <em>Eclipse Marketplace</em>:</p>
<p>While package <em>Eclipse Modeling Tools</em> already contains Sirius features that let you create graphical Ecore models, features for specifying your own forms and graphical editors are still missing.
You can add these features easily with Eclipse&#8217;s built-in update mechanism:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Open dialog <code>Help &#8594; Eclipse Marketplace&#8230;&#8203;</code> and type <em>Search</em> into the search field</p>
<p>Open dialog <code>Help &#8594; Install New Software&#8230;&#8203;</code> (see screenshot below)</p>
</li>
<li>
<p>For <em>Work with:</em> choose software site <code>2022-03 - <a href="https://download.eclipse.org/releases/2022-03/" class="bare">https://download.eclipse.org/releases/2022-03/</a></code></p>
</li>
<li>
<p>Deselect <em>Group items by category</em></p>
</li>
<li>
<p>Type <em>Sirius</em> into the search field</p>
</li>
<li>
<p>From the list of features select</p>
<div class="ulist">
<ul>
<li>
<p><code>Sirius Properties Views - Specifier Support</code></p>
</li>
<li>
<p>Look for Sirius 6.6 or newer in the list of results and click <code>Install</code></p>
<p><code>Sirius Query API for AQL</code></p>
</li>
<li>
<p>From the list of features choose <code>Sirius Specifier Environment</code> and <code>Sirius Support for AQL</code> for installation and unchoose the others (see screen shot)</p>
<p><code>Sirius Specifier Environment</code></p>
</li>
<li>
<p>Confirm your choice, acknowlege any licenses, and restart Eclipse when asked for.</p>
<p><code>Sirius Support for AQL</code> and click <code>Next &gt;</code></p>
</li>
</ul>
</div>
</li>
<li>
<p>Acknowlege any licenses and restart Eclipse when asked for.</p>
</li>
</ul>
</div>
<div class="imageblock thumb">
<div class="content">
<img src="ParameterCatalogs2Images/InstallSirius.png" alt="InstallSirius" width="500">
<img src="ParameterCatalogs2Images/InstallSiriusSpecifier.png" alt="Install Sirius Specifier" width="500">
</div>
<div class="title">Figure 3. Download links for Eclipse Modeling Tools package</div>
</div>
<div class="paragraph">
<p>Above steps added commonly used software components to your Eclipse application, publicly available in the <em>Eclipse Marketplace</em>. In the next section, however, you will add features that were created specifically for parameter catalogs and hosted at the transfer portal of <em>HfT Stuttgart</em>.</p>
<div class="title">Figure 3. Install additional Sirius features</div>
</div>
<div id="quantity-plug-ins" class="paragraph">
<div class="title">Add Plug-ins to deal with Quantities and Units</div>
<p>Parameter catalogs should be able to represent quantities, not just bare numbers.
See <a href="https://onlinelibrary.wiley.com/doi/full/10.1002/spe.2926">Unit of measurement libraries, their popularity and suitability</a> for a systematic account of open source solutions in the this area.</p>
<p>Now we use the same update mechanism to add software components that were created specifically for parameter catalogs and hosted at the transfer portal of <em>HfT Stuttgart</em>.</p>
</div>
<div class="paragraph">
<p>Java provides an extensive framework to deal with quantities and their units defined in <a href="https://docs.google.com/document/d/12KhosAFriGCczBs6gwtJJDfg_QlANT92_lhxUWO2gCY/edit#heading=h.6698n7erex5o">Java Specification Request (JSR) 385</a>.
<p>Parameter catalogs should be able to represent quantities, not just bare numbers.
See <a href="https://onlinelibrary.wiley.com/doi/full/10.1002/spe.2926">Unit of measurement libraries, their popularity and suitability</a> for a systematic account of open source solutions in the this area.
Java provides an extensive framework to deal with quantities and their units defined in <a href="https://docs.google.com/document/d/12KhosAFriGCczBs6gwtJJDfg_QlANT92_lhxUWO2gCY/edit#heading=h.6698n7erex5o">Java Specification Request (JSR) 385</a>.
The reference implementation for this framework is <a href="https://unitsofmeasurement.github.io/indriya/">Indriya</a>. Demos of its usage can be found at <a href="https://unitsofmeasurement.github.io/uom-demos/" class="bare">https://unitsofmeasurement.github.io/uom-demos/</a>.</p>
</div>
<div class="paragraph">
<p>To make Indriya available for use in Ecore data models, the author has created two plug-ins that can easily be added to Eclipse. To do so, open dialog <code>Help &#8594; Install New Software&#8230;&#8203;</code> and enter site <code><a href="https://transfer.hft-stuttgart.de/pages/neqmodplus/indriya-p2/release_target_211/" class="bare">https://transfer.hft-stuttgart.de/pages/neqmodplus/indriya-p2/release_target_211/</a></code> like depicted below.</p>
<p>While Indriya offers all common SI units and more, the author provided additional units specific to urban simulation plus specialized Ecore types for specifying these units for attributes in Ecore data models as an Eclipse feature named <em>City Units</em>.</p>
</div>
<div class="paragraph">
<p>The new types are named <em>Quantity</em> and <em>TimeOfDay</em>.
Some examples of valid unit symbols are listed in this <a href="https://transfer.hft-stuttgart.de/gitlab/neqmodplus/de.hft-stuttgart.cityunits">README</a>.</p>
</div>
<div class="paragraph">
<p>To install <em>City Units</em>, open dialog <code>Help &#8594; Install New Software&#8230;&#8203;</code> and enter site <code><a href="https://transfer.hft-stuttgart.de/pages/neqmodplus/de.hft-stuttgart.cityunits/p2repo" class="bare">https://transfer.hft-stuttgart.de/pages/neqmodplus/de.hft-stuttgart.cityunits/p2repo</a></code> like depicted below.</p>
</div>
<div class="imageblock thumb">
<div class="content">
<img src="ParameterCatalogs2Images/AddUpdateSite.png" alt="Install Plug-in" width="500">
<img src="ParameterCatalogs2Images/InstallCityUnits.png" alt="Install Plug-in" width="500">
</div>
<div class="title">Figure 4. Install Plug-in from Specific Update Site</div>
<div class="title">Figure 4. Install Feature CityUnits from Update Site</div>
</div>
<div class="paragraph">
<p>Select Indriya plug-in, press <code>Next &gt;</code> and acknowledge all following dialogs, including security warnings.</p>
<p>Select <em>City Units</em>, press <code>Next &gt;</code> and acknowledge all following dialogs, including security warnings.</p>
</div>
<div class="paragraph">
<p>Do the same for the City Units plug-in available at site <code><a href="https://transfer.hft-stuttgart.de/pages/neqmodplus/de.hft-stuttgart.cityunits/release_target_110/" class="bare">https://transfer.hft-stuttgart.de/pages/neqmodplus/de.hft-stuttgart.cityunits/release_target_110/</a></code>
Finally, restart Eclipse to complete plug-in installation.</p>
</div>
<div class="paragraph">
<p>While the first plug-in installs Indriya, the second plug-in adds some specific units for urban simulation and Ecore types used for modeling quantities as attributes of classes.</p>
<p>Finally, restart Eclipse to complete installation.</p>
</div>
</div>
<div class="sect2">
......@@ -1598,7 +1615,7 @@ Note that Eclipse synchronizes different editors of the same content automatical
</div>
</div>
<div class="sect2">
<h3 id="truemaking-an-application-to-create-and-edit-data"><a class="anchor" href="#truemaking-an-application-to-create-and-edit-data"></a>Making an Application to Create and Edit Data</h3>
<h3 id="truemaking-a-prototype-application-to-create-and-edit-data"><a class="anchor" href="#truemaking-a-prototype-application-to-create-and-edit-data"></a>Making a Prototype Application to Create and Edit Data</h3>
<div class="paragraph">
<p>In this section you will get a glimpse on how to create an application to create and edit data conforming to the Ecore data model of our demo parameters catalog.</p>
</div>
......@@ -1655,7 +1672,7 @@ Note that Eclipse synchronizes different editors of the same content automatical
</div>
<div class="paragraph">
<div class="title">Create a Prototype Application for Data Editing and UI Design</div>
<p>Firstly, launch a new instance of the running <em>Obeo Designer</em> application:</p>
<p>Firstly, launch a new instance of the running <em>Eclipse</em> application:</p>
</div>
<div class="olist arabic">
<ol class="arabic">
......@@ -1663,7 +1680,7 @@ Note that Eclipse synchronizes different editors of the same content automatical
<p>Execute <code>Run &#8594; Run Configurations&#8230;&#8203;</code> from the main menu and double click on <em>Eclipse Application</em> to get a <em>New_configuration</em>. You may want to rename <em>New_configuration</em> to <em>DemoCatalog</em> or the like.</p>
</li>
<li>
<p>Press <code>Run</code> to start the new Eclipse application that is basically a copy of your running <em>Obeo Designer</em> application but with a different workspace.</p>
<p>Press <code>Run</code> to start the new Eclipse application that is basically a copy of your running <em>Eclipse</em> but with a different workspace.</p>
</li>
<li>
<p>In the new application window close the welcome screen and open the Sirius perspective using the suited button in the top right corner of the main window. This perspective provides specific Sirius menus and new project types.</p>
......@@ -1866,7 +1883,7 @@ But you can add new Boilers any time via command <code>New child &#8594; Boiler<
Such a command would have to be described in <code>democatalog.odesign</code> first.</p>
</div>
<div class="paragraph">
<p>Be aware that applications with UI design and example data launched from <em>Obeo Designer</em> are meant to be prototypes for the final software only.
<p>Be aware that applications with UI design and example data launched from development environment are meant to be prototypes for the final software only.
In fact, any saved changes in the design file are instantly reflected in the UI.
During refinement of model and UI, data sets can be created, edited, and tested for usability without the need to built deployable software component. (On deployment, see parts <em>Accessing and Using Parameter Catalogs</em> and <em>Build (Parameter Catalog) Applications with Eclipse Tycho</em> below.)</p>
</div>
......@@ -1884,7 +1901,7 @@ However, since the UI is not implemented by program code, but a description in a
<h3 id="trueworking-with-git-hosted-parameter-catalogs"><a class="anchor" href="#trueworking-with-git-hosted-parameter-catalogs"></a>Working with Git Hosted Parameter Catalogs</h3>
<div class="paragraph">
<p>Ecore data models and Sirius based UI design are used to create parameter catalog software hosted in Git repositories.
To work with these, all you need is Jave 16 and the <em>Obeo Designer</em> with plug-ins for handling of Units installed (see <a href="#Setup Obeo Designer">[Setup Obeo Designer]</a> for details.)</p>
To work with these, all you need is Java, <em>Eclipse</em> with required plug-ins for Sirius and Unit handling (see <a href="#truesetup-eclipse-modeling-tools">Setup Eclipse Modeling Tools</a> for details.)</p>
</div>
<div class="paragraph">
<div class="title">Import Modeling Projects from Git</div>
......@@ -1897,14 +1914,14 @@ To work with these, all you need is Jave 16 and the <em>Obeo Designer</em> with
<a href="https://rs-loy-gitlab.concordia.ca/parameter-catalogs-ecore/greenery-catalog.git" class="bare">https://rs-loy-gitlab.concordia.ca/parameter-catalogs-ecore/greenery-catalog.git</a> and provide your credentials in fields <em>User</em> and <em>Password</em>. <strong>Tick check box <em>Store in Secure Store</em> and provide a master password if required!</strong> If you don&#8217;t, be prepared to be prompted for your credentials over and over again</p>
</li>
<li>
<p>Click <code>Next &gt;</code> and select a repository branch to check out, usually <em>master</em></p>
<p>Click <code>Next &gt;</code> and select a repository branch to check out, usually <em>main</em> or <em>master</em></p>
</li>
<li>
<p>Click <code>Next &gt;</code> and choose the directory on your file system where to store the repository, e.g.
<code>&lt;user home&gt;/git/greenery-catalog</code>. Here, we adhere to the convention is to have all git repositories stored in <code>&lt;user home&gt;/git/</code></p>
</li>
<li>
<p>After data transfer has completed, the wizard offers to <em>Import existing Eclipse projects</em>. Click <code>Next &gt;</code> and select the project with suffix <code>.model</code>, <code>.edit</code> and <code>.editor</code> for import, e.g. <code>ca.concordia.usp.greenerycatalog.model</code> etc.</p>
<p>After data transfer has completed, the wizard offers to <em>Import existing Eclipse projects</em>. Click <code>Next &gt;</code> and select the project with suffix <code>.design</code>, <code>.model</code>, <code>.edit</code> and <code>.editor</code> for import, e.g. <code>ca.concordia.usp.greenerycatalog.model</code> etc.</p>
</li>
<li>
<p>Click <code>Finish</code>.</p>
......@@ -1942,7 +1959,7 @@ Then, press <code>Run</code> to start the application, close the welcome screen
<p>Execute <code>File &#8594; Import&#8230;&#8203;</code> for the import wizard</p>
</li>
<li>
<p>Browse to the directory containing the projects (e.g. <code>&lt;user home&gt;/git/greenery-catalog</code>) and check just the projects with suffixes <code>.data</code> and <code>.design</code> for import, e.g. <code>ca.concordia.usp.greenerycatalog.data</code> , <code>ca.concordia.usp.greenerycatalog.design</code></p>
<p>Browse to the directory containing the projects (e.g. <code>&lt;user home&gt;/git/greenery-catalog</code>) and check just the project with suffix <code>.data</code> for import, e.g. <code>ca.concordia.usp.greenerycatalog.data</code></p>
</li>
<li>
<p>Click <code>Finish</code>.</p>
......@@ -2092,7 +2109,7 @@ can inform a programmer that wants to use the generated API.</p>
<p>Congratulations on making it this far. What have we achieved?</p>
</div>
<div class="paragraph">
<p>We get to know the <em>Obeo Designer</em> IDE and created a graphical Ecore data model with one catalog class and five classes/types of domain objects therein.
<p>We get to know <em>Eclipse Modeling Tools</em> and created a graphical Ecore data model with one catalog class and five classes/types of domain objects therein.
Classes have been defined by name, attributes, and relationships between them, often with cardinalities.
Whenever classes shared some attributes or relationships we factored these out into super classes.
An enumeration introduced a new attribute type as a set of named values.</p>
......@@ -2111,16 +2128,192 @@ We implemented a prototypical user interface for this data with <em>Eclipse Siri
<div class="sect1">
<h2 id="using-parameter-catalogs"><a class="anchor" href="#using-parameter-catalogs"></a>TBD: Accessing and Using Parameter Catalogs</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Some terminology first:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The <em>Urban Simulation Platform</em> at CERC shall support scientists, urban planners and stake holders in performing <em>Urban Simulation Projects</em></p>
</li>
<li>
<p>An <em>Urban Simulation Project</em> aims at evaluating one or several <em>Urban Scenarios</em> with respect to climate, environmental, economic and social performance.</p>
</li>
<li>
<p>An <em>Urban Scenario</em> describes a real or envisioned <em>Urban Infrastructure</em> in combination with a <em>Scenario Description</em>, that systematically <strong>assigns</strong> <em>Archetypes</em> to the elements of an <em>Urban Infrastructure</em> so that different policy measures, technological, environmental, social, or economic conditions can be modeled and simulated.</p>
</li>
<li>
<p><em>Urban Infrastructure</em> is a model of the build environment at a specific year and geographic location, embedded in a given landscape, natural and urban environment.</p>
</li>
<li>
<p><em>Urban Development Scenario</em> would be a series of <em>Urban Scenarios</em> over several years that could be created manually or rule-based.</p>
</li>
<li>
<p>Abstractly, an <em>Archetype</em> is an identifiable set of parameters for some component or system of components that should be easily/automatically be assignable to elements of an <em>Urban Infrastructure</em>. See the examples in the table below.</p>
</li>
</ul>
</div>
<table class="tableblock frame-all grid-all stretch">
<caption class="title">Table 2. Archetypes</caption>
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 33.3333%;">
<col style="width: 33.3334%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Archetypes for</th>
<th class="tableblock halign-left valign-top">Defined by</th>
<th class="tableblock halign-left valign-top">Identifiable and Assignable by</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">buildings</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">archetypes for windows, walls, roofs, energy systems</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">function, renovation state, age, geometry/size, world region/climate</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">walls, roofs</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">materials and sequence of material layers of certain thickness</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">windows</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">glazing number, U-value, &#8230;&#8203;</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">occupation</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">common patterns or schedules of usage of <em>Urban Infrastructure</em> elements, e.g. buildings or roads</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>
<div class="ulist">
<ul>
<li>
<p>Building archetype, assignable via building function, renovation state, age, geometry/size, world region/climate: a collection of archetypes for windows, walls, roofs, energy systems</p>
</li>
<li>
<p>Wall/Roof archetype, assignable via building archetype:</p>
</li>
<li>
<p>Vegetation archetype, assignable via world region/climate, underground, roof/wall geometry, landscape: specific sequence of soil layers with a certain mixture of plants</p>
</li>
<li>
<p>Meteorology: Climate parameters and weather data (assignable via geographic location)</p>
</li>
<li>
<p>Energy System archetype: ?</p>
</li>
<li>
<p>Occupation archetype: Common patterns or schedules of occupation and usage of elements of the _Urban_Infrastructure, e.g. buildings or roads</p>
</li>
<li>
<p>Water tube archetype: ?</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Parameter catalogs provide manual and programmatic access to parameters describing general or often used components or systems of components that describe parts of an urban model (aka infrastructure data). These components or systems of components are called <em>archetypes</em>.</p>
</div>
<div class="sect2">
<h3 id="trueaccessing-xml-catalogs-from-java"><a class="anchor" href="#trueaccessing-xml-catalogs-from-java"></a>Accessing XML-Catalogs from Java</h3>
<h3 id="trueusing-ecore-catalog-data-with-java"><a class="anchor" href="#trueusing-ecore-catalog-data-with-java"></a>Using Ecore Catalog Data with Java</h3>
</div>
<div class="sect2">
<h3 id="truecreate-insel-models-with-handlebars-templates"><a class="anchor" href="#truecreate-insel-models-with-handlebars-templates"></a>Create Insel Models with Handlebars Templates</h3>
<h3 id="trueusing-ecore-catalog-data-with-python"><a class="anchor" href="#trueusing-ecore-catalog-data-with-python"></a>Using Ecore Catalog Data with Python</h3>
<div class="paragraph">
<p>To access catalog data via Python, we use PyEcore, a Python re-implementation of Ecore (see <a href="https://pyecore.readthedocs.io/en/latest/">PyEcore Documentation</a>)</p>
</div>
<div class="paragraph">
<p>While it is possible to work with an Ecore data model and according data in a purely dynamical fashion by accessing data just by name using reflection, here we prefer a "statical" approach, that generates explicit Python classes from the Ecore data model in a first step according to <a href="https://pyecore.readthedocs.io/en/latest/user/quickstart.html#static-metamodels">this part of the above documentation</a>.</p>
</div>
<div class="paragraph">
<p>After installation of the required Python libraries <code>pyecore</code> and <code>pyecoregen</code> (see documentation above), this command generates Python classes from an Ecore data model:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>pyecoregen -e EnergyComponentsForPython.ecore -o .</pre>
</div>
</div>
<div class="paragraph">
<p>Here we assume an Ecore data model <code>EnergyComponentsForPython.ecore</code> to be located in the current directory and the output be generated in a new directory located besides the model file.
See contents of <code>python</code> in project <code>/de.hftstuttgart.energycomponents.model</code> as an example.</p>
</div>
<div class="paragraph">
<p>Note that <code>EnergyComponentsForPython.ecore</code> is different from the original <code>EnergyComponents.ecore</code> in that attribute type <code>Quantity</code> was replaced by <code>String</code> for now, since a suited Python library to represent Units and Quantites has not been choosen yet.</p>
</div>
<div class="paragraph">
<p>With Python Ecore libraries and generated classes in place, according catalog data can be imported and queried like so:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>from pyecore.resources import ResourceSet, URI
from energycomponents import EnergyComponentsCatalog</pre>
</div>
</div>
<div class="literalblock">
<div class="content">
<pre>rset = ResourceSet()
resource = rset.get_resource(URI('EnergyComponentsForPython.ecore'))
datamodel_root = resource.contents[0]
rset.metamodel_registry[datamodel_root.nsURI] = datamodel_root</pre>
</div>
</div>
<div class="literalblock">
<div class="content">
<pre># At this point, the .ecore data model is loaded in 'rset'</pre>
</div>
</div>
<div class="literalblock">
<div class="content">
<pre>resource = rset.get_resource(URI('HfTStuttgart.energycomponents'))
catalog: EnergyComponentsCatalog = resource.contents[0]</pre>
</div>
</div>
<div class="literalblock">
<div class="content">
<pre># Navigate data with lambdas, attributes and references
for res in filter(lambda chp: float(chp.electricalEfficiency) &lt; 0.32, catalog.combinedHeatPowerUtilities):
print("Efficiency of CHP", sel.modelName, "by",
res.manufacturer.name, ":", res.electricalEfficiency)</pre>
</div>
</div>
<div class="paragraph">
<p>With <code>HfTStuttgart.energycomponents</code> as input, we get:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>Efficiency of CHP GB4-8 by GIESE Energie- und Regeltechnik GmbH : 0.26
Efficiency of CHP Mephisto G16+ by kraftwerk Kraft-Wärme-Kopplung GmbH : 0.315
Efficiency of CHP M-AT 12 by Motoren AT GmbH : 0.279</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="trueaccessing-xml-catalogs-from-python"><a class="anchor" href="#trueaccessing-xml-catalogs-from-python"></a>Accessing XML-Catalogs from Python</h3>
<h3 id="truecreate-insel-models-with-handlebars-templates"><a class="anchor" href="#truecreate-insel-models-with-handlebars-templates"></a>Create Insel Models with Handlebars Templates</h3>
<div style="page-break-after: always;"></div>
</div>
</div>
......@@ -2243,7 +2436,7 @@ Verify that Maven version 3.6.3 or above is now installed in <code>Window &#8594
</div>
<div id="footer">
<div id="footer-text">
Last updated 2022-01-31 12:48:18 +0100
Last updated 2022-04-08 12:30:48 +0200
</div>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/styles/github.min.css">
......
......@@ -92,33 +92,27 @@ That way, we can follow the convention that local Git repositories should all be
=== Setup Eclipse Modeling Tools
.Install Java
Eclipse runs on 64-bit versions of Windows, Linux, and macOS and requires an according Java Development Kit (JDK), version 17 or higher, to be installed on your machine.
Even if such JDK is already installed on your machine, please download the JDK version *17* for your operating system from https://adoptium.net[Adoptium].
Installation process is straight forward, but you can also find links to exhaustive instructions for your operating system.
New Java versions appear every six months, but we will stick for the coming years with version 17, since it comes with long time support (LTS).
Note that different versions of Java coexist peacefully.
.[line-through]##Install Java##
Starting with version 2022-03 Eclipse packages come with a bundled Java Development Kit (JDK), version 17.
Thus, there is no need anymore to install a JDK manually.
.Install Eclipse Modeling Tools
Our graphical and form based modeling tools, e.g. Insel 9.0 and Parameter Catalogs, run on top of Eclipse Sirius, an open source framework that provides a set of features and plugins that can be added to any Eclipse package to transform it into a very flexible modeling workbench.
In the past, we used the pre-configured Eclipse package _Obeo Designer Community_ from https://www.obeodesigner.com[Obeo], but it wasn't updated for a while and, thus, is stucked at Java version 14.
Instead, we install the Eclipse package _Eclipse Modeling Tools_ first and, then, Eclipse Sirius on top. To get current version 4.22 (2021‑12) of _Eclipse Modeling Tools_, go to https://www.eclipse.org/downloads/packages/[www.eclipse.org/downloads/packages/].
We will install Eclipse package _Eclipse Modeling Tools_ first and, then, Eclipse Sirius on top. To get current version 4.23 (2022‑03) of _Eclipse Modeling Tools_, go to https://www.eclipse.org/downloads/packages/[www.eclipse.org/downloads/packages/].
On this page you may see _"Try the Eclipse Installer"_ or similar.
Do *not* follow this advice, since we want more control over what versions of Java and Eclipse shall be installed.
Instead, look for package _Eclipse Modeling Tools_ and follow the link for your operating system and system architecture displayed on the right:
Do *not* follow this advice, since we want more control over what will be installed.
Instead, look for package _Eclipse Modeling Tools_ and click the download link for your operating system and system architecture displayed on the right:
.Download links for Eclipse Modeling Tools package
image::EclipseDownload.gif[EclipseDownload, 500, role="thumb"]
image::EclipseModelingDownload.png[Eclipse Modeling Download, 500, role="thumb"]
Finally, click on `Download` and wait for the 550 something MB package to arrive.
On macOS this is a disk image file (.dmg) that is mounted by a double click. Drag and drop `Eclipse` to folder _Applications_ and rename the copy to something more specific like `EclipseModeling2203`.
Finally, click on `Download` and wait for the 450 something MB package to arrive.
Unzip the downloaded file and possibly rename the resulting application `Eclipse` to something more specific like `EclipseModeling2112`. Then, move the application to a suited directory. This would be `Applications` on macOS, similar on Linux, but **not** `Programs` or `Programs (x86)` on Windows!
On windows and Linux unzip/extract the downloaded file and possibly rename the resulting application to `EclipseModeling2203` or similar. Then, move the application to a suited directory, but **not** `Programs` or `Programs (x86)` on Windows!
[WARNING]
====
......@@ -154,39 +148,47 @@ Now you should see the initial window layout with _Model Explorer_ and _Outline_
.Install Eclipse Sirius
While package _Eclipse Modeling Tools_ already contains Sirius features that let you create graphical Ecore models, features for specifying your own forms and graphical editors are still missing. You can add these features easily from _Eclipse Marketplace_:
While package _Eclipse Modeling Tools_ already contains Sirius features that let you create graphical Ecore models, features for specifying your own forms and graphical editors are still missing.
You can add these features easily with Eclipse's built-in update mechanism:
* Open dialog `Help -> Eclipse Marketplace...` and type _Sirius_ into the search field
* Look for Sirius 6.6 or newer in the list of results and click `Install`
* From the list of features choose `Sirius Specifier Environment` and `Sirius Support for AQL` for installation and unchoose the others (see screen shot)
* Confirm your choice, acknowlege any licenses, and restart Eclipse when asked for.
* Open dialog `Help -> Install New Software...` (see screenshot below)
* For _Work with:_ choose software site `2022-03 - https://download.eclipse.org/releases/2022-03/`
* Deselect _Group items by category_
* Type _Sirius_ into the search field
* From the list of features select
** `Sirius Properties Views - Specifier Support`
** `Sirius Query API for AQL`
** `Sirius Specifier Environment`
** `Sirius Support for AQL` and click `Next >`
* Acknowlege any licenses and restart Eclipse when asked for.
.Download links for Eclipse Modeling Tools package
image::InstallSirius.png[InstallSirius, 500, role="thumb"]
Above steps added commonly used software components to your Eclipse application, publicly available in the _Eclipse Marketplace_. In the next section, however, you will add features that were created specifically for parameter catalogs and hosted at the transfer portal of _HfT Stuttgart_.
.Install additional Sirius features
image::InstallSiriusSpecifier.png[Install Sirius Specifier, 500, role="thumb"]
[[quantity-plug-ins]]
.Add Plug-ins to deal with Quantities and Units
Now we use the same update mechanism to add software components that were created specifically for parameter catalogs and hosted at the transfer portal of _HfT Stuttgart_.
Parameter catalogs should be able to represent quantities, not just bare numbers.
See https://onlinelibrary.wiley.com/doi/full/10.1002/spe.2926[Unit of measurement libraries, their popularity and suitability] for a systematic account of open source solutions in the this area.
Java provides an extensive framework to deal with quantities and their units defined in https://docs.google.com/document/d/12KhosAFriGCczBs6gwtJJDfg_QlANT92_lhxUWO2gCY/edit#heading=h.6698n7erex5o[Java Specification Request (JSR) 385].
The reference implementation for this framework is https://unitsofmeasurement.github.io/indriya/[Indriya]. Demos of its usage can be found at https://unitsofmeasurement.github.io/uom-demos/[].
To make Indriya available for use in Ecore data models, the author has created two plug-ins that can easily be added to Eclipse. To do so, open dialog `Help -> Install New Software...` and enter site `https://transfer.hft-stuttgart.de/pages/neqmodplus/indriya-p2/release_target_211/` like depicted below.
While Indriya offers all common SI units and more, the author provided additional units specific to urban simulation plus specialized Ecore types for specifying these units for attributes in Ecore data models as an Eclipse feature named _City Units_.
The new types are named _Quantity_ and _TimeOfDay_.
Some examples of valid unit symbols are listed in this https://transfer.hft-stuttgart.de/gitlab/neqmodplus/de.hft-stuttgart.cityunits[README].
.Install Plug-in from Specific Update Site
image::AddUpdateSite.png[Install Plug-in, 500, role="thumb"]
To install _City Units_, open dialog `Help -> Install New Software...` and enter site `https://transfer.hft-stuttgart.de/pages/neqmodplus/de.hft-stuttgart.cityunits/p2repo` like depicted below.
Select Indriya plug-in, press `Next >` and acknowledge all following dialogs, including security warnings.
.Install Feature CityUnits from Update Site
image::InstallCityUnits.png[Install Plug-in, 500, role="thumb"]
Do the same for the City Units plug-in available at site `https://transfer.hft-stuttgart.de/pages/neqmodplus/de.hft-stuttgart.cityunits/release_target_110/`
Finally, restart Eclipse to complete plug-in installation.
Select _City Units_, press `Next >` and acknowledge all following dialogs, including security warnings.
While the first plug-in installs Indriya, the second plug-in adds some specific units for urban simulation and Ecore types used for modeling quantities as attributes of classes.
Finally, restart Eclipse to complete installation.
=== Exercise: Modeling a Parameter Catalog with Ecore
......@@ -519,7 +521,7 @@ That's it for the data modeling part. By now, your Ecore model should look like
image::Homework.png[Homework, role="thumb"]
=== Making an Application to Create and Edit Data
=== Making a Prototype Application to Create and Edit Data
In this section you will get a glimpse on how to create an application to create and edit data conforming to the Ecore data model of our demo parameters catalog.
......@@ -684,10 +686,10 @@ To connect to a Git repository open the _Import Projects from Git_ wizard via `F
. Copy the URI of the git repository into the according input field, e.g.:
https://rs-loy-gitlab.concordia.ca/parameter-catalogs-ecore/greenery-catalog.git and provide your credentials in fields _User_ and _Password_. *Tick check box _Store in Secure Store_ and provide a master password if required!* If you don't, be prepared to be prompted for your credentials over and over again
. Click `Next >` and select a repository branch to check out, usually _master_
. Click `Next >` and select a repository branch to check out, usually _main_ or _master_
. Click `Next >` and choose the directory on your file system where to store the repository, e.g.
`<user home>/git/greenery-catalog`. Here, we adhere to the convention is to have all git repositories stored in `<user home>/git/`
. After data transfer has completed, the wizard offers to _Import existing Eclipse projects_. Click `Next >` and select the project with suffix `.model`, `.edit` and `.editor` for import, e.g. `ca.concordia.usp.greenerycatalog.model` etc.
. After data transfer has completed, the wizard offers to _Import existing Eclipse projects_. Click `Next >` and select the project with suffix `.design`, `.model`, `.edit` and `.editor` for import, e.g. `ca.concordia.usp.greenerycatalog.model` etc.
. Click `Finish`.
Now you can work on the data model like you did with the demo catalog. Find it under `model` in `ca.concordia.usp.greenerycatalog.model` (compare fig. <<fig-ecore-modeling-project>>).
......@@ -706,7 +708,7 @@ Simply reuse the _Run Configuration_ specified above, when starting the applicat
Now, import the projects that contain data and UI design, respectively:
. Execute `File -> Import...` for the import wizard
. Browse to the directory containing the projects (e.g. `<user home>/git/greenery-catalog`) and check just the projects with suffixes `.data` and `.design` for import, e.g. `ca.concordia.usp.greenerycatalog.data` , `ca.concordia.usp.greenerycatalog.design`
. Browse to the directory containing the projects (e.g. `<user home>/git/greenery-catalog`) and check just the project with suffix `.data` for import, e.g. `ca.concordia.usp.greenerycatalog.data`
. Click `Finish`.
When closing the application, it asks to store or dismiss any changes in data or UI design. You can also save these any time with `File -> Save All`.
......
[#using-parameter-catalogs]
== TBD: Accessing and Using Parameter Catalogs
=== Accessing XML-Catalogs from Java
Some terminology first:
- The _Urban Simulation Platform_ at CERC shall support scientists, urban planners and stake holders in performing _Urban Simulation Projects_
- An _Urban Simulation Project_ aims at evaluating one or several _Urban Scenarios_ with respect to climate, environmental, economic and social performance.
- An _Urban Scenario_ describes a real or envisioned _Urban Infrastructure_ in combination with a _Scenario Description_, that systematically **assigns** _Archetypes_ to the elements of an _Urban Infrastructure_ so that different policy measures, technological, environmental, social, or economic conditions can be modeled and simulated.
- _Urban Infrastructure_ is a model of the build environment at a specific year and geographic location, embedded in a given landscape, natural and urban environment.
- _Urban Development Scenario_ would be a series of _Urban Scenarios_ over several years that could be created manually or rule-based.
- Abstractly, an _Archetype_ is an identifiable set of parameters for some component or system of components that should be easily/automatically be assignable to elements of an _Urban Infrastructure_. See the examples in the table below.
.Archetypes
[width="100%",options="header"]
|====================
| Archetypes for | Defined by | Identifiable and Assignable by
| buildings | archetypes for windows, walls, roofs, energy systems | function, renovation state, age, geometry/size, world region/climate
| walls, roofs | materials and sequence of material layers of certain thickness |
| windows | glazing number, U-value, ... |
| | |
| | |
| occupation | common patterns or schedules of usage of _Urban Infrastructure_ elements, e.g. buildings or roads |
| | |
| | |
|====================
- Building archetype, assignable via building function, renovation state, age, geometry/size, world region/climate: a collection of archetypes for windows, walls, roofs, energy systems
- Wall/Roof archetype, assignable via building archetype:
- Vegetation archetype, assignable via world region/climate, underground, roof/wall geometry, landscape: specific sequence of soil layers with a certain mixture of plants
- Meteorology: Climate parameters and weather data (assignable via geographic location)
- Energy System archetype: ?
- Occupation archetype: Common patterns or schedules of occupation and usage of elements of the _Urban_Infrastructure, e.g. buildings or roads
- Water tube archetype: ?
Parameter catalogs provide manual and programmatic access to parameters describing general or often used components or systems of components that describe parts of an urban model (aka infrastructure data). These components or systems of components are called _archetypes_.
=== Using Ecore Catalog Data with Java
=== Using Ecore Catalog Data with Python
To access catalog data via Python, we use PyEcore, a Python re-implementation of Ecore (see https://pyecore.readthedocs.io/en/latest/[PyEcore Documentation])
While it is possible to work with an Ecore data model and according data in a purely dynamical fashion by accessing data just by name using reflection, here we prefer a "statical" approach, that generates explicit Python classes from the Ecore data model in a first step according to https://pyecore.readthedocs.io/en/latest/user/quickstart.html#static-metamodels[this part of the above documentation].
After installation of the required Python libraries `pyecore` and `pyecoregen` (see documentation above), this command generates Python classes from an Ecore data model:
pyecoregen -e EnergyComponentsForPython.ecore -o .
Here we assume an Ecore data model `EnergyComponentsForPython.ecore` to be located in the current directory and the output be generated in a new directory located besides the model file.
See contents of `python` in project `/de.hftstuttgart.energycomponents.model` as an example.
Note that `EnergyComponentsForPython.ecore` is different from the original `EnergyComponents.ecore` in that attribute type `Quantity` was replaced by `String` for now, since a suited Python library to represent Units and Quantites has not been choosen yet.
With Python Ecore libraries and generated classes in place, according catalog data can be imported and queried like so:
from pyecore.resources import ResourceSet, URI
from energycomponents import EnergyComponentsCatalog
rset = ResourceSet()
resource = rset.get_resource(URI('EnergyComponentsForPython.ecore'))
datamodel_root = resource.contents[0]
rset.metamodel_registry[datamodel_root.nsURI] = datamodel_root
# At this point, the .ecore data model is loaded in 'rset'
resource = rset.get_resource(URI('HfTStuttgart.energycomponents'))
catalog: EnergyComponentsCatalog = resource.contents[0]
# Navigate data with lambdas, attributes and references
for res in filter(lambda chp: float(chp.electricalEfficiency) < 0.32, catalog.combinedHeatPowerUtilities):
print("Efficiency of CHP", sel.modelName, "by",
res.manufacturer.name, ":", res.electricalEfficiency)
With `HfTStuttgart.energycomponents` as input, we get:
Efficiency of CHP GB4-8 by GIESE Energie- und Regeltechnik GmbH : 0.26
Efficiency of CHP Mephisto G16+ by kraftwerk Kraft-Wärme-Kopplung GmbH : 0.315
Efficiency of CHP M-AT 12 by Motoren AT GmbH : 0.279
=== Create Insel Models with Handlebars Templates
......@@ -12,5 +90,4 @@
.Creation of submodels, e.g. for computing parameterized functions
=== Accessing XML-Catalogs from Python
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment