1 Introduction
2 Background and motivation
3 Bridging Epsilon with PTC Integrity Modeller
3.1 Epsilon
3.2 PTC integrity modeller
3.3 The IM-Epsilon bridge
- getAllOfTypeFromModel(type : String) : PtcimObject[]: This method returns all the elements of the given type.
- getAllOfKindFromModel(kind : String) : PtcimObject[]: Returns all the elements of the type including all the elements whose type extends the given type. However, IM does not have a notion of meta-type hierarchy; thus, this method delegates its functionality to getAllOfTypeFromModel(...).
- allContentsFromModel() : PtcimObject[]: Returns all the elements in the model.
- getElementById(id : String) : PtcimObject: This method returns the element that has a specific id.
- createInstance(type : String) : PtcimObject: Creates new elements of a specified type. This is realised by calling the Add(type) method in IM COM.
- deleteElementInModel(element : PtcimObject): Deleted elements from the model. By invoking this method, IM also automatically removes all the elements that are connected to this element via associations that are flagged with the Propagate Delete value set to true.
- getId() : String: This method returns the unique id of the element.
- getType() : String: Returns the type of the element.
- getProperty(name : String) : Object: This method retrieves the value of a property. If the property is an attribute, this is achieved by invoking the Property(arg) method, else the Items(property) or Item(property) are invoked depending on whether the association is multi-valued or single-valued.
- setProperty(name : String, value : Object): This method sets the value of a model element property by invoking the Add(value) method of the COM API if the property is an association or the PropertySet(value) method in case the property is an attribute.
- getPtcProperty(obj, property): This method invokes the Property(‘All Property Descriptors’) method of the IM automation interface. The later returns a string containing the four boolean values, separated by the new line character (\n), which are used to create a newPtcimProperty.
3.4 Java/Windows COM integration
Library | 32-bit (first/second repeat) | 64-bit (first/second repeat) |
---|---|---|
Com4j | 296/304 s | 311/322 s |
Jacob | 304/312 s | 315/322 s |
Jawin | 285/297 s | – |
3.5 Caching
- PtcimCachedPropertyManager: The first of the caches (i.e. elementPropertiesNamesCache) is hosted in the PtcimCachedPropertyManager which extends the PtcimPropertyManager class. Elements of the same type have common properties; thus, they share the same boolean flags. This cache maps the fully qualified name of each property to the property’s boolean flags following a type.propertyName\(\rightarrow \)PtcimProperty pattern. For example, all elements of type Activity have a property called isReentrant. The first time an element of type Activity is accessed, an entry in the map is created with Activity.isReentrant as key. The four boolean values are queried when creating the PtcimProperty object using the overridden getPtcProperty(...) method. If the key (e.g. Activity.isReentrant) exists in the cache, the boolean values are returned. If a property of a type has not been visited before (thus the key is not in the cache), this method delegates to the supergetPtcProperty(...) method which queries the boolean flags through the COM interface and stores them in the cache.
- PtcimCachedPropertyGetter: The second cache (i.e. propertiesValuesCache), hosted in the PtcimModel class, is used in the PtcimCachedPropertyGetter which extends the PtcimPropertyGetter class. This cache stores the actual values of the properties of each element. The key used in this cache is constructed by concatenating the unique id of the element and the name of the property that is accessed. For example, the value of the name attribute of an element with id 5eg494 is mapped using the key 5eg494.name to its value. PtcimCachedPropertyGetter overrides the invoke(...) method of PtcimPropertyGetter. Every time the value of a property needs to be retrieved, the invoke method queries the cache first. If a property has not been accessed before (hence the key is not in the cache), the invoke method delegates to its superclass implementation to query the value through the COM interface and then stores it in the cache.
- PtcimCachedPropertySetter: Caching can lead to inconsistencies when values of properties are changed for the reasons explained below. Thus, value caching is optional. When value caching is enabled, a PtcimCachedPropertySetter is created instead of the default PtcimPropertySetter. The former overrides the invoke(...) method of its superclass. This method adds or updates the mapping id.property\(\rightarrow \)value to the values cache and then calls its superclass method that updates the property’s value in IM.
3.6 Working with stereotypes
4 Demonstration
- the name through which the Epsilon program can refer to the model (in case the program operates on more than one models concurrently)
- the server that hosts the repository of interest
- the repository that holds the model of interest
- the name of the model in the repository
- whether property value caching should be enabled during execution
- the element to be treated as the root of the model (to limit the scope of a program to a sub-tree of the model)
4.1 Running model management programs
5 Evaluation
5.1 Performance experiment
5.1.1 Experiment setup
Id | Description |
---|---|
#1 | Classes’ names should start with upper-case letter |
#2 | Attributes’ names should start with lower-case letter |
#3 | Classes should not have more than seven operations |
#4 | Operations should not have more than seven parameters |
#5 | Classes must not have multiple inheritance |
#6 | The upper multiplicity of aggregation ends must be 1 |
#7a | The lower bound of an association start must not be greater than its upper bound |
#7b | The lower bound of an association start must not be greater than its upper bound |
#8a | Numeric upper bounds of association starts must be positive integers |
#8b | Numeric upper bounds of associations ends must be positive integers |
5.1.2 Results
Average execution time (in seconds) | ||||||
---|---|---|---|---|---|---|
Model Name | #Elements | VB | Epsilon (both caches) | Epsilon (flags cache) | Epsilon (values cache) | Epsilon (no cache) |
Template - Small Project |
21
| 0.024 | 0.066 | 0.072 | 0.064 | 0.068 |
Template - Incremental Process |
32
| 0.037 | 0.082 | 0.082 | 0.088 | 0.088 |
Heart Monitor C |
109
| 0.015 | 0.196 | 0.163 | 0.224 | 0.284 |
BallCpp |
123
| 0.024 | 0.296 | 0.296 | 0.400 | 0.520 |
Heart Monitor Java |
159
| 0.022 | 0.212 | 0.218 | 0.274 | 0.306 |
Template - Component-based Products |
227
| 0.328 | 0.390 | 0.380 | 0.402 | 0.392 |
Traffic Lights |
297
| 0.067 | 0.446 | 0.442 | 0.814 | 0.948 |
Distributed Ball Game MDA Example |
395
| 0.074 | 0.476 | 0.469 | 1.035 | 1.133 |
VB Another Block (Tetris) Example |
675
| 0.295 | 2.046 | 2.050 | 4.780 | 5.021 |
C# Another Block (Tetris) Example |
695
| 0.301 | 2.098 | 2.119 | 4.607 | 5.144 |
Waste System |
815
| 0.152 | 1.273 | 1.304 | 2.856 | 3.296 |
Traffic Lights - SySim |
1323
| 0.267 | 1.517 | 1.586 | 4.206 | 5.984 |
Speed Controller |
1405
| 0.442 | 2.143 | 2.264 | 5.946 | 8.191 |
Filling Station |
1519
| 1.010 | 3.432 | 3.556 | 7.636 | 8.363 |
HSUV |
2186
| 1.304 | 5.210 | 5.504 | 12.693 | 16.602 |
Search and Rescue |
5956
| 0.965 | 3.886 | 4.083 | 11.418 | 15.450 |
Large Civil Aero-Engine 1 Small Model* |
13,823
| 7.974 | 42.797 | 46.167 | 141.310 | 216.010 |
Large Civil Aero-Engine 2 Control SW* |
90,221
| 65.091 | 410.509 | 489.496 | 851.138 | 1450.564 |
Large Civil Aero-Engine 3 Control SW* |
116,251
| 79.721 | 713.034 | 708.492 | 1474.994 | 2243.216 |