AG VLSI Design and Architecture

SFB 501 - Project D1: Application System "Buildings"

PSiGene

Example - Step II

[PSiGene]



Step II: Pattern Bindings

After setting up the class model, the pattern editor (PEdit) can be used to bind patterns from the catalog to this model. Each pattern describes a partial functionality of the simulation component. The binding is done by assigning values to a patterns' interface (described by formal parameters).

In our simulator, we want to simulate the temperature of the rooms in a house. Browsing through the physical effects section of the pattern catalog, the pattern ThermalMass which provides this functionality can easily be found. The interface of ThermalMass is described by the following parameters:


ThermalMass

NameTypeDescription
targetObjectType An Objecttype whose temperature should be simulated
temperatureAttribute Actual (i.e. last computed) temperature
amountOfHeatAttribute Actual amount of heat in Joule
volumeAttribute Volume of the thermal mass
timeOfLastComputationAttribute (preset) Last timestamp when the calculation was executed
initSingleMethod (implement, preset) Initialize temperature and amountOfHeat
computeSingleMethod (implement) Computes the actual temperature
calculateTemperatureSingleMethod (implement, preset) Internal calculation method
getHeatCapacitySingleMethod Determines the heat storage capacity (may be assumed as constant but is correctly depending on the actual temperature)
getHeatFlowForSingleMethod Determines the heat flow has has affected the thermal mass since the last computation


The first value that has to be assigned is the target parameter. In our case, target is bound to the objecttype Room in order to simulate the rooms temperature. The parameters of type Attribute can now easily be bound to the attributes of our Room Objecttype (compare class model ).

Next, a name for the computation method (that is later generated by PSiGene) must be assigned. In our example we call it doCalcLoop. The heat capacity of our rooms are assumed to be constant so the parameter getHeatCapacity is bound to the attribute heatCapacity of the objecttype Room.

The only question left is, how to collect the heat flows affecting a room. In our example, heat is flowing from one room to another through walls, and additional radiators can be installed to act as heat sources.
A second Pattern (ThermalJunction) is used to define how the heat flow can be calculated depending on the thermal resistance of the separation (i.e. the wall or the air surrounding a radiator) and on the difference of temperatures of both adjoining areas. Therefore, ThermalJunction is bound twice to the class model: to the objecttype Wall and to the objecttype Surface. The ThermalMass pattern needs the sum of both of these heat flows. The heat flows are calculated locally in the classes Wall and Surface so we need a function to sum up all heat flows from all walls and surfaces that are connected to a room. A third pattern, FollowRelationAndSum can provide this functionality. It is bound to the relations Room_Surface and Room_Wall and calls on every connected object the method getHeatFlowFor.

These three patterns basically form our mini-simulator. There are only a few more patterns missing to display the simulated temperature (DisplayGraph and DisplaySlider) and to continuously calculate the actual temperature (ContinuousComputation). The complete Pattern bindings are shown in the following picture. A textual description of the pattern bindings is stored in a special POC file. This file is used as input to our pattern generator.

building model


Previous Step Next Step Up Table of Contents PSiGene