Commit d10ba444 authored by Volker Coors's avatar Volker Coors
Browse files

Update 01 Background_and_Definitions.adoc

parent 72a20955
......@@ -26,7 +26,7 @@ In order to control the workflow in more detail, the C part can be configured e.
Dependencies:
* The C part executes the functional part. The C part depends on the F part, but the F part has to be independend of the C part
* The C part shall have no functionality that is relevant for the purpose of the WFS. Its purpose is to connect the functional part to a workflow in a given workflow environment.
* The C part shall have no functionality that is relevant for the purpose of the WFS. Its purpose is to connect the functional part to a workflow in a given workflow environment.
An example of a SD_connector is given in the SimStadt documentation. The example shows an empty workflow step without any functionality. Examples of a WS_connectors are provided in the SimStadt documentation on redmine.
......@@ -39,37 +39,39 @@ Math: The SimStadt data model is a heterogeneous algebra.
Birkhoff and Lipson (1968) have defined a heterogeneous algebra as a system A=[Σ,F] in which
1. Σ={S~i~} is a family of non-void sets S~i~ of different types of elements, each called a *phylum* of the algebra A. The *phyla* S~i~ are indexed by some set I; i.e. S~i~∈Σ for i∈I (or are called by appropriate names).
1. Σ={S~i~} is a family of non-void sets S~i~ of different types of elements, each called a _phylum_ of the algebra A. The _phyla_ S~i~ are indexed by some set I; i.e. S~i~∈Σ for i∈I (or are called by appropriate names).
2. F={f~α~} is a set of finitary operations, where each f~α~ is a mapping f~α~:S~i(1,α)~×S~i(2,α)~×⋯ ×S~i(n(α),α)~→S~r(α)~
for some non-negative integer n(α), function i~α~:k→i(k,α) from {1,2,⋯,n(α)} to I, and r(α)∈I. The operations f~α~ are indexed by some set Ω; i.e. f~α~∈F for α∈Ω (or are called by appropriate names).
Thus each operation f~α~ assigns to each n(α)-tuple (x~1~,⋯,x~n~(α) ), where x~j~∈S_(i(j,α)), some value f~α~ (x~1~,⋯,x~n(α)~ ) in S~r(α)~. The operation f is said to be n(α)-ary: unary when n(α)=1, binary when n(α)=2, ternary when n(α)=3, etc. When n(α)=0, it selects a fixed element (distinguished constant) of S_(r(α)).
Thus each operation f~α~ assigns to each n(α)-tuple (x~1~,⋯,x~n~(α) ), where x~j~∈S~i(j,α)~, some value f~α~ (x~1~,⋯,x~n(α)~ ) in S~r(α)~. The operation f~α~ is said to be n(α)-ary: unary when n(α)=1, binary when n(α)=2, ternary when n(α)=3, etc. When n(α)=0, it selects a fixed element (distinguished constant) of S~r(α)~.
An algebra which has only one Phylum will be called a homogeneous algebra; an algebra having more than one phylum, a heterogeous algebra.
An algebra which has only one phylum will be called a _homogeneous_ algebra; an algebra having more than one phylum, a _heterogeous_ algebra.
Example:
In this example, simple algebra A=[Σ,F] will be defined as a starting point of the SimStadt data model. Let S_0 be a set of buildings, and S_1=R. For reasons of simplicity, an intuitiv understanding of building is sufficient for now. It will be defined later in more detail. The Phylum Σ={S_0,S_1} of A consists of a set of buildings and a set of real numbers.
In this example, simple algebra A=[Σ,F] will be defined as a starting point of the SimStadt data model. Let S~0~ be a set of buildings, and S~1~=ℝ. For reasons of simplicity, an intuitiv understanding of _building_ is sufficient for now. It will be defined later in more detail. The phylum Σ={S~0~,S~1~} of A consists of a set of buildings and a set of real numbers.
F={f_0,f_1,f_2} consists of the three operations f_0 named buildingFactory, f_1 named volume, and f_2 named heatedVolume.
F={f~0~,f~1~,f~2~} consists of the three operations f~0~ named buildingFactory, f~1~ named volume, and f~2~ named heatedVolume.
f_0: →S_0 selects a building of the set of buildings.
f~0~: → S~0~ selects a building of the set of buildings.
f_1: S_0→S_1 assigns a volume to a building in S_0. Usually, the volume is calculated based on the solid geormetry of the building. But so far, solid geometry has not been introduced. The nice thing about math is, that the operation can still be definied, without the need to specify an algorithm to calculate the volume.
f~1~: S~0~ → S~1~ assigns a volume to a building in S~0~. Usually, the volume is calculated based on the solid geormetry of the building. But so far, solid geometry has not been introduced. The nice thing about math is, that the operation can still be definied, without the need to specify an algorithm to calculate the volume.
f_2: S_0→S_1 assigns a heating volume to a building in S_0. Let’s assume that for a building b∈S_0 the heated volume is given by the volume multiplied by a constant factor c∈S_1,c<1: f_2 (b)=c f_1 (b). In SimStadt, c=0.8 is used.
f~2~: S~0~ → S~1~ assigns a heating volume to a building in S~0~. Let’s assume that for a building b∈S~0~ the heated volume is given by the volume multiplied by a constant factor c∈S~1~,c<1: f~2~ (b)=c f~1~ (b). In SimStadt, c=0.8 is used.
As a result, we already have a first simple version of an algebra as a specification of a simple SimStadt data model.
This algebra can be implemented as a data model using UML.
A building will be implemented as a data type Building. The set of buildings S_0 will be implemented by a class BuildingCollection using the well know abstract data type Set. The set S_1 will be implemented as float. The class Building has three methods to implement the operations of F: Building() to create an instance of a Building, volume() to get the volume of a Building, and heatedVolume() to get the heated volume of a Building. Please note that in contrast to the operations f_1 and f_2 the methods volume() and heatedVolume() do not have a building as a parameter as they operate on the specific instance of the class Building.
A building will be implemented as a data type _Building_. The set of buildings S~0~ will be implemented by a class _BuildingCollection_ using the well know abstract data type Set. The set S~1~ will be implemented as _float_. The class _Building_ has three methods to implement the operations of F: _Building()_ to create an instance of a Building, _volume()_ to get the volume of a Building, and _heatedVolume()_ to get the heated volume of a Building. Please note that in contrast to the operations f~1~ and f~2~ the methods _volume()_ and _heatedVolume()_ do not have a building as a parameter as they operate on the specific instance of the class _Building_.
In Java, the data types Building and BuildingCollection can be implemented as classes:
[source,java]
----
class Building {
public Building() {};
......@@ -84,6 +86,7 @@ class Building {
class BuildingCollection extends Set {
}
----
Please notice that it is a simple example, and not implemented as such in the SimStadt data model. It is just an example to illustrate the relations / roles of an algebra as a mathematical concept, data types as an implementation of the algebra, and Java classes as an implementation of the data types. Algebra, data types, and Java class are similar concepts on a different level of abstraction.
......
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