Prechádzať zdrojové kódy

split adaptations into port adaptations and fmu adaptations

Claudio Gomes 7 rokov pred
rodič
commit
203fb2832c
47 zmenil súbory, kde vykonal 2859 pridanie a 1442 odobranie
  1. 2 2
      HintCO/instances/generate_variant_diagram_test.xmi
  2. 1 1
      HintCO/instances/generate_variants_infeasible_implication_test.xmi
  3. 1 1
      HintCO/instances/generate_variants_infeasible_interpolation_test.xmi
  4. 2 2
      HintCO/instances/generate_variants_test.xmi
  5. 3 3
      HintCO/instances/model_test.xmi
  6. 1 1
      HintCO/instances/simple_order_test.xmi
  7. 85 28
      HintCO/model/Candidates.xcore
  8. 0 63
      HintCO/src-gen/ua/ansymo/hintco/Adaptable.java
  9. 0 72
      HintCO/src-gen/ua/ansymo/hintco/Adaptation.java
  10. 1 1
      HintCO/src-gen/ua/ansymo/hintco/ApproximationAdaptation.java
  11. 1 1
      HintCO/src-gen/ua/ansymo/hintco/CombineAdaptation.java
  12. 39 1
      HintCO/src-gen/ua/ansymo/hintco/CosimUnitInstance.java
  13. 0 68
      HintCO/src-gen/ua/ansymo/hintco/DecompositionAdaptation.java
  14. 68 0
      HintCO/src-gen/ua/ansymo/hintco/DecompositionPortAdaptation.java
  15. 68 0
      HintCO/src-gen/ua/ansymo/hintco/DecompositionUnitAdaptation.java
  16. 12 12
      HintCO/src-gen/ua/ansymo/hintco/HintcoFactory.java
  17. 787 269
      HintCO/src-gen/ua/ansymo/hintco/HintcoPackage.java
  18. 1 1
      HintCO/src-gen/ua/ansymo/hintco/MultiRateAdaptation.java
  19. 89 0
      HintCO/src-gen/ua/ansymo/hintco/PortAdaptation.java
  20. 40 1
      HintCO/src-gen/ua/ansymo/hintco/PortInstance.java
  21. 89 0
      HintCO/src-gen/ua/ansymo/hintco/UnitAdaptation.java
  22. 1 1
      HintCO/src-gen/ua/ansymo/hintco/VariantDiagram.java
  23. 0 17
      HintCO/src-gen/ua/ansymo/hintco/XorAdaptation.java
  24. 17 0
      HintCO/src-gen/ua/ansymo/hintco/XorPortAdaptation.java
  25. 17 0
      HintCO/src-gen/ua/ansymo/hintco/XorUnitAdaptation.java
  26. 0 236
      HintCO/src-gen/ua/ansymo/hintco/impl/AdaptableImpl.java
  27. 0 278
      HintCO/src-gen/ua/ansymo/hintco/impl/AdaptationImpl.java
  28. 1 1
      HintCO/src-gen/ua/ansymo/hintco/impl/ApproximationAdaptationImpl.java
  29. 1 1
      HintCO/src-gen/ua/ansymo/hintco/impl/CombineAdaptationImpl.java
  30. 22 56
      HintCO/src-gen/ua/ansymo/hintco/impl/CosimUnitInstanceImpl.java
  31. 30 30
      HintCO/src-gen/ua/ansymo/hintco/impl/DecompositionAdaptationImpl.java
  32. 237 0
      HintCO/src-gen/ua/ansymo/hintco/impl/DecompositionUnitAdaptationImpl.java
  33. 15 15
      HintCO/src-gen/ua/ansymo/hintco/impl/HintcoFactoryImpl.java
  34. 235 79
      HintCO/src-gen/ua/ansymo/hintco/impl/HintcoPackageImpl.java
  35. 1 1
      HintCO/src-gen/ua/ansymo/hintco/impl/MultiRateAdaptationImpl.java
  36. 315 0
      HintCO/src-gen/ua/ansymo/hintco/impl/PortAdaptationImpl.java
  37. 70 104
      HintCO/src-gen/ua/ansymo/hintco/impl/PortInstanceImpl.java
  38. 315 0
      HintCO/src-gen/ua/ansymo/hintco/impl/UnitAdaptationImpl.java
  39. 21 10
      HintCO/src-gen/ua/ansymo/hintco/impl/VariantDiagramImpl.java
  40. 6 6
      HintCO/src-gen/ua/ansymo/hintco/impl/XorAdaptationImpl.java
  41. 37 0
      HintCO/src-gen/ua/ansymo/hintco/impl/XorUnitAdaptationImpl.java
  42. 82 28
      HintCO/src-gen/ua/ansymo/hintco/util/HintcoAdapterFactory.java
  43. 120 43
      HintCO/src-gen/ua/ansymo/hintco/util/HintcoSwitch.java
  44. 0 1
      HintCO/src/ua/ansymo/hintco/AdaptedFMUInstance.xtend
  45. 1 1
      HintCO/src/ua/ansymo/hintco/ApproximationAdaptedPort.xtend
  46. 2 2
      HintCO/src/ua/ansymo/hintco/CandidateSpaceGenerator.xtend
  47. 23 5
      HintCO/src/ua/ansymo/hintco/CandidatesGenerator.xtend

+ 2 - 2
HintCO/instances/generate_variant_diagram_test.xmi

@@ -36,7 +36,7 @@
           identifier="REFERENCE@expseu_"
           declaration="//@csuDeclarations.1/@ports.2">
         <adaptation
-            xsi:type="candidates:XorAdaptation">
+            xsi:type="candidates:XorPortAdaptation">
           <children
               xsi:type="candidates:ExtrapolationAdaptation"
               weight="1"/>
@@ -59,7 +59,7 @@
           identifier="torque_input@expseu_"
           declaration="//@csuDeclarations.2/@ports.0">
         <adaptation
-            xsi:type="candidates:XorAdaptation">
+            xsi:type="candidates:XorPortAdaptation">
           <children
               xsi:type="candidates:ExtrapolationAdaptation"
               weight="3"/>

+ 1 - 1
HintCO/instances/generate_variants_infeasible_implication_test.xmi

@@ -92,7 +92,7 @@
           declaration="//@csuDeclarations.3/@ports.0"
           valueFrom="//@candidates.0/@cosimunits.2/@ports.5">
         <adaptation
-            xsi:type="hintco:XorAdaptation">
+            xsi:type="hintco:XorPortAdaptation">
           <children
               xsi:type="hintco:ExtrapolationAdaptation"
               weight="5"

+ 1 - 1
HintCO/instances/generate_variants_infeasible_interpolation_test.xmi

@@ -91,7 +91,7 @@
           declaration="//@csuDeclarations.3/@ports.0"
           valueFrom="//@candidates.0/@cosimunits.2/@ports.5">
         <adaptation
-            xsi:type="candidates:XorAdaptation">
+            xsi:type="candidates:XorPortAdaptation">
           <children
               xsi:type="candidates:InterpolationAdaptation"/>
           <children

+ 2 - 2
HintCO/instances/generate_variants_test.xmi

@@ -36,7 +36,7 @@
           identifier="REFERENCE@expseu_"
           declaration="//@csuDeclarations.1/@ports.2">
         <adaptation
-            xsi:type="candidates:XorAdaptation">
+            xsi:type="candidates:XorPortAdaptation">
           <children
               xsi:type="candidates:ExtrapolationAdaptation"
               weight="1"/>
@@ -59,7 +59,7 @@
           identifier="torque_input@expseu_"
           declaration="//@csuDeclarations.2/@ports.0">
         <adaptation
-            xsi:type="candidates:XorAdaptation">
+            xsi:type="candidates:XorPortAdaptation">
           <children
               xsi:type="candidates:ExtrapolationAdaptation"
               weight="3"/>

+ 3 - 3
HintCO/instances/model_test.xmi

@@ -43,7 +43,7 @@
           declaration="//@csuDeclarations.1/@ports.2"
           valueFrom="//@candidates.0/@cosimunits.0/@ports.1">
         <adaptation
-            xsi:type="hintco:XorAdaptation"
+            xsi:type="hintco:XorPortAdaptation"
             selected="true">
           <children
               xsi:type="hintco:ExtrapolationAdaptation"
@@ -64,7 +64,7 @@
         identifier="EMAPlantNoLoad_FixedEuler_1Em6"
         declaration="//@csuDeclarations.2">
       <adaptation
-          xsi:type="hintco:XorAdaptation"
+          xsi:type="hintco:XorUnitAdaptation"
           selected="true">
         <children
             xsi:type="hintco:MultiRateAdaptation"
@@ -80,7 +80,7 @@
           declaration="//@csuDeclarations.2/@ports.0"
           valueFrom="//@candidates.0/@cosimunits.1/@ports.3">
         <adaptation
-            xsi:type="hintco:XorAdaptation"
+            xsi:type="hintco:XorPortAdaptation"
             selected="true">
           <children
               xsi:type="hintco:ExtrapolationAdaptation"

+ 1 - 1
HintCO/instances/simple_order_test.xmi

@@ -52,7 +52,7 @@
           declaration="//@csuDeclarations.3/@ports.0"
           valueFrom="//@candidates.0/@cosimunits.1/@ports.3">
         <adaptation
-            xsi:type="candidates:XorAdaptation">
+            xsi:type="candidates:XorPortAdaptation">
           <children
               xsi:type="candidates:ExtrapolationAdaptation"/>
         </adaptation>

+ 85 - 28
HintCO/model/Candidates.xcore

@@ -23,8 +23,10 @@ class VariantDiagram extends IDed {
 		if (alternative !== null){
 			if (alternative instanceof CandidateScenario){
 				prefix + "sce " + (alternative as CandidateScenario).name
-			} else if (alternative instanceof XorAdaptation) {
-				prefix + "xor " + (alternative as XorAdaptation).name
+			} else if (alternative instanceof XorPortAdaptation) {
+				prefix + "xor " + (alternative as XorPortAdaptation).name
+			} else if (alternative instanceof XorUnitAdaptation) {
+				prefix + "xor " + (alternative as XorUnitAdaptation).name
 			} else if (alternative instanceof ExtrapolationAdaptation) {
 				prefix + "extra " + (alternative as ExtrapolationAdaptation).name
 			} else if (alternative instanceof InterpolationAdaptation) {
@@ -66,15 +68,18 @@ class HierarchicalCosimUnitDeclaration extends CosimUnitDeclaration {
 	contains CosimUnitInstance[] children
 }
 
-class Adaptable {
-	contains Adaptation adaptation opposite adaptable
-	op Adaptation[] selectedAdaptations() {
+class CosimUnitInstance extends IDed,PrecendenceNode {
+	contains UnitAdaptation adaptation opposite unit
+	refers CosimUnitDeclaration[1] declaration
+	contains PortInstance[] ports opposite unit
+	
+	op UnitAdaptation[] selectedAdaptations() {
 		if (adaptation === null){
 			return new BasicEList(#[])
 		}
 		if (adaptation.selected){
-			if (adaptation instanceof DecompositionAdaptation){
-				return (adaptation as DecompositionAdaptation).selectedAdaptations()
+			if (adaptation instanceof DecompositionUnitAdaptation){
+				return (adaptation as DecompositionUnitAdaptation).selectedAdaptations()
 			}
 			return new BasicEList(#[adaptation])
 		}
@@ -83,11 +88,6 @@ class Adaptable {
 	}
 }
 
-class CosimUnitInstance extends IDed,PrecendenceNode, Adaptable {
-	refers CosimUnitDeclaration[1] declaration
-	contains PortInstance[] ports opposite unit
-}
-
 abstract class PortDeclaration extends IDed {
 	
 }
@@ -100,8 +100,23 @@ class OutputPortDeclaration extends PortDeclaration {
 	
 }
 
-abstract class PortInstance extends PrecendenceNode,IDed,Adaptable {
+abstract class PortInstance extends PrecendenceNode,IDed {
 	refers CosimUnitInstance unit opposite ports
+	contains PortAdaptation adaptation opposite port
+	
+	op PortAdaptation[] selectedAdaptations() {
+		if (adaptation === null){
+			return new BasicEList(#[])
+		}
+		if (adaptation.selected){
+			if (adaptation instanceof DecompositionPortAdaptation){
+				return (adaptation as DecompositionPortAdaptation).selectedAdaptations()
+			}
+			return new BasicEList(#[adaptation])
+		}
+		
+		return new BasicEList(#[])
+	}
 }
 
 class InputPortInstance extends PortInstance {
@@ -123,12 +138,49 @@ abstract class Alternative
 
 abstract class Adaptation extends Alternative
 {
-	refers DecompositionAdaptation parent opposite children
-	refers Adaptable adaptable opposite adaptation
 	
-	op Adaptable adapted() {
-		if (adaptable !== null){
-			return adaptable
+}
+
+abstract class PortAdaptation extends Adaptation
+{
+	refers PortInstance port opposite adaptation
+	refers DecompositionPortAdaptation parent opposite children
+	op PortInstance adapted() {
+		if (port !== null){
+			return port
+		}
+		if (parent === null){
+			return null
+		}
+		return parent.adapted()
+	}
+}
+
+abstract class DecompositionPortAdaptation extends PortAdaptation {
+	contains PortAdaptation[] children opposite parent
+	derived String name get {
+		"(w=" + weight + ")"
+	}
+	op PortAdaptation[] selectedAdaptations() {
+		val res = new BasicEList(children.size)
+		for (c : children.filter[a | a.selected]){
+			if (c instanceof DecompositionPortAdaptation){
+				res.addAll(c.selectedAdaptations())
+			} else {
+				res.add(c)
+			}
+		}
+		return res
+	}
+	
+}
+
+abstract class UnitAdaptation extends Adaptation {
+	refers CosimUnitInstance unit opposite adaptation
+	refers DecompositionUnitAdaptation parent opposite children
+	op CosimUnitInstance adapted() {
+		if (unit !== null){
+			return unit
 		}
 		if (parent === null){
 			return null
@@ -137,15 +189,15 @@ abstract class Adaptation extends Alternative
 	}
 }
 
-abstract class DecompositionAdaptation extends Adaptation {
-	contains Adaptation[] children opposite parent
+abstract class DecompositionUnitAdaptation extends UnitAdaptation {
+	contains UnitAdaptation[] children opposite parent
 	derived String name get {
 		"(w=" + weight + ")"
 	}
-	op Adaptation[] selectedAdaptations() {
+	op UnitAdaptation[] selectedAdaptations() {
 		val res = new BasicEList(children.size)
 		for (c : children.filter[a | a.selected]){
-			if (c instanceof DecompositionAdaptation){
+			if (c instanceof DecompositionUnitAdaptation){
 				res.addAll(c.selectedAdaptations())
 			} else {
 				res.add(c)
@@ -153,27 +205,32 @@ abstract class DecompositionAdaptation extends Adaptation {
 		}
 		return res
 	}
+	
 }
 
-class XorAdaptation extends DecompositionAdaptation {
+class XorUnitAdaptation extends DecompositionUnitAdaptation {
+	
 }
 
-class CombineAdaptation extends DecompositionAdaptation {
+class XorPortAdaptation extends DecompositionPortAdaptation {
+	
+}
+
+class CombineAdaptation extends DecompositionUnitAdaptation {
+	
 }
 
-abstract class ApproximationAdaptation extends Adaptation {
+abstract class ApproximationAdaptation extends PortAdaptation {
 	int order
 }
 
-class MultiRateAdaptation extends Adaptation {
+class MultiRateAdaptation extends UnitAdaptation {
 	int rate
 	derived String name get {
 		rate + "(w=" + weight + ")"
 	}
 }
 
-
-
 class ExtrapolationAdaptation extends ApproximationAdaptation {
 	derived String name get {
 		order + "(w=" + weight + ")"

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 63
HintCO/src-gen/ua/ansymo/hintco/Adaptable.java


+ 0 - 72
HintCO/src-gen/ua/ansymo/hintco/Adaptation.java

@@ -8,82 +8,10 @@ package ua.ansymo.hintco;
  * A representation of the model object '<em><b>Adaptation</b></em>'.
  * <!-- end-user-doc -->
  *
- * <p>
- * The following features are supported:
- * </p>
- * <ul>
- *   <li>{@link ua.ansymo.hintco.Adaptation#getParent <em>Parent</em>}</li>
- *   <li>{@link ua.ansymo.hintco.Adaptation#getAdaptable <em>Adaptable</em>}</li>
- * </ul>
  *
  * @see ua.ansymo.hintco.HintcoPackage#getAdaptation()
  * @model abstract="true"
  * @generated
  */
 public interface Adaptation extends Alternative {
-	/**
-	 * Returns the value of the '<em><b>Parent</b></em>' container reference.
-	 * It is bidirectional and its opposite is '{@link ua.ansymo.hintco.DecompositionAdaptation#getChildren <em>Children</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Parent</em>' container reference isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * @return the value of the '<em>Parent</em>' container reference.
-	 * @see #setParent(DecompositionAdaptation)
-	 * @see ua.ansymo.hintco.HintcoPackage#getAdaptation_Parent()
-	 * @see ua.ansymo.hintco.DecompositionAdaptation#getChildren
-	 * @model opposite="children" transient="false"
-	 * @generated
-	 */
-	DecompositionAdaptation getParent();
-
-	/**
-	 * Sets the value of the '{@link ua.ansymo.hintco.Adaptation#getParent <em>Parent</em>}' container reference.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @param value the new value of the '<em>Parent</em>' container reference.
-	 * @see #getParent()
-	 * @generated
-	 */
-	void setParent(DecompositionAdaptation value);
-
-	/**
-	 * Returns the value of the '<em><b>Adaptable</b></em>' container reference.
-	 * It is bidirectional and its opposite is '{@link ua.ansymo.hintco.Adaptable#getAdaptation <em>Adaptation</em>}'.
-	 * <!-- begin-user-doc -->
-	 * <p>
-	 * If the meaning of the '<em>Adaptable</em>' container reference isn't clear,
-	 * there really should be more of a description here...
-	 * </p>
-	 * <!-- end-user-doc -->
-	 * @return the value of the '<em>Adaptable</em>' container reference.
-	 * @see #setAdaptable(Adaptable)
-	 * @see ua.ansymo.hintco.HintcoPackage#getAdaptation_Adaptable()
-	 * @see ua.ansymo.hintco.Adaptable#getAdaptation
-	 * @model opposite="adaptation" transient="false"
-	 * @generated
-	 */
-	Adaptable getAdaptable();
-
-	/**
-	 * Sets the value of the '{@link ua.ansymo.hintco.Adaptation#getAdaptable <em>Adaptable</em>}' container reference.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @param value the new value of the '<em>Adaptable</em>' container reference.
-	 * @see #getAdaptable()
-	 * @generated
-	 */
-	void setAdaptable(Adaptable value);
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @model unique="false"
-	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='&lt;%ua.ansymo.hintco.Adaptable%&gt; _adaptable = this.getAdaptable();\nboolean _tripleNotEquals = (_adaptable != null);\nif (_tripleNotEquals)\n{\n\treturn this.getAdaptable();\n}\n&lt;%ua.ansymo.hintco.DecompositionAdaptation%&gt; _parent = this.getParent();\nboolean _tripleEquals = (_parent == null);\nif (_tripleEquals)\n{\n\treturn null;\n}\nreturn this.getParent().adapted();'"
-	 * @generated
-	 */
-	Adaptable adapted();
-
 } // Adaptation

+ 1 - 1
HintCO/src-gen/ua/ansymo/hintco/ApproximationAdaptation.java

@@ -19,7 +19,7 @@ package ua.ansymo.hintco;
  * @model abstract="true"
  * @generated
  */
-public interface ApproximationAdaptation extends Adaptation {
+public interface ApproximationAdaptation extends PortAdaptation {
 	/**
 	 * Returns the value of the '<em><b>Order</b></em>' attribute.
 	 * <!-- begin-user-doc -->

+ 1 - 1
HintCO/src-gen/ua/ansymo/hintco/CombineAdaptation.java

@@ -13,5 +13,5 @@ package ua.ansymo.hintco;
  * @model
  * @generated
  */
-public interface CombineAdaptation extends DecompositionAdaptation {
+public interface CombineAdaptation extends DecompositionUnitAdaptation {
 } // CombineAdaptation

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 39 - 1
HintCO/src-gen/ua/ansymo/hintco/CosimUnitInstance.java


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 68
HintCO/src-gen/ua/ansymo/hintco/DecompositionAdaptation.java


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 68 - 0
HintCO/src-gen/ua/ansymo/hintco/DecompositionPortAdaptation.java


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 68 - 0
HintCO/src-gen/ua/ansymo/hintco/DecompositionUnitAdaptation.java


+ 12 - 12
HintCO/src-gen/ua/ansymo/hintco/HintcoFactory.java

@@ -66,15 +66,6 @@ public interface HintcoFactory extends EFactory {
 	 */
 	HierarchicalCosimUnitDeclaration createHierarchicalCosimUnitDeclaration();
 
-	/**
-	 * Returns a new object of class '<em>Adaptable</em>'.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @return a new object of class '<em>Adaptable</em>'.
-	 * @generated
-	 */
-	Adaptable createAdaptable();
-
 	/**
 	 * Returns a new object of class '<em>Cosim Unit Instance</em>'.
 	 * <!-- begin-user-doc -->
@@ -121,13 +112,22 @@ public interface HintcoFactory extends EFactory {
 	OutputPortInstance createOutputPortInstance();
 
 	/**
-	 * Returns a new object of class '<em>Xor Adaptation</em>'.
+	 * Returns a new object of class '<em>Xor Unit Adaptation</em>'.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @return a new object of class '<em>Xor Unit Adaptation</em>'.
+	 * @generated
+	 */
+	XorUnitAdaptation createXorUnitAdaptation();
+
+	/**
+	 * Returns a new object of class '<em>Xor Port Adaptation</em>'.
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
-	 * @return a new object of class '<em>Xor Adaptation</em>'.
+	 * @return a new object of class '<em>Xor Port Adaptation</em>'.
 	 * @generated
 	 */
-	XorAdaptation createXorAdaptation();
+	XorPortAdaptation createXorPortAdaptation();
 
 	/**
 	 * Returns a new object of class '<em>Combine Adaptation</em>'.

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 787 - 269
HintCO/src-gen/ua/ansymo/hintco/HintcoPackage.java


+ 1 - 1
HintCO/src-gen/ua/ansymo/hintco/MultiRateAdaptation.java

@@ -20,7 +20,7 @@ package ua.ansymo.hintco;
  * @model
  * @generated
  */
-public interface MultiRateAdaptation extends Adaptation {
+public interface MultiRateAdaptation extends UnitAdaptation {
 	/**
 	 * Returns the value of the '<em><b>Rate</b></em>' attribute.
 	 * <!-- begin-user-doc -->

+ 89 - 0
HintCO/src-gen/ua/ansymo/hintco/PortAdaptation.java

@@ -0,0 +1,89 @@
+/**
+ */
+package ua.ansymo.hintco;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Port Adaptation</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ *   <li>{@link ua.ansymo.hintco.PortAdaptation#getPort <em>Port</em>}</li>
+ *   <li>{@link ua.ansymo.hintco.PortAdaptation#getParent <em>Parent</em>}</li>
+ * </ul>
+ *
+ * @see ua.ansymo.hintco.HintcoPackage#getPortAdaptation()
+ * @model abstract="true"
+ * @generated
+ */
+public interface PortAdaptation extends Adaptation {
+	/**
+	 * Returns the value of the '<em><b>Port</b></em>' container reference.
+	 * It is bidirectional and its opposite is '{@link ua.ansymo.hintco.PortInstance#getAdaptation <em>Adaptation</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Port</em>' container reference isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Port</em>' container reference.
+	 * @see #setPort(PortInstance)
+	 * @see ua.ansymo.hintco.HintcoPackage#getPortAdaptation_Port()
+	 * @see ua.ansymo.hintco.PortInstance#getAdaptation
+	 * @model opposite="adaptation" transient="false"
+	 * @generated
+	 */
+	PortInstance getPort();
+
+	/**
+	 * Sets the value of the '{@link ua.ansymo.hintco.PortAdaptation#getPort <em>Port</em>}' container reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Port</em>' container reference.
+	 * @see #getPort()
+	 * @generated
+	 */
+	void setPort(PortInstance value);
+
+	/**
+	 * Returns the value of the '<em><b>Parent</b></em>' container reference.
+	 * It is bidirectional and its opposite is '{@link ua.ansymo.hintco.DecompositionPortAdaptation#getChildren <em>Children</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Parent</em>' container reference isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Parent</em>' container reference.
+	 * @see #setParent(DecompositionPortAdaptation)
+	 * @see ua.ansymo.hintco.HintcoPackage#getPortAdaptation_Parent()
+	 * @see ua.ansymo.hintco.DecompositionPortAdaptation#getChildren
+	 * @model opposite="children" transient="false"
+	 * @generated
+	 */
+	DecompositionPortAdaptation getParent();
+
+	/**
+	 * Sets the value of the '{@link ua.ansymo.hintco.PortAdaptation#getParent <em>Parent</em>}' container reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Parent</em>' container reference.
+	 * @see #getParent()
+	 * @generated
+	 */
+	void setParent(DecompositionPortAdaptation value);
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @model unique="false"
+	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='&lt;%ua.ansymo.hintco.PortInstance%&gt; _port = this.getPort();\nboolean _tripleNotEquals = (_port != null);\nif (_tripleNotEquals)\n{\n\treturn this.getPort();\n}\n&lt;%ua.ansymo.hintco.DecompositionPortAdaptation%&gt; _parent = this.getParent();\nboolean _tripleEquals = (_parent == null);\nif (_tripleEquals)\n{\n\treturn null;\n}\nreturn this.getParent().adapted();'"
+	 * @generated
+	 */
+	PortInstance adapted();
+
+} // PortAdaptation

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 40 - 1
HintCO/src-gen/ua/ansymo/hintco/PortInstance.java


+ 89 - 0
HintCO/src-gen/ua/ansymo/hintco/UnitAdaptation.java

@@ -0,0 +1,89 @@
+/**
+ */
+package ua.ansymo.hintco;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Unit Adaptation</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * </p>
+ * <ul>
+ *   <li>{@link ua.ansymo.hintco.UnitAdaptation#getUnit <em>Unit</em>}</li>
+ *   <li>{@link ua.ansymo.hintco.UnitAdaptation#getParent <em>Parent</em>}</li>
+ * </ul>
+ *
+ * @see ua.ansymo.hintco.HintcoPackage#getUnitAdaptation()
+ * @model abstract="true"
+ * @generated
+ */
+public interface UnitAdaptation extends Adaptation {
+	/**
+	 * Returns the value of the '<em><b>Unit</b></em>' container reference.
+	 * It is bidirectional and its opposite is '{@link ua.ansymo.hintco.CosimUnitInstance#getAdaptation <em>Adaptation</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Unit</em>' container reference isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Unit</em>' container reference.
+	 * @see #setUnit(CosimUnitInstance)
+	 * @see ua.ansymo.hintco.HintcoPackage#getUnitAdaptation_Unit()
+	 * @see ua.ansymo.hintco.CosimUnitInstance#getAdaptation
+	 * @model opposite="adaptation" transient="false"
+	 * @generated
+	 */
+	CosimUnitInstance getUnit();
+
+	/**
+	 * Sets the value of the '{@link ua.ansymo.hintco.UnitAdaptation#getUnit <em>Unit</em>}' container reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Unit</em>' container reference.
+	 * @see #getUnit()
+	 * @generated
+	 */
+	void setUnit(CosimUnitInstance value);
+
+	/**
+	 * Returns the value of the '<em><b>Parent</b></em>' container reference.
+	 * It is bidirectional and its opposite is '{@link ua.ansymo.hintco.DecompositionUnitAdaptation#getChildren <em>Children</em>}'.
+	 * <!-- begin-user-doc -->
+	 * <p>
+	 * If the meaning of the '<em>Parent</em>' container reference isn't clear,
+	 * there really should be more of a description here...
+	 * </p>
+	 * <!-- end-user-doc -->
+	 * @return the value of the '<em>Parent</em>' container reference.
+	 * @see #setParent(DecompositionUnitAdaptation)
+	 * @see ua.ansymo.hintco.HintcoPackage#getUnitAdaptation_Parent()
+	 * @see ua.ansymo.hintco.DecompositionUnitAdaptation#getChildren
+	 * @model opposite="children" transient="false"
+	 * @generated
+	 */
+	DecompositionUnitAdaptation getParent();
+
+	/**
+	 * Sets the value of the '{@link ua.ansymo.hintco.UnitAdaptation#getParent <em>Parent</em>}' container reference.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @param value the new value of the '<em>Parent</em>' container reference.
+	 * @see #getParent()
+	 * @generated
+	 */
+	void setParent(DecompositionUnitAdaptation value);
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @model unique="false"
+	 *        annotation="http://www.eclipse.org/emf/2002/GenModel body='&lt;%ua.ansymo.hintco.CosimUnitInstance%&gt; _unit = this.getUnit();\nboolean _tripleNotEquals = (_unit != null);\nif (_tripleNotEquals)\n{\n\treturn this.getUnit();\n}\n&lt;%ua.ansymo.hintco.DecompositionUnitAdaptation%&gt; _parent = this.getParent();\nboolean _tripleEquals = (_parent == null);\nif (_tripleEquals)\n{\n\treturn null;\n}\nreturn this.getParent().adapted();'"
+	 * @generated
+	 */
+	CosimUnitInstance adapted();
+
+} // UnitAdaptation

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
HintCO/src-gen/ua/ansymo/hintco/VariantDiagram.java


+ 0 - 17
HintCO/src-gen/ua/ansymo/hintco/XorAdaptation.java

@@ -1,17 +0,0 @@
-/**
- */
-package ua.ansymo.hintco;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xor Adaptation</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see ua.ansymo.hintco.HintcoPackage#getXorAdaptation()
- * @model
- * @generated
- */
-public interface XorAdaptation extends DecompositionAdaptation {
-} // XorAdaptation

+ 17 - 0
HintCO/src-gen/ua/ansymo/hintco/XorPortAdaptation.java

@@ -0,0 +1,17 @@
+/**
+ */
+package ua.ansymo.hintco;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Xor Port Adaptation</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see ua.ansymo.hintco.HintcoPackage#getXorPortAdaptation()
+ * @model
+ * @generated
+ */
+public interface XorPortAdaptation extends DecompositionPortAdaptation {
+} // XorPortAdaptation

+ 17 - 0
HintCO/src-gen/ua/ansymo/hintco/XorUnitAdaptation.java

@@ -0,0 +1,17 @@
+/**
+ */
+package ua.ansymo.hintco;
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Xor Unit Adaptation</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see ua.ansymo.hintco.HintcoPackage#getXorUnitAdaptation()
+ * @model
+ * @generated
+ */
+public interface XorUnitAdaptation extends DecompositionUnitAdaptation {
+} // XorUnitAdaptation

+ 0 - 236
HintCO/src-gen/ua/ansymo/hintco/impl/AdaptableImpl.java

@@ -1,236 +0,0 @@
-/**
- */
-package ua.ansymo.hintco.impl;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.common.util.BasicEList;
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
-
-import ua.ansymo.hintco.Adaptable;
-import ua.ansymo.hintco.Adaptation;
-import ua.ansymo.hintco.DecompositionAdaptation;
-import ua.ansymo.hintco.HintcoPackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Adaptable</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * </p>
- * <ul>
- *   <li>{@link ua.ansymo.hintco.impl.AdaptableImpl#getAdaptation <em>Adaptation</em>}</li>
- * </ul>
- *
- * @generated
- */
-public class AdaptableImpl extends MinimalEObjectImpl.Container implements Adaptable {
-	/**
-	 * The cached value of the '{@link #getAdaptation() <em>Adaptation</em>}' containment reference.
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @see #getAdaptation()
-	 * @generated
-	 * @ordered
-	 */
-	protected Adaptation adaptation;
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	protected AdaptableImpl() {
-		super();
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	protected EClass eStaticClass() {
-		return HintcoPackage.Literals.ADAPTABLE;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public Adaptation getAdaptation() {
-		return adaptation;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public NotificationChain basicSetAdaptation(Adaptation newAdaptation, NotificationChain msgs) {
-		Adaptation oldAdaptation = adaptation;
-		adaptation = newAdaptation;
-		if (eNotificationRequired()) {
-			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, HintcoPackage.ADAPTABLE__ADAPTATION, oldAdaptation, newAdaptation);
-			if (msgs == null) msgs = notification; else msgs.add(notification);
-		}
-		return msgs;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public void setAdaptation(Adaptation newAdaptation) {
-		if (newAdaptation != adaptation) {
-			NotificationChain msgs = null;
-			if (adaptation != null)
-				msgs = ((InternalEObject)adaptation).eInverseRemove(this, HintcoPackage.ADAPTATION__ADAPTABLE, Adaptation.class, msgs);
-			if (newAdaptation != null)
-				msgs = ((InternalEObject)newAdaptation).eInverseAdd(this, HintcoPackage.ADAPTATION__ADAPTABLE, Adaptation.class, msgs);
-			msgs = basicSetAdaptation(newAdaptation, msgs);
-			if (msgs != null) msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, HintcoPackage.ADAPTABLE__ADAPTATION, newAdaptation, newAdaptation));
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public EList<Adaptation> selectedAdaptations() {
-		Adaptation _adaptation = this.getAdaptation();
-		boolean _tripleEquals = (_adaptation == null);
-		if (_tripleEquals) {
-			return new BasicEList<Adaptation>(java.util.Collections.<Adaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<Adaptation>newArrayList()));
-		}
-		boolean _isSelected = this.getAdaptation().isSelected();
-		if (_isSelected) {
-			Adaptation _adaptation_1 = this.getAdaptation();
-			if ((_adaptation_1 instanceof DecompositionAdaptation)) {
-				Adaptation _adaptation_2 = this.getAdaptation();
-				return ((DecompositionAdaptation) _adaptation_2).selectedAdaptations();
-			}
-			Adaptation _adaptation_3 = this.getAdaptation();
-			return new BasicEList<Adaptation>(java.util.Collections.<Adaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<Adaptation>newArrayList(_adaptation_3)));
-		}
-		return new BasicEList<Adaptation>(java.util.Collections.<Adaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<Adaptation>newArrayList()));
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
-		switch (featureID) {
-			case HintcoPackage.ADAPTABLE__ADAPTATION:
-				if (adaptation != null)
-					msgs = ((InternalEObject)adaptation).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - HintcoPackage.ADAPTABLE__ADAPTATION, null, msgs);
-				return basicSetAdaptation((Adaptation)otherEnd, msgs);
-		}
-		return super.eInverseAdd(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
-		switch (featureID) {
-			case HintcoPackage.ADAPTABLE__ADAPTATION:
-				return basicSetAdaptation(null, msgs);
-		}
-		return super.eInverseRemove(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public Object eGet(int featureID, boolean resolve, boolean coreType) {
-		switch (featureID) {
-			case HintcoPackage.ADAPTABLE__ADAPTATION:
-				return getAdaptation();
-		}
-		return super.eGet(featureID, resolve, coreType);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public void eSet(int featureID, Object newValue) {
-		switch (featureID) {
-			case HintcoPackage.ADAPTABLE__ADAPTATION:
-				setAdaptation((Adaptation)newValue);
-				return;
-		}
-		super.eSet(featureID, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public void eUnset(int featureID) {
-		switch (featureID) {
-			case HintcoPackage.ADAPTABLE__ADAPTATION:
-				setAdaptation((Adaptation)null);
-				return;
-		}
-		super.eUnset(featureID);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public boolean eIsSet(int featureID) {
-		switch (featureID) {
-			case HintcoPackage.ADAPTABLE__ADAPTATION:
-				return adaptation != null;
-		}
-		return super.eIsSet(featureID);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
-		switch (operationID) {
-			case HintcoPackage.ADAPTABLE___SELECTED_ADAPTATIONS:
-				return selectedAdaptations();
-		}
-		return super.eInvoke(operationID, arguments);
-	}
-
-} //AdaptableImpl

+ 0 - 278
HintCO/src-gen/ua/ansymo/hintco/impl/AdaptationImpl.java

@@ -2,36 +2,15 @@
  */
 package ua.ansymo.hintco.impl;
 
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.common.util.EList;
-
 import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.emf.ecore.util.EcoreUtil;
 
-import ua.ansymo.hintco.Adaptable;
 import ua.ansymo.hintco.Adaptation;
-import ua.ansymo.hintco.DecompositionAdaptation;
 import ua.ansymo.hintco.HintcoPackage;
 
 /**
  * <!-- begin-user-doc -->
  * An implementation of the model object '<em><b>Adaptation</b></em>'.
  * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * </p>
- * <ul>
- *   <li>{@link ua.ansymo.hintco.impl.AdaptationImpl#getParent <em>Parent</em>}</li>
- *   <li>{@link ua.ansymo.hintco.impl.AdaptationImpl#getAdaptable <em>Adaptable</em>}</li>
- * </ul>
  *
  * @generated
  */
@@ -55,261 +34,4 @@ public abstract class AdaptationImpl extends AlternativeImpl implements Adaptati
 		return HintcoPackage.Literals.ADAPTATION;
 	}
 
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public DecompositionAdaptation getParent() {
-		if (eContainerFeatureID() != HintcoPackage.ADAPTATION__PARENT) return null;
-		return (DecompositionAdaptation)eContainer();
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public DecompositionAdaptation basicGetParent() {
-		if (eContainerFeatureID() != HintcoPackage.ADAPTATION__PARENT) return null;
-		return (DecompositionAdaptation)eInternalContainer();
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public NotificationChain basicSetParent(DecompositionAdaptation newParent, NotificationChain msgs) {
-		msgs = eBasicSetContainer((InternalEObject)newParent, HintcoPackage.ADAPTATION__PARENT, msgs);
-		return msgs;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public void setParent(DecompositionAdaptation newParent) {
-		if (newParent != eInternalContainer() || (eContainerFeatureID() != HintcoPackage.ADAPTATION__PARENT && newParent != null)) {
-			if (EcoreUtil.isAncestor(this, newParent))
-				throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
-			NotificationChain msgs = null;
-			if (eInternalContainer() != null)
-				msgs = eBasicRemoveFromContainer(msgs);
-			if (newParent != null)
-				msgs = ((InternalEObject)newParent).eInverseAdd(this, HintcoPackage.DECOMPOSITION_ADAPTATION__CHILDREN, DecompositionAdaptation.class, msgs);
-			msgs = basicSetParent(newParent, msgs);
-			if (msgs != null) msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, HintcoPackage.ADAPTATION__PARENT, newParent, newParent));
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public Adaptable getAdaptable() {
-		if (eContainerFeatureID() != HintcoPackage.ADAPTATION__ADAPTABLE) return null;
-		return (Adaptable)eContainer();
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public Adaptable basicGetAdaptable() {
-		if (eContainerFeatureID() != HintcoPackage.ADAPTATION__ADAPTABLE) return null;
-		return (Adaptable)eInternalContainer();
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public NotificationChain basicSetAdaptable(Adaptable newAdaptable, NotificationChain msgs) {
-		msgs = eBasicSetContainer((InternalEObject)newAdaptable, HintcoPackage.ADAPTATION__ADAPTABLE, msgs);
-		return msgs;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public void setAdaptable(Adaptable newAdaptable) {
-		if (newAdaptable != eInternalContainer() || (eContainerFeatureID() != HintcoPackage.ADAPTATION__ADAPTABLE && newAdaptable != null)) {
-			if (EcoreUtil.isAncestor(this, newAdaptable))
-				throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
-			NotificationChain msgs = null;
-			if (eInternalContainer() != null)
-				msgs = eBasicRemoveFromContainer(msgs);
-			if (newAdaptable != null)
-				msgs = ((InternalEObject)newAdaptable).eInverseAdd(this, HintcoPackage.ADAPTABLE__ADAPTATION, Adaptable.class, msgs);
-			msgs = basicSetAdaptable(newAdaptable, msgs);
-			if (msgs != null) msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, HintcoPackage.ADAPTATION__ADAPTABLE, newAdaptable, newAdaptable));
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public Adaptable adapted() {
-		Adaptable _adaptable = this.getAdaptable();
-		boolean _tripleNotEquals = (_adaptable != null);
-		if (_tripleNotEquals) {
-			return this.getAdaptable();
-		}
-		DecompositionAdaptation _parent = this.getParent();
-		boolean _tripleEquals = (_parent == null);
-		if (_tripleEquals) {
-			return null;
-		}
-		return this.getParent().adapted();
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
-		switch (featureID) {
-			case HintcoPackage.ADAPTATION__PARENT:
-				if (eInternalContainer() != null)
-					msgs = eBasicRemoveFromContainer(msgs);
-				return basicSetParent((DecompositionAdaptation)otherEnd, msgs);
-			case HintcoPackage.ADAPTATION__ADAPTABLE:
-				if (eInternalContainer() != null)
-					msgs = eBasicRemoveFromContainer(msgs);
-				return basicSetAdaptable((Adaptable)otherEnd, msgs);
-		}
-		return super.eInverseAdd(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
-		switch (featureID) {
-			case HintcoPackage.ADAPTATION__PARENT:
-				return basicSetParent(null, msgs);
-			case HintcoPackage.ADAPTATION__ADAPTABLE:
-				return basicSetAdaptable(null, msgs);
-		}
-		return super.eInverseRemove(otherEnd, featureID, msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
-		switch (eContainerFeatureID()) {
-			case HintcoPackage.ADAPTATION__PARENT:
-				return eInternalContainer().eInverseRemove(this, HintcoPackage.DECOMPOSITION_ADAPTATION__CHILDREN, DecompositionAdaptation.class, msgs);
-			case HintcoPackage.ADAPTATION__ADAPTABLE:
-				return eInternalContainer().eInverseRemove(this, HintcoPackage.ADAPTABLE__ADAPTATION, Adaptable.class, msgs);
-		}
-		return super.eBasicRemoveFromContainerFeature(msgs);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public Object eGet(int featureID, boolean resolve, boolean coreType) {
-		switch (featureID) {
-			case HintcoPackage.ADAPTATION__PARENT:
-				if (resolve) return getParent();
-				return basicGetParent();
-			case HintcoPackage.ADAPTATION__ADAPTABLE:
-				if (resolve) return getAdaptable();
-				return basicGetAdaptable();
-		}
-		return super.eGet(featureID, resolve, coreType);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public void eSet(int featureID, Object newValue) {
-		switch (featureID) {
-			case HintcoPackage.ADAPTATION__PARENT:
-				setParent((DecompositionAdaptation)newValue);
-				return;
-			case HintcoPackage.ADAPTATION__ADAPTABLE:
-				setAdaptable((Adaptable)newValue);
-				return;
-		}
-		super.eSet(featureID, newValue);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public void eUnset(int featureID) {
-		switch (featureID) {
-			case HintcoPackage.ADAPTATION__PARENT:
-				setParent((DecompositionAdaptation)null);
-				return;
-			case HintcoPackage.ADAPTATION__ADAPTABLE:
-				setAdaptable((Adaptable)null);
-				return;
-		}
-		super.eUnset(featureID);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public boolean eIsSet(int featureID) {
-		switch (featureID) {
-			case HintcoPackage.ADAPTATION__PARENT:
-				return basicGetParent() != null;
-			case HintcoPackage.ADAPTATION__ADAPTABLE:
-				return basicGetAdaptable() != null;
-		}
-		return super.eIsSet(featureID);
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
-		switch (operationID) {
-			case HintcoPackage.ADAPTATION___ADAPTED:
-				return adapted();
-		}
-		return super.eInvoke(operationID, arguments);
-	}
-
 } //AdaptationImpl

+ 1 - 1
HintCO/src-gen/ua/ansymo/hintco/impl/ApproximationAdaptationImpl.java

@@ -24,7 +24,7 @@ import ua.ansymo.hintco.HintcoPackage;
  *
  * @generated
  */
-public abstract class ApproximationAdaptationImpl extends AdaptationImpl implements ApproximationAdaptation {
+public abstract class ApproximationAdaptationImpl extends PortAdaptationImpl implements ApproximationAdaptation {
 	/**
 	 * The default value of the '{@link #getOrder() <em>Order</em>}' attribute.
 	 * <!-- begin-user-doc -->

+ 1 - 1
HintCO/src-gen/ua/ansymo/hintco/impl/CombineAdaptationImpl.java

@@ -14,7 +14,7 @@ import ua.ansymo.hintco.HintcoPackage;
  *
  * @generated
  */
-public class CombineAdaptationImpl extends DecompositionAdaptationImpl implements CombineAdaptation {
+public class CombineAdaptationImpl extends DecompositionUnitAdaptationImpl implements CombineAdaptation {
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->

+ 22 - 56
HintCO/src-gen/ua/ansymo/hintco/impl/CosimUnitInstanceImpl.java

@@ -21,14 +21,13 @@ import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
 import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
 import org.eclipse.emf.ecore.util.InternalEList;
 
-import ua.ansymo.hintco.Adaptable;
-import ua.ansymo.hintco.Adaptation;
 import ua.ansymo.hintco.CosimUnitDeclaration;
 import ua.ansymo.hintco.CosimUnitInstance;
-import ua.ansymo.hintco.DecompositionAdaptation;
+import ua.ansymo.hintco.DecompositionUnitAdaptation;
 import ua.ansymo.hintco.HintcoPackage;
 import ua.ansymo.hintco.PortInstance;
 import ua.ansymo.hintco.PrecendenceNode;
+import ua.ansymo.hintco.UnitAdaptation;
 
 /**
  * <!-- begin-user-doc -->
@@ -98,7 +97,7 @@ public class CosimUnitInstanceImpl extends IDedImpl implements CosimUnitInstance
 	 * @generated
 	 * @ordered
 	 */
-	protected Adaptation adaptation;
+	protected UnitAdaptation adaptation;
 
 	/**
 	 * The cached value of the '{@link #getDeclaration() <em>Declaration</em>}' reference.
@@ -288,7 +287,7 @@ public class CosimUnitInstanceImpl extends IDedImpl implements CosimUnitInstance
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public Adaptation getAdaptation() {
+	public UnitAdaptation getAdaptation() {
 		return adaptation;
 	}
 
@@ -297,8 +296,8 @@ public class CosimUnitInstanceImpl extends IDedImpl implements CosimUnitInstance
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public NotificationChain basicSetAdaptation(Adaptation newAdaptation, NotificationChain msgs) {
-		Adaptation oldAdaptation = adaptation;
+	public NotificationChain basicSetAdaptation(UnitAdaptation newAdaptation, NotificationChain msgs) {
+		UnitAdaptation oldAdaptation = adaptation;
 		adaptation = newAdaptation;
 		if (eNotificationRequired()) {
 			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, HintcoPackage.COSIM_UNIT_INSTANCE__ADAPTATION, oldAdaptation, newAdaptation);
@@ -312,13 +311,13 @@ public class CosimUnitInstanceImpl extends IDedImpl implements CosimUnitInstance
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public void setAdaptation(Adaptation newAdaptation) {
+	public void setAdaptation(UnitAdaptation newAdaptation) {
 		if (newAdaptation != adaptation) {
 			NotificationChain msgs = null;
 			if (adaptation != null)
-				msgs = ((InternalEObject)adaptation).eInverseRemove(this, HintcoPackage.ADAPTATION__ADAPTABLE, Adaptation.class, msgs);
+				msgs = ((InternalEObject)adaptation).eInverseRemove(this, HintcoPackage.UNIT_ADAPTATION__UNIT, UnitAdaptation.class, msgs);
 			if (newAdaptation != null)
-				msgs = ((InternalEObject)newAdaptation).eInverseAdd(this, HintcoPackage.ADAPTATION__ADAPTABLE, Adaptation.class, msgs);
+				msgs = ((InternalEObject)newAdaptation).eInverseAdd(this, HintcoPackage.UNIT_ADAPTATION__UNIT, UnitAdaptation.class, msgs);
 			msgs = basicSetAdaptation(newAdaptation, msgs);
 			if (msgs != null) msgs.dispatch();
 		}
@@ -381,23 +380,23 @@ public class CosimUnitInstanceImpl extends IDedImpl implements CosimUnitInstance
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EList<Adaptation> selectedAdaptations() {
-		Adaptation _adaptation = this.getAdaptation();
+	public EList<UnitAdaptation> selectedAdaptations() {
+		UnitAdaptation _adaptation = this.getAdaptation();
 		boolean _tripleEquals = (_adaptation == null);
 		if (_tripleEquals) {
-			return new BasicEList<Adaptation>(java.util.Collections.<Adaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<Adaptation>newArrayList()));
+			return new BasicEList<UnitAdaptation>(java.util.Collections.<UnitAdaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<UnitAdaptation>newArrayList()));
 		}
 		boolean _isSelected = this.getAdaptation().isSelected();
 		if (_isSelected) {
-			Adaptation _adaptation_1 = this.getAdaptation();
-			if ((_adaptation_1 instanceof DecompositionAdaptation)) {
-				Adaptation _adaptation_2 = this.getAdaptation();
-				return ((DecompositionAdaptation) _adaptation_2).selectedAdaptations();
+			UnitAdaptation _adaptation_1 = this.getAdaptation();
+			if ((_adaptation_1 instanceof DecompositionUnitAdaptation)) {
+				UnitAdaptation _adaptation_2 = this.getAdaptation();
+				return ((DecompositionUnitAdaptation) _adaptation_2).selectedAdaptations();
 			}
-			Adaptation _adaptation_3 = this.getAdaptation();
-			return new BasicEList<Adaptation>(java.util.Collections.<Adaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<Adaptation>newArrayList(_adaptation_3)));
+			UnitAdaptation _adaptation_3 = this.getAdaptation();
+			return new BasicEList<UnitAdaptation>(java.util.Collections.<UnitAdaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<UnitAdaptation>newArrayList(_adaptation_3)));
 		}
-		return new BasicEList<Adaptation>(java.util.Collections.<Adaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<Adaptation>newArrayList()));
+		return new BasicEList<UnitAdaptation>(java.util.Collections.<UnitAdaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<UnitAdaptation>newArrayList()));
 	}
 
 	/**
@@ -424,7 +423,7 @@ public class CosimUnitInstanceImpl extends IDedImpl implements CosimUnitInstance
 			case HintcoPackage.COSIM_UNIT_INSTANCE__ADAPTATION:
 				if (adaptation != null)
 					msgs = ((InternalEObject)adaptation).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - HintcoPackage.COSIM_UNIT_INSTANCE__ADAPTATION, null, msgs);
-				return basicSetAdaptation((Adaptation)otherEnd, msgs);
+				return basicSetAdaptation((UnitAdaptation)otherEnd, msgs);
 			case HintcoPackage.COSIM_UNIT_INSTANCE__PORTS:
 				return ((InternalEList<InternalEObject>)(InternalEList<?>)getPorts()).basicAdd(otherEnd, msgs);
 		}
@@ -508,7 +507,7 @@ public class CosimUnitInstanceImpl extends IDedImpl implements CosimUnitInstance
 				setAfter((PrecendenceNode)newValue);
 				return;
 			case HintcoPackage.COSIM_UNIT_INSTANCE__ADAPTATION:
-				setAdaptation((Adaptation)newValue);
+				setAdaptation((UnitAdaptation)newValue);
 				return;
 			case HintcoPackage.COSIM_UNIT_INSTANCE__DECLARATION:
 				setDeclaration((CosimUnitDeclaration)newValue);
@@ -542,7 +541,7 @@ public class CosimUnitInstanceImpl extends IDedImpl implements CosimUnitInstance
 				setAfter((PrecendenceNode)null);
 				return;
 			case HintcoPackage.COSIM_UNIT_INSTANCE__ADAPTATION:
-				setAdaptation((Adaptation)null);
+				setAdaptation((UnitAdaptation)null);
 				return;
 			case HintcoPackage.COSIM_UNIT_INSTANCE__DECLARATION:
 				setDeclaration((CosimUnitDeclaration)null);
@@ -596,12 +595,6 @@ public class CosimUnitInstanceImpl extends IDedImpl implements CosimUnitInstance
 				default: return -1;
 			}
 		}
-		if (baseClass == Adaptable.class) {
-			switch (derivedFeatureID) {
-				case HintcoPackage.COSIM_UNIT_INSTANCE__ADAPTATION: return HintcoPackage.ADAPTABLE__ADAPTATION;
-				default: return -1;
-			}
-		}
 		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
 	}
 
@@ -621,36 +614,9 @@ public class CosimUnitInstanceImpl extends IDedImpl implements CosimUnitInstance
 				default: return -1;
 			}
 		}
-		if (baseClass == Adaptable.class) {
-			switch (baseFeatureID) {
-				case HintcoPackage.ADAPTABLE__ADAPTATION: return HintcoPackage.COSIM_UNIT_INSTANCE__ADAPTATION;
-				default: return -1;
-			}
-		}
 		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
 	}
 
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public int eDerivedOperationID(int baseOperationID, Class<?> baseClass) {
-		if (baseClass == PrecendenceNode.class) {
-			switch (baseOperationID) {
-				default: return -1;
-			}
-		}
-		if (baseClass == Adaptable.class) {
-			switch (baseOperationID) {
-				case HintcoPackage.ADAPTABLE___SELECTED_ADAPTATIONS: return HintcoPackage.COSIM_UNIT_INSTANCE___SELECTED_ADAPTATIONS;
-				default: return -1;
-			}
-		}
-		return super.eDerivedOperationID(baseOperationID, baseClass);
-	}
-
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->

+ 30 - 30
HintCO/src-gen/ua/ansymo/hintco/impl/DecompositionAdaptationImpl.java

@@ -21,25 +21,25 @@ import org.eclipse.xtext.xbase.lib.Functions.Function1;
 
 import org.eclipse.xtext.xbase.lib.IterableExtensions;
 
-import ua.ansymo.hintco.Adaptation;
-import ua.ansymo.hintco.DecompositionAdaptation;
+import ua.ansymo.hintco.DecompositionPortAdaptation;
 import ua.ansymo.hintco.HintcoPackage;
+import ua.ansymo.hintco.PortAdaptation;
 
 /**
  * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Decomposition Adaptation</b></em>'.
+ * An implementation of the model object '<em><b>Decomposition Port Adaptation</b></em>'.
  * <!-- end-user-doc -->
  * <p>
  * The following features are implemented:
  * </p>
  * <ul>
- *   <li>{@link ua.ansymo.hintco.impl.DecompositionAdaptationImpl#getChildren <em>Children</em>}</li>
- *   <li>{@link ua.ansymo.hintco.impl.DecompositionAdaptationImpl#getName <em>Name</em>}</li>
+ *   <li>{@link ua.ansymo.hintco.impl.DecompositionPortAdaptationImpl#getChildren <em>Children</em>}</li>
+ *   <li>{@link ua.ansymo.hintco.impl.DecompositionPortAdaptationImpl#getName <em>Name</em>}</li>
  * </ul>
  *
  * @generated
  */
-public abstract class DecompositionAdaptationImpl extends AdaptationImpl implements DecompositionAdaptation {
+public abstract class DecompositionPortAdaptationImpl extends PortAdaptationImpl implements DecompositionPortAdaptation {
 	/**
 	 * The cached value of the '{@link #getChildren() <em>Children</em>}' containment reference list.
 	 * <!-- begin-user-doc -->
@@ -48,7 +48,7 @@ public abstract class DecompositionAdaptationImpl extends AdaptationImpl impleme
 	 * @generated
 	 * @ordered
 	 */
-	protected EList<Adaptation> children;
+	protected EList<PortAdaptation> children;
 
 	/**
 	 * The default value of the '{@link #getName() <em>Name</em>}' attribute.
@@ -65,7 +65,7 @@ public abstract class DecompositionAdaptationImpl extends AdaptationImpl impleme
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	protected DecompositionAdaptationImpl() {
+	protected DecompositionPortAdaptationImpl() {
 		super();
 	}
 
@@ -76,7 +76,7 @@ public abstract class DecompositionAdaptationImpl extends AdaptationImpl impleme
 	 */
 	@Override
 	protected EClass eStaticClass() {
-		return HintcoPackage.Literals.DECOMPOSITION_ADAPTATION;
+		return HintcoPackage.Literals.DECOMPOSITION_PORT_ADAPTATION;
 	}
 
 	/**
@@ -84,9 +84,9 @@ public abstract class DecompositionAdaptationImpl extends AdaptationImpl impleme
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EList<Adaptation> getChildren() {
+	public EList<PortAdaptation> getChildren() {
 		if (children == null) {
-			children = new EObjectContainmentWithInverseEList<Adaptation>(Adaptation.class, this, HintcoPackage.DECOMPOSITION_ADAPTATION__CHILDREN, HintcoPackage.ADAPTATION__PARENT);
+			children = new EObjectContainmentWithInverseEList<PortAdaptation>(PortAdaptation.class, this, HintcoPackage.DECOMPOSITION_PORT_ADAPTATION__CHILDREN, HintcoPackage.PORT_ADAPTATION__PARENT);
 		}
 		return children;
 	}
@@ -107,18 +107,18 @@ public abstract class DecompositionAdaptationImpl extends AdaptationImpl impleme
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EList<Adaptation> selectedAdaptations() {
+	public EList<PortAdaptation> selectedAdaptations() {
 		int _size = this.getChildren().size();
-		final BasicEList<Adaptation> res = new BasicEList<Adaptation>(_size);
-		final Function1<Adaptation, Boolean> _function = new Function1<Adaptation, Boolean>() {
-			public Boolean apply(final Adaptation a) {
+		final BasicEList<PortAdaptation> res = new BasicEList<PortAdaptation>(_size);
+		final Function1<PortAdaptation, Boolean> _function = new Function1<PortAdaptation, Boolean>() {
+			public Boolean apply(final PortAdaptation a) {
 				return Boolean.valueOf(a.isSelected());
 			}
 		};
-		Iterable<Adaptation> _filter = IterableExtensions.<Adaptation>filter(this.getChildren(), _function);
-		for (final Adaptation c : _filter) {
-			if ((c instanceof DecompositionAdaptation)) {
-				res.addAll(((DecompositionAdaptation)c).selectedAdaptations());
+		Iterable<PortAdaptation> _filter = IterableExtensions.<PortAdaptation>filter(this.getChildren(), _function);
+		for (final PortAdaptation c : _filter) {
+			if ((c instanceof DecompositionPortAdaptation)) {
+				res.addAll(((DecompositionPortAdaptation)c).selectedAdaptations());
 			}
 			else {
 				res.add(c);
@@ -136,7 +136,7 @@ public abstract class DecompositionAdaptationImpl extends AdaptationImpl impleme
 	@Override
 	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
 		switch (featureID) {
-			case HintcoPackage.DECOMPOSITION_ADAPTATION__CHILDREN:
+			case HintcoPackage.DECOMPOSITION_PORT_ADAPTATION__CHILDREN:
 				return ((InternalEList<InternalEObject>)(InternalEList<?>)getChildren()).basicAdd(otherEnd, msgs);
 		}
 		return super.eInverseAdd(otherEnd, featureID, msgs);
@@ -150,7 +150,7 @@ public abstract class DecompositionAdaptationImpl extends AdaptationImpl impleme
 	@Override
 	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
 		switch (featureID) {
-			case HintcoPackage.DECOMPOSITION_ADAPTATION__CHILDREN:
+			case HintcoPackage.DECOMPOSITION_PORT_ADAPTATION__CHILDREN:
 				return ((InternalEList<?>)getChildren()).basicRemove(otherEnd, msgs);
 		}
 		return super.eInverseRemove(otherEnd, featureID, msgs);
@@ -164,9 +164,9 @@ public abstract class DecompositionAdaptationImpl extends AdaptationImpl impleme
 	@Override
 	public Object eGet(int featureID, boolean resolve, boolean coreType) {
 		switch (featureID) {
-			case HintcoPackage.DECOMPOSITION_ADAPTATION__CHILDREN:
+			case HintcoPackage.DECOMPOSITION_PORT_ADAPTATION__CHILDREN:
 				return getChildren();
-			case HintcoPackage.DECOMPOSITION_ADAPTATION__NAME:
+			case HintcoPackage.DECOMPOSITION_PORT_ADAPTATION__NAME:
 				return getName();
 		}
 		return super.eGet(featureID, resolve, coreType);
@@ -181,9 +181,9 @@ public abstract class DecompositionAdaptationImpl extends AdaptationImpl impleme
 	@Override
 	public void eSet(int featureID, Object newValue) {
 		switch (featureID) {
-			case HintcoPackage.DECOMPOSITION_ADAPTATION__CHILDREN:
+			case HintcoPackage.DECOMPOSITION_PORT_ADAPTATION__CHILDREN:
 				getChildren().clear();
-				getChildren().addAll((Collection<? extends Adaptation>)newValue);
+				getChildren().addAll((Collection<? extends PortAdaptation>)newValue);
 				return;
 		}
 		super.eSet(featureID, newValue);
@@ -197,7 +197,7 @@ public abstract class DecompositionAdaptationImpl extends AdaptationImpl impleme
 	@Override
 	public void eUnset(int featureID) {
 		switch (featureID) {
-			case HintcoPackage.DECOMPOSITION_ADAPTATION__CHILDREN:
+			case HintcoPackage.DECOMPOSITION_PORT_ADAPTATION__CHILDREN:
 				getChildren().clear();
 				return;
 		}
@@ -212,9 +212,9 @@ public abstract class DecompositionAdaptationImpl extends AdaptationImpl impleme
 	@Override
 	public boolean eIsSet(int featureID) {
 		switch (featureID) {
-			case HintcoPackage.DECOMPOSITION_ADAPTATION__CHILDREN:
+			case HintcoPackage.DECOMPOSITION_PORT_ADAPTATION__CHILDREN:
 				return children != null && !children.isEmpty();
-			case HintcoPackage.DECOMPOSITION_ADAPTATION__NAME:
+			case HintcoPackage.DECOMPOSITION_PORT_ADAPTATION__NAME:
 				return NAME_EDEFAULT == null ? getName() != null : !NAME_EDEFAULT.equals(getName());
 		}
 		return super.eIsSet(featureID);
@@ -228,10 +228,10 @@ public abstract class DecompositionAdaptationImpl extends AdaptationImpl impleme
 	@Override
 	public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
 		switch (operationID) {
-			case HintcoPackage.DECOMPOSITION_ADAPTATION___SELECTED_ADAPTATIONS:
+			case HintcoPackage.DECOMPOSITION_PORT_ADAPTATION___SELECTED_ADAPTATIONS:
 				return selectedAdaptations();
 		}
 		return super.eInvoke(operationID, arguments);
 	}
 
-} //DecompositionAdaptationImpl
+} //DecompositionPortAdaptationImpl

+ 237 - 0
HintCO/src-gen/ua/ansymo/hintco/impl/DecompositionUnitAdaptationImpl.java

@@ -0,0 +1,237 @@
+/**
+ */
+package ua.ansymo.hintco.impl;
+
+import java.lang.reflect.InvocationTargetException;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
+import org.eclipse.emf.ecore.util.InternalEList;
+
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+
+import ua.ansymo.hintco.DecompositionUnitAdaptation;
+import ua.ansymo.hintco.HintcoPackage;
+import ua.ansymo.hintco.UnitAdaptation;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Decomposition Unit Adaptation</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ *   <li>{@link ua.ansymo.hintco.impl.DecompositionUnitAdaptationImpl#getChildren <em>Children</em>}</li>
+ *   <li>{@link ua.ansymo.hintco.impl.DecompositionUnitAdaptationImpl#getName <em>Name</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public abstract class DecompositionUnitAdaptationImpl extends UnitAdaptationImpl implements DecompositionUnitAdaptation {
+	/**
+	 * The cached value of the '{@link #getChildren() <em>Children</em>}' containment reference list.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getChildren()
+	 * @generated
+	 * @ordered
+	 */
+	protected EList<UnitAdaptation> children;
+
+	/**
+	 * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @see #getName()
+	 * @generated
+	 * @ordered
+	 */
+	protected static final String NAME_EDEFAULT = null;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected DecompositionUnitAdaptationImpl() {
+		super();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected EClass eStaticClass() {
+		return HintcoPackage.Literals.DECOMPOSITION_UNIT_ADAPTATION;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EList<UnitAdaptation> getChildren() {
+		if (children == null) {
+			children = new EObjectContainmentWithInverseEList<UnitAdaptation>(UnitAdaptation.class, this, HintcoPackage.DECOMPOSITION_UNIT_ADAPTATION__CHILDREN, HintcoPackage.UNIT_ADAPTATION__PARENT);
+		}
+		return children;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public String getName() {
+		int _weight = this.getWeight();
+		String _plus = ("(w=" + Integer.valueOf(_weight));
+		return (_plus + ")");
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EList<UnitAdaptation> selectedAdaptations() {
+		int _size = this.getChildren().size();
+		final BasicEList<UnitAdaptation> res = new BasicEList<UnitAdaptation>(_size);
+		final Function1<UnitAdaptation, Boolean> _function = new Function1<UnitAdaptation, Boolean>() {
+			public Boolean apply(final UnitAdaptation a) {
+				return Boolean.valueOf(a.isSelected());
+			}
+		};
+		Iterable<UnitAdaptation> _filter = IterableExtensions.<UnitAdaptation>filter(this.getChildren(), _function);
+		for (final UnitAdaptation c : _filter) {
+			if ((c instanceof DecompositionUnitAdaptation)) {
+				res.addAll(((DecompositionUnitAdaptation)c).selectedAdaptations());
+			}
+			else {
+				res.add(c);
+			}
+		}
+		return res;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@SuppressWarnings("unchecked")
+	@Override
+	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+		switch (featureID) {
+			case HintcoPackage.DECOMPOSITION_UNIT_ADAPTATION__CHILDREN:
+				return ((InternalEList<InternalEObject>)(InternalEList<?>)getChildren()).basicAdd(otherEnd, msgs);
+		}
+		return super.eInverseAdd(otherEnd, featureID, msgs);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+		switch (featureID) {
+			case HintcoPackage.DECOMPOSITION_UNIT_ADAPTATION__CHILDREN:
+				return ((InternalEList<?>)getChildren()).basicRemove(otherEnd, msgs);
+		}
+		return super.eInverseRemove(otherEnd, featureID, msgs);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object eGet(int featureID, boolean resolve, boolean coreType) {
+		switch (featureID) {
+			case HintcoPackage.DECOMPOSITION_UNIT_ADAPTATION__CHILDREN:
+				return getChildren();
+			case HintcoPackage.DECOMPOSITION_UNIT_ADAPTATION__NAME:
+				return getName();
+		}
+		return super.eGet(featureID, resolve, coreType);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@SuppressWarnings("unchecked")
+	@Override
+	public void eSet(int featureID, Object newValue) {
+		switch (featureID) {
+			case HintcoPackage.DECOMPOSITION_UNIT_ADAPTATION__CHILDREN:
+				getChildren().clear();
+				getChildren().addAll((Collection<? extends UnitAdaptation>)newValue);
+				return;
+		}
+		super.eSet(featureID, newValue);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eUnset(int featureID) {
+		switch (featureID) {
+			case HintcoPackage.DECOMPOSITION_UNIT_ADAPTATION__CHILDREN:
+				getChildren().clear();
+				return;
+		}
+		super.eUnset(featureID);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public boolean eIsSet(int featureID) {
+		switch (featureID) {
+			case HintcoPackage.DECOMPOSITION_UNIT_ADAPTATION__CHILDREN:
+				return children != null && !children.isEmpty();
+			case HintcoPackage.DECOMPOSITION_UNIT_ADAPTATION__NAME:
+				return NAME_EDEFAULT == null ? getName() != null : !NAME_EDEFAULT.equals(getName());
+		}
+		return super.eIsSet(featureID);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
+		switch (operationID) {
+			case HintcoPackage.DECOMPOSITION_UNIT_ADAPTATION___SELECTED_ADAPTATIONS:
+				return selectedAdaptations();
+		}
+		return super.eInvoke(operationID, arguments);
+	}
+
+} //DecompositionUnitAdaptationImpl

+ 15 - 15
HintCO/src-gen/ua/ansymo/hintco/impl/HintcoFactoryImpl.java

@@ -62,13 +62,13 @@ public class HintcoFactoryImpl extends EFactoryImpl implements HintcoFactory {
 			case HintcoPackage.CANDIDATE_SCENARIO: return createCandidateScenario();
 			case HintcoPackage.COSIM_UNIT_DECLARATION: return createCosimUnitDeclaration();
 			case HintcoPackage.HIERARCHICAL_COSIM_UNIT_DECLARATION: return createHierarchicalCosimUnitDeclaration();
-			case HintcoPackage.ADAPTABLE: return createAdaptable();
 			case HintcoPackage.COSIM_UNIT_INSTANCE: return createCosimUnitInstance();
 			case HintcoPackage.INPUT_PORT_DECLARATION: return createInputPortDeclaration();
 			case HintcoPackage.OUTPUT_PORT_DECLARATION: return createOutputPortDeclaration();
 			case HintcoPackage.INPUT_PORT_INSTANCE: return createInputPortInstance();
 			case HintcoPackage.OUTPUT_PORT_INSTANCE: return createOutputPortInstance();
-			case HintcoPackage.XOR_ADAPTATION: return createXorAdaptation();
+			case HintcoPackage.XOR_UNIT_ADAPTATION: return createXorUnitAdaptation();
+			case HintcoPackage.XOR_PORT_ADAPTATION: return createXorPortAdaptation();
 			case HintcoPackage.COMBINE_ADAPTATION: return createCombineAdaptation();
 			case HintcoPackage.MULTI_RATE_ADAPTATION: return createMultiRateAdaptation();
 			case HintcoPackage.EXTRAPOLATION_ADAPTATION: return createExtrapolationAdaptation();
@@ -158,16 +158,6 @@ public class HintcoFactoryImpl extends EFactoryImpl implements HintcoFactory {
 		return hierarchicalCosimUnitDeclaration;
 	}
 
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public Adaptable createAdaptable() {
-		AdaptableImpl adaptable = new AdaptableImpl();
-		return adaptable;
-	}
-
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -223,9 +213,19 @@ public class HintcoFactoryImpl extends EFactoryImpl implements HintcoFactory {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public XorAdaptation createXorAdaptation() {
-		XorAdaptationImpl xorAdaptation = new XorAdaptationImpl();
-		return xorAdaptation;
+	public XorUnitAdaptation createXorUnitAdaptation() {
+		XorUnitAdaptationImpl xorUnitAdaptation = new XorUnitAdaptationImpl();
+		return xorUnitAdaptation;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public XorPortAdaptation createXorPortAdaptation() {
+		XorPortAdaptationImpl xorPortAdaptation = new XorPortAdaptationImpl();
+		return xorPortAdaptation;
 	}
 
 	/**

+ 235 - 79
HintCO/src-gen/ua/ansymo/hintco/impl/HintcoPackageImpl.java

@@ -12,7 +12,6 @@ import org.eclipse.emf.ecore.EcorePackage;
 
 import org.eclipse.emf.ecore.impl.EPackageImpl;
 
-import ua.ansymo.hintco.Adaptable;
 import ua.ansymo.hintco.Adaptation;
 import ua.ansymo.hintco.Alternative;
 import ua.ansymo.hintco.ApproximationAdaptation;
@@ -21,7 +20,8 @@ import ua.ansymo.hintco.Candidates;
 import ua.ansymo.hintco.CombineAdaptation;
 import ua.ansymo.hintco.CosimUnitDeclaration;
 import ua.ansymo.hintco.CosimUnitInstance;
-import ua.ansymo.hintco.DecompositionAdaptation;
+import ua.ansymo.hintco.DecompositionPortAdaptation;
+import ua.ansymo.hintco.DecompositionUnitAdaptation;
 import ua.ansymo.hintco.ExtrapolationAdaptation;
 import ua.ansymo.hintco.HierarchicalCosimUnitDeclaration;
 import ua.ansymo.hintco.HintcoFactory;
@@ -33,11 +33,14 @@ import ua.ansymo.hintco.InterpolationAdaptation;
 import ua.ansymo.hintco.MultiRateAdaptation;
 import ua.ansymo.hintco.OutputPortDeclaration;
 import ua.ansymo.hintco.OutputPortInstance;
+import ua.ansymo.hintco.PortAdaptation;
 import ua.ansymo.hintco.PortDeclaration;
 import ua.ansymo.hintco.PortInstance;
 import ua.ansymo.hintco.PrecendenceNode;
+import ua.ansymo.hintco.UnitAdaptation;
 import ua.ansymo.hintco.VariantDiagram;
-import ua.ansymo.hintco.XorAdaptation;
+import ua.ansymo.hintco.XorPortAdaptation;
+import ua.ansymo.hintco.XorUnitAdaptation;
 
 /**
  * <!-- begin-user-doc -->
@@ -95,13 +98,6 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 */
 	private EClass hierarchicalCosimUnitDeclarationEClass = null;
 
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	private EClass adaptableEClass = null;
-
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -170,14 +166,42 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	private EClass decompositionAdaptationEClass = null;
+	private EClass portAdaptationEClass = null;
 
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	private EClass xorAdaptationEClass = null;
+	private EClass decompositionPortAdaptationEClass = null;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private EClass unitAdaptationEClass = null;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private EClass decompositionUnitAdaptationEClass = null;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private EClass xorUnitAdaptationEClass = null;
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	private EClass xorPortAdaptationEClass = null;
 
 	/**
 	 * <!-- begin-user-doc -->
@@ -542,17 +566,8 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EClass getAdaptable() {
-		return adaptableEClass;
-	}
-
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	public EReference getAdaptable_Adaptation() {
-		return (EReference)adaptableEClass.getEStructuralFeatures().get(0);
+	public EClass getCosimUnitInstance() {
+		return cosimUnitInstanceEClass;
 	}
 
 	/**
@@ -560,8 +575,8 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EOperation getAdaptable__SelectedAdaptations() {
-		return adaptableEClass.getEOperations().get(0);
+	public EReference getCosimUnitInstance_Adaptation() {
+		return (EReference)cosimUnitInstanceEClass.getEStructuralFeatures().get(0);
 	}
 
 	/**
@@ -569,8 +584,8 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EClass getCosimUnitInstance() {
-		return cosimUnitInstanceEClass;
+	public EReference getCosimUnitInstance_Declaration() {
+		return (EReference)cosimUnitInstanceEClass.getEStructuralFeatures().get(1);
 	}
 
 	/**
@@ -578,8 +593,8 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EReference getCosimUnitInstance_Declaration() {
-		return (EReference)cosimUnitInstanceEClass.getEStructuralFeatures().get(0);
+	public EReference getCosimUnitInstance_Ports() {
+		return (EReference)cosimUnitInstanceEClass.getEStructuralFeatures().get(2);
 	}
 
 	/**
@@ -587,8 +602,8 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EReference getCosimUnitInstance_Ports() {
-		return (EReference)cosimUnitInstanceEClass.getEStructuralFeatures().get(1);
+	public EOperation getCosimUnitInstance__SelectedAdaptations() {
+		return cosimUnitInstanceEClass.getEOperations().get(0);
 	}
 
 	/**
@@ -636,6 +651,24 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 		return (EReference)portInstanceEClass.getEStructuralFeatures().get(0);
 	}
 
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getPortInstance_Adaptation() {
+		return (EReference)portInstanceEClass.getEStructuralFeatures().get(1);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EOperation getPortInstance__SelectedAdaptations() {
+		return portInstanceEClass.getEOperations().get(0);
+	}
+
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
@@ -740,8 +773,80 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EReference getAdaptation_Parent() {
-		return (EReference)adaptationEClass.getEStructuralFeatures().get(0);
+	public EClass getPortAdaptation() {
+		return portAdaptationEClass;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getPortAdaptation_Port() {
+		return (EReference)portAdaptationEClass.getEStructuralFeatures().get(0);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getPortAdaptation_Parent() {
+		return (EReference)portAdaptationEClass.getEStructuralFeatures().get(1);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EOperation getPortAdaptation__Adapted() {
+		return portAdaptationEClass.getEOperations().get(0);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EClass getDecompositionPortAdaptation() {
+		return decompositionPortAdaptationEClass;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EReference getDecompositionPortAdaptation_Children() {
+		return (EReference)decompositionPortAdaptationEClass.getEStructuralFeatures().get(0);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EAttribute getDecompositionPortAdaptation_Name() {
+		return (EAttribute)decompositionPortAdaptationEClass.getEStructuralFeatures().get(1);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EOperation getDecompositionPortAdaptation__SelectedAdaptations() {
+		return decompositionPortAdaptationEClass.getEOperations().get(0);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EClass getUnitAdaptation() {
+		return unitAdaptationEClass;
 	}
 
 	/**
@@ -749,8 +854,8 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EReference getAdaptation_Adaptable() {
-		return (EReference)adaptationEClass.getEStructuralFeatures().get(1);
+	public EReference getUnitAdaptation_Unit() {
+		return (EReference)unitAdaptationEClass.getEStructuralFeatures().get(0);
 	}
 
 	/**
@@ -758,8 +863,8 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EOperation getAdaptation__Adapted() {
-		return adaptationEClass.getEOperations().get(0);
+	public EReference getUnitAdaptation_Parent() {
+		return (EReference)unitAdaptationEClass.getEStructuralFeatures().get(1);
 	}
 
 	/**
@@ -767,8 +872,8 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EClass getDecompositionAdaptation() {
-		return decompositionAdaptationEClass;
+	public EOperation getUnitAdaptation__Adapted() {
+		return unitAdaptationEClass.getEOperations().get(0);
 	}
 
 	/**
@@ -776,8 +881,8 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EReference getDecompositionAdaptation_Children() {
-		return (EReference)decompositionAdaptationEClass.getEStructuralFeatures().get(0);
+	public EClass getDecompositionUnitAdaptation() {
+		return decompositionUnitAdaptationEClass;
 	}
 
 	/**
@@ -785,8 +890,8 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EAttribute getDecompositionAdaptation_Name() {
-		return (EAttribute)decompositionAdaptationEClass.getEStructuralFeatures().get(1);
+	public EReference getDecompositionUnitAdaptation_Children() {
+		return (EReference)decompositionUnitAdaptationEClass.getEStructuralFeatures().get(0);
 	}
 
 	/**
@@ -794,8 +899,8 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EOperation getDecompositionAdaptation__SelectedAdaptations() {
-		return decompositionAdaptationEClass.getEOperations().get(0);
+	public EAttribute getDecompositionUnitAdaptation_Name() {
+		return (EAttribute)decompositionUnitAdaptationEClass.getEStructuralFeatures().get(1);
 	}
 
 	/**
@@ -803,8 +908,26 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EClass getXorAdaptation() {
-		return xorAdaptationEClass;
+	public EOperation getDecompositionUnitAdaptation__SelectedAdaptations() {
+		return decompositionUnitAdaptationEClass.getEOperations().get(0);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EClass getXorUnitAdaptation() {
+		return xorUnitAdaptationEClass;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public EClass getXorPortAdaptation() {
+		return xorPortAdaptationEClass;
 	}
 
 	/**
@@ -969,13 +1092,11 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 		hierarchicalCosimUnitDeclarationEClass = createEClass(HIERARCHICAL_COSIM_UNIT_DECLARATION);
 		createEReference(hierarchicalCosimUnitDeclarationEClass, HIERARCHICAL_COSIM_UNIT_DECLARATION__CHILDREN);
 
-		adaptableEClass = createEClass(ADAPTABLE);
-		createEReference(adaptableEClass, ADAPTABLE__ADAPTATION);
-		createEOperation(adaptableEClass, ADAPTABLE___SELECTED_ADAPTATIONS);
-
 		cosimUnitInstanceEClass = createEClass(COSIM_UNIT_INSTANCE);
+		createEReference(cosimUnitInstanceEClass, COSIM_UNIT_INSTANCE__ADAPTATION);
 		createEReference(cosimUnitInstanceEClass, COSIM_UNIT_INSTANCE__DECLARATION);
 		createEReference(cosimUnitInstanceEClass, COSIM_UNIT_INSTANCE__PORTS);
+		createEOperation(cosimUnitInstanceEClass, COSIM_UNIT_INSTANCE___SELECTED_ADAPTATIONS);
 
 		portDeclarationEClass = createEClass(PORT_DECLARATION);
 
@@ -985,6 +1106,8 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 
 		portInstanceEClass = createEClass(PORT_INSTANCE);
 		createEReference(portInstanceEClass, PORT_INSTANCE__UNIT);
+		createEReference(portInstanceEClass, PORT_INSTANCE__ADAPTATION);
+		createEOperation(portInstanceEClass, PORT_INSTANCE___SELECTED_ADAPTATIONS);
 
 		inputPortInstanceEClass = createEClass(INPUT_PORT_INSTANCE);
 		createEReference(inputPortInstanceEClass, INPUT_PORT_INSTANCE__DECLARATION);
@@ -1000,16 +1123,30 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 		createEReference(alternativeEClass, ALTERNATIVE__IMPLIES);
 
 		adaptationEClass = createEClass(ADAPTATION);
-		createEReference(adaptationEClass, ADAPTATION__PARENT);
-		createEReference(adaptationEClass, ADAPTATION__ADAPTABLE);
-		createEOperation(adaptationEClass, ADAPTATION___ADAPTED);
 
-		decompositionAdaptationEClass = createEClass(DECOMPOSITION_ADAPTATION);
-		createEReference(decompositionAdaptationEClass, DECOMPOSITION_ADAPTATION__CHILDREN);
-		createEAttribute(decompositionAdaptationEClass, DECOMPOSITION_ADAPTATION__NAME);
-		createEOperation(decompositionAdaptationEClass, DECOMPOSITION_ADAPTATION___SELECTED_ADAPTATIONS);
+		portAdaptationEClass = createEClass(PORT_ADAPTATION);
+		createEReference(portAdaptationEClass, PORT_ADAPTATION__PORT);
+		createEReference(portAdaptationEClass, PORT_ADAPTATION__PARENT);
+		createEOperation(portAdaptationEClass, PORT_ADAPTATION___ADAPTED);
+
+		decompositionPortAdaptationEClass = createEClass(DECOMPOSITION_PORT_ADAPTATION);
+		createEReference(decompositionPortAdaptationEClass, DECOMPOSITION_PORT_ADAPTATION__CHILDREN);
+		createEAttribute(decompositionPortAdaptationEClass, DECOMPOSITION_PORT_ADAPTATION__NAME);
+		createEOperation(decompositionPortAdaptationEClass, DECOMPOSITION_PORT_ADAPTATION___SELECTED_ADAPTATIONS);
 
-		xorAdaptationEClass = createEClass(XOR_ADAPTATION);
+		unitAdaptationEClass = createEClass(UNIT_ADAPTATION);
+		createEReference(unitAdaptationEClass, UNIT_ADAPTATION__UNIT);
+		createEReference(unitAdaptationEClass, UNIT_ADAPTATION__PARENT);
+		createEOperation(unitAdaptationEClass, UNIT_ADAPTATION___ADAPTED);
+
+		decompositionUnitAdaptationEClass = createEClass(DECOMPOSITION_UNIT_ADAPTATION);
+		createEReference(decompositionUnitAdaptationEClass, DECOMPOSITION_UNIT_ADAPTATION__CHILDREN);
+		createEAttribute(decompositionUnitAdaptationEClass, DECOMPOSITION_UNIT_ADAPTATION__NAME);
+		createEOperation(decompositionUnitAdaptationEClass, DECOMPOSITION_UNIT_ADAPTATION___SELECTED_ADAPTATIONS);
+
+		xorUnitAdaptationEClass = createEClass(XOR_UNIT_ADAPTATION);
+
+		xorPortAdaptationEClass = createEClass(XOR_PORT_ADAPTATION);
 
 		combineAdaptationEClass = createEClass(COMBINE_ADAPTATION);
 
@@ -1068,21 +1205,23 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 		hierarchicalCosimUnitDeclarationEClass.getESuperTypes().add(this.getCosimUnitDeclaration());
 		cosimUnitInstanceEClass.getESuperTypes().add(this.getIDed());
 		cosimUnitInstanceEClass.getESuperTypes().add(this.getPrecendenceNode());
-		cosimUnitInstanceEClass.getESuperTypes().add(this.getAdaptable());
 		portDeclarationEClass.getESuperTypes().add(this.getIDed());
 		inputPortDeclarationEClass.getESuperTypes().add(this.getPortDeclaration());
 		outputPortDeclarationEClass.getESuperTypes().add(this.getPortDeclaration());
 		portInstanceEClass.getESuperTypes().add(this.getPrecendenceNode());
 		portInstanceEClass.getESuperTypes().add(this.getIDed());
-		portInstanceEClass.getESuperTypes().add(this.getAdaptable());
 		inputPortInstanceEClass.getESuperTypes().add(this.getPortInstance());
 		outputPortInstanceEClass.getESuperTypes().add(this.getPortInstance());
 		adaptationEClass.getESuperTypes().add(this.getAlternative());
-		decompositionAdaptationEClass.getESuperTypes().add(this.getAdaptation());
-		xorAdaptationEClass.getESuperTypes().add(this.getDecompositionAdaptation());
-		combineAdaptationEClass.getESuperTypes().add(this.getDecompositionAdaptation());
-		approximationAdaptationEClass.getESuperTypes().add(this.getAdaptation());
-		multiRateAdaptationEClass.getESuperTypes().add(this.getAdaptation());
+		portAdaptationEClass.getESuperTypes().add(this.getAdaptation());
+		decompositionPortAdaptationEClass.getESuperTypes().add(this.getPortAdaptation());
+		unitAdaptationEClass.getESuperTypes().add(this.getAdaptation());
+		decompositionUnitAdaptationEClass.getESuperTypes().add(this.getUnitAdaptation());
+		xorUnitAdaptationEClass.getESuperTypes().add(this.getDecompositionUnitAdaptation());
+		xorPortAdaptationEClass.getESuperTypes().add(this.getDecompositionPortAdaptation());
+		combineAdaptationEClass.getESuperTypes().add(this.getDecompositionUnitAdaptation());
+		approximationAdaptationEClass.getESuperTypes().add(this.getPortAdaptation());
+		multiRateAdaptationEClass.getESuperTypes().add(this.getUnitAdaptation());
 		extrapolationAdaptationEClass.getESuperTypes().add(this.getApproximationAdaptation());
 		interpolationAdaptationEClass.getESuperTypes().add(this.getApproximationAdaptation());
 
@@ -1122,15 +1261,13 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 		initEClass(hierarchicalCosimUnitDeclarationEClass, HierarchicalCosimUnitDeclaration.class, "HierarchicalCosimUnitDeclaration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getHierarchicalCosimUnitDeclaration_Children(), this.getCosimUnitInstance(), null, "children", null, 0, -1, HierarchicalCosimUnitDeclaration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
-		initEClass(adaptableEClass, Adaptable.class, "Adaptable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-		initEReference(getAdaptable_Adaptation(), this.getAdaptation(), this.getAdaptation_Adaptable(), "adaptation", null, 0, 1, Adaptable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
-		initEOperation(getAdaptable__SelectedAdaptations(), this.getAdaptation(), "selectedAdaptations", 0, -1, !IS_UNIQUE, IS_ORDERED);
-
 		initEClass(cosimUnitInstanceEClass, CosimUnitInstance.class, "CosimUnitInstance", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+		initEReference(getCosimUnitInstance_Adaptation(), this.getUnitAdaptation(), this.getUnitAdaptation_Unit(), "adaptation", null, 0, 1, CosimUnitInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEReference(getCosimUnitInstance_Declaration(), this.getCosimUnitDeclaration(), null, "declaration", null, 1, 1, CosimUnitInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 		initEReference(getCosimUnitInstance_Ports(), this.getPortInstance(), this.getPortInstance_Unit(), "ports", null, 0, -1, CosimUnitInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
+		initEOperation(getCosimUnitInstance__SelectedAdaptations(), this.getUnitAdaptation(), "selectedAdaptations", 0, -1, !IS_UNIQUE, IS_ORDERED);
+
 		initEClass(portDeclarationEClass, PortDeclaration.class, "PortDeclaration", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 
 		initEClass(inputPortDeclarationEClass, InputPortDeclaration.class, "InputPortDeclaration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -1139,6 +1276,9 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 
 		initEClass(portInstanceEClass, PortInstance.class, "PortInstance", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getPortInstance_Unit(), this.getCosimUnitInstance(), this.getCosimUnitInstance_Ports(), "unit", null, 0, 1, PortInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEReference(getPortInstance_Adaptation(), this.getPortAdaptation(), this.getPortAdaptation_Port(), "adaptation", null, 0, 1, PortInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+		initEOperation(getPortInstance__SelectedAdaptations(), this.getPortAdaptation(), "selectedAdaptations", 0, -1, !IS_UNIQUE, IS_ORDERED);
 
 		initEClass(inputPortInstanceEClass, InputPortInstance.class, "InputPortInstance", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 		initEReference(getInputPortInstance_Declaration(), this.getInputPortDeclaration(), null, "declaration", null, 0, 1, InputPortInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -1154,18 +1294,34 @@ public class HintcoPackageImpl extends EPackageImpl implements HintcoPackage {
 		initEReference(getAlternative_Implies(), this.getAlternative(), null, "implies", null, 0, -1, Alternative.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
 		initEClass(adaptationEClass, Adaptation.class, "Adaptation", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-		initEReference(getAdaptation_Parent(), this.getDecompositionAdaptation(), this.getDecompositionAdaptation_Children(), "parent", null, 0, 1, Adaptation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-		initEReference(getAdaptation_Adaptable(), this.getAdaptable(), this.getAdaptable_Adaptation(), "adaptable", null, 0, 1, Adaptation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
 
-		initEOperation(getAdaptation__Adapted(), this.getAdaptable(), "adapted", 0, 1, !IS_UNIQUE, IS_ORDERED);
+		initEClass(portAdaptationEClass, PortAdaptation.class, "PortAdaptation", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+		initEReference(getPortAdaptation_Port(), this.getPortInstance(), this.getPortInstance_Adaptation(), "port", null, 0, 1, PortAdaptation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEReference(getPortAdaptation_Parent(), this.getDecompositionPortAdaptation(), this.getDecompositionPortAdaptation_Children(), "parent", null, 0, 1, PortAdaptation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+		initEOperation(getPortAdaptation__Adapted(), this.getPortInstance(), "adapted", 0, 1, !IS_UNIQUE, IS_ORDERED);
+
+		initEClass(decompositionPortAdaptationEClass, DecompositionPortAdaptation.class, "DecompositionPortAdaptation", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+		initEReference(getDecompositionPortAdaptation_Children(), this.getPortAdaptation(), this.getPortAdaptation_Parent(), "children", null, 0, -1, DecompositionPortAdaptation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEAttribute(getDecompositionPortAdaptation_Name(), theEcorePackage.getEString(), "name", null, 0, 1, DecompositionPortAdaptation.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+
+		initEOperation(getDecompositionPortAdaptation__SelectedAdaptations(), this.getPortAdaptation(), "selectedAdaptations", 0, -1, !IS_UNIQUE, IS_ORDERED);
+
+		initEClass(unitAdaptationEClass, UnitAdaptation.class, "UnitAdaptation", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+		initEReference(getUnitAdaptation_Unit(), this.getCosimUnitInstance(), this.getCosimUnitInstance_Adaptation(), "unit", null, 0, 1, UnitAdaptation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEReference(getUnitAdaptation_Parent(), this.getDecompositionUnitAdaptation(), this.getDecompositionUnitAdaptation_Children(), "parent", null, 0, 1, UnitAdaptation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+		initEOperation(getUnitAdaptation__Adapted(), this.getCosimUnitInstance(), "adapted", 0, 1, !IS_UNIQUE, IS_ORDERED);
+
+		initEClass(decompositionUnitAdaptationEClass, DecompositionUnitAdaptation.class, "DecompositionUnitAdaptation", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+		initEReference(getDecompositionUnitAdaptation_Children(), this.getUnitAdaptation(), this.getUnitAdaptation_Parent(), "children", null, 0, -1, DecompositionUnitAdaptation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+		initEAttribute(getDecompositionUnitAdaptation_Name(), theEcorePackage.getEString(), "name", null, 0, 1, DecompositionUnitAdaptation.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, IS_ORDERED);
 
-		initEClass(decompositionAdaptationEClass, DecompositionAdaptation.class, "DecompositionAdaptation", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-		initEReference(getDecompositionAdaptation_Children(), this.getAdaptation(), this.getAdaptation_Parent(), "children", null, 0, -1, DecompositionAdaptation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-		initEAttribute(getDecompositionAdaptation_Name(), theEcorePackage.getEString(), "name", null, 0, 1, DecompositionAdaptation.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, IS_DERIVED, IS_ORDERED);
+		initEOperation(getDecompositionUnitAdaptation__SelectedAdaptations(), this.getUnitAdaptation(), "selectedAdaptations", 0, -1, !IS_UNIQUE, IS_ORDERED);
 
-		initEOperation(getDecompositionAdaptation__SelectedAdaptations(), this.getAdaptation(), "selectedAdaptations", 0, -1, !IS_UNIQUE, IS_ORDERED);
+		initEClass(xorUnitAdaptationEClass, XorUnitAdaptation.class, "XorUnitAdaptation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 
-		initEClass(xorAdaptationEClass, XorAdaptation.class, "XorAdaptation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+		initEClass(xorPortAdaptationEClass, XorPortAdaptation.class, "XorPortAdaptation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 
 		initEClass(combineAdaptationEClass, CombineAdaptation.class, "CombineAdaptation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
 

+ 1 - 1
HintCO/src-gen/ua/ansymo/hintco/impl/MultiRateAdaptationImpl.java

@@ -25,7 +25,7 @@ import ua.ansymo.hintco.MultiRateAdaptation;
  *
  * @generated
  */
-public class MultiRateAdaptationImpl extends AdaptationImpl implements MultiRateAdaptation {
+public class MultiRateAdaptationImpl extends UnitAdaptationImpl implements MultiRateAdaptation {
 	/**
 	 * The default value of the '{@link #getRate() <em>Rate</em>}' attribute.
 	 * <!-- begin-user-doc -->

+ 315 - 0
HintCO/src-gen/ua/ansymo/hintco/impl/PortAdaptationImpl.java

@@ -0,0 +1,315 @@
+/**
+ */
+package ua.ansymo.hintco.impl;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import ua.ansymo.hintco.DecompositionPortAdaptation;
+import ua.ansymo.hintco.HintcoPackage;
+import ua.ansymo.hintco.PortAdaptation;
+import ua.ansymo.hintco.PortInstance;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Port Adaptation</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ *   <li>{@link ua.ansymo.hintco.impl.PortAdaptationImpl#getPort <em>Port</em>}</li>
+ *   <li>{@link ua.ansymo.hintco.impl.PortAdaptationImpl#getParent <em>Parent</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public abstract class PortAdaptationImpl extends AdaptationImpl implements PortAdaptation {
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected PortAdaptationImpl() {
+		super();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected EClass eStaticClass() {
+		return HintcoPackage.Literals.PORT_ADAPTATION;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public PortInstance getPort() {
+		if (eContainerFeatureID() != HintcoPackage.PORT_ADAPTATION__PORT) return null;
+		return (PortInstance)eContainer();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public PortInstance basicGetPort() {
+		if (eContainerFeatureID() != HintcoPackage.PORT_ADAPTATION__PORT) return null;
+		return (PortInstance)eInternalContainer();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetPort(PortInstance newPort, NotificationChain msgs) {
+		msgs = eBasicSetContainer((InternalEObject)newPort, HintcoPackage.PORT_ADAPTATION__PORT, msgs);
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setPort(PortInstance newPort) {
+		if (newPort != eInternalContainer() || (eContainerFeatureID() != HintcoPackage.PORT_ADAPTATION__PORT && newPort != null)) {
+			if (EcoreUtil.isAncestor(this, newPort))
+				throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+			NotificationChain msgs = null;
+			if (eInternalContainer() != null)
+				msgs = eBasicRemoveFromContainer(msgs);
+			if (newPort != null)
+				msgs = ((InternalEObject)newPort).eInverseAdd(this, HintcoPackage.PORT_INSTANCE__ADAPTATION, PortInstance.class, msgs);
+			msgs = basicSetPort(newPort, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, HintcoPackage.PORT_ADAPTATION__PORT, newPort, newPort));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public DecompositionPortAdaptation getParent() {
+		if (eContainerFeatureID() != HintcoPackage.PORT_ADAPTATION__PARENT) return null;
+		return (DecompositionPortAdaptation)eContainer();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public DecompositionPortAdaptation basicGetParent() {
+		if (eContainerFeatureID() != HintcoPackage.PORT_ADAPTATION__PARENT) return null;
+		return (DecompositionPortAdaptation)eInternalContainer();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetParent(DecompositionPortAdaptation newParent, NotificationChain msgs) {
+		msgs = eBasicSetContainer((InternalEObject)newParent, HintcoPackage.PORT_ADAPTATION__PARENT, msgs);
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setParent(DecompositionPortAdaptation newParent) {
+		if (newParent != eInternalContainer() || (eContainerFeatureID() != HintcoPackage.PORT_ADAPTATION__PARENT && newParent != null)) {
+			if (EcoreUtil.isAncestor(this, newParent))
+				throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+			NotificationChain msgs = null;
+			if (eInternalContainer() != null)
+				msgs = eBasicRemoveFromContainer(msgs);
+			if (newParent != null)
+				msgs = ((InternalEObject)newParent).eInverseAdd(this, HintcoPackage.DECOMPOSITION_PORT_ADAPTATION__CHILDREN, DecompositionPortAdaptation.class, msgs);
+			msgs = basicSetParent(newParent, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, HintcoPackage.PORT_ADAPTATION__PARENT, newParent, newParent));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public PortInstance adapted() {
+		PortInstance _port = this.getPort();
+		boolean _tripleNotEquals = (_port != null);
+		if (_tripleNotEquals) {
+			return this.getPort();
+		}
+		DecompositionPortAdaptation _parent = this.getParent();
+		boolean _tripleEquals = (_parent == null);
+		if (_tripleEquals) {
+			return null;
+		}
+		return this.getParent().adapted();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+		switch (featureID) {
+			case HintcoPackage.PORT_ADAPTATION__PORT:
+				if (eInternalContainer() != null)
+					msgs = eBasicRemoveFromContainer(msgs);
+				return basicSetPort((PortInstance)otherEnd, msgs);
+			case HintcoPackage.PORT_ADAPTATION__PARENT:
+				if (eInternalContainer() != null)
+					msgs = eBasicRemoveFromContainer(msgs);
+				return basicSetParent((DecompositionPortAdaptation)otherEnd, msgs);
+		}
+		return super.eInverseAdd(otherEnd, featureID, msgs);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+		switch (featureID) {
+			case HintcoPackage.PORT_ADAPTATION__PORT:
+				return basicSetPort(null, msgs);
+			case HintcoPackage.PORT_ADAPTATION__PARENT:
+				return basicSetParent(null, msgs);
+		}
+		return super.eInverseRemove(otherEnd, featureID, msgs);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
+		switch (eContainerFeatureID()) {
+			case HintcoPackage.PORT_ADAPTATION__PORT:
+				return eInternalContainer().eInverseRemove(this, HintcoPackage.PORT_INSTANCE__ADAPTATION, PortInstance.class, msgs);
+			case HintcoPackage.PORT_ADAPTATION__PARENT:
+				return eInternalContainer().eInverseRemove(this, HintcoPackage.DECOMPOSITION_PORT_ADAPTATION__CHILDREN, DecompositionPortAdaptation.class, msgs);
+		}
+		return super.eBasicRemoveFromContainerFeature(msgs);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object eGet(int featureID, boolean resolve, boolean coreType) {
+		switch (featureID) {
+			case HintcoPackage.PORT_ADAPTATION__PORT:
+				if (resolve) return getPort();
+				return basicGetPort();
+			case HintcoPackage.PORT_ADAPTATION__PARENT:
+				if (resolve) return getParent();
+				return basicGetParent();
+		}
+		return super.eGet(featureID, resolve, coreType);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eSet(int featureID, Object newValue) {
+		switch (featureID) {
+			case HintcoPackage.PORT_ADAPTATION__PORT:
+				setPort((PortInstance)newValue);
+				return;
+			case HintcoPackage.PORT_ADAPTATION__PARENT:
+				setParent((DecompositionPortAdaptation)newValue);
+				return;
+		}
+		super.eSet(featureID, newValue);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eUnset(int featureID) {
+		switch (featureID) {
+			case HintcoPackage.PORT_ADAPTATION__PORT:
+				setPort((PortInstance)null);
+				return;
+			case HintcoPackage.PORT_ADAPTATION__PARENT:
+				setParent((DecompositionPortAdaptation)null);
+				return;
+		}
+		super.eUnset(featureID);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public boolean eIsSet(int featureID) {
+		switch (featureID) {
+			case HintcoPackage.PORT_ADAPTATION__PORT:
+				return basicGetPort() != null;
+			case HintcoPackage.PORT_ADAPTATION__PARENT:
+				return basicGetParent() != null;
+		}
+		return super.eIsSet(featureID);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
+		switch (operationID) {
+			case HintcoPackage.PORT_ADAPTATION___ADAPTED:
+				return adapted();
+		}
+		return super.eInvoke(operationID, arguments);
+	}
+
+} //PortAdaptationImpl

+ 70 - 104
HintCO/src-gen/ua/ansymo/hintco/impl/PortInstanceImpl.java

@@ -17,12 +17,11 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
 
 import org.eclipse.emf.ecore.util.EcoreUtil;
 
-import ua.ansymo.hintco.Adaptable;
-import ua.ansymo.hintco.Adaptation;
 import ua.ansymo.hintco.CosimUnitInstance;
-import ua.ansymo.hintco.DecompositionAdaptation;
+import ua.ansymo.hintco.DecompositionPortAdaptation;
 import ua.ansymo.hintco.HintcoPackage;
 import ua.ansymo.hintco.IDed;
+import ua.ansymo.hintco.PortAdaptation;
 import ua.ansymo.hintco.PortInstance;
 
 /**
@@ -34,8 +33,8 @@ import ua.ansymo.hintco.PortInstance;
  * </p>
  * <ul>
  *   <li>{@link ua.ansymo.hintco.impl.PortInstanceImpl#getIdentifier <em>Identifier</em>}</li>
- *   <li>{@link ua.ansymo.hintco.impl.PortInstanceImpl#getAdaptation <em>Adaptation</em>}</li>
  *   <li>{@link ua.ansymo.hintco.impl.PortInstanceImpl#getUnit <em>Unit</em>}</li>
+ *   <li>{@link ua.ansymo.hintco.impl.PortInstanceImpl#getAdaptation <em>Adaptation</em>}</li>
  * </ul>
  *
  * @generated
@@ -69,7 +68,7 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 	 * @generated
 	 * @ordered
 	 */
-	protected Adaptation adaptation;
+	protected PortAdaptation adaptation;
 
 	/**
 	 * <!-- begin-user-doc -->
@@ -116,8 +115,9 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public Adaptation getAdaptation() {
-		return adaptation;
+	public CosimUnitInstance getUnit() {
+		if (eContainerFeatureID() != HintcoPackage.PORT_INSTANCE__UNIT) return null;
+		return (CosimUnitInstance)eContainer();
 	}
 
 	/**
@@ -125,14 +125,9 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public NotificationChain basicSetAdaptation(Adaptation newAdaptation, NotificationChain msgs) {
-		Adaptation oldAdaptation = adaptation;
-		adaptation = newAdaptation;
-		if (eNotificationRequired()) {
-			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, HintcoPackage.PORT_INSTANCE__ADAPTATION, oldAdaptation, newAdaptation);
-			if (msgs == null) msgs = notification; else msgs.add(notification);
-		}
-		return msgs;
+	public CosimUnitInstance basicGetUnit() {
+		if (eContainerFeatureID() != HintcoPackage.PORT_INSTANCE__UNIT) return null;
+		return (CosimUnitInstance)eInternalContainer();
 	}
 
 	/**
@@ -140,18 +135,9 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public void setAdaptation(Adaptation newAdaptation) {
-		if (newAdaptation != adaptation) {
-			NotificationChain msgs = null;
-			if (adaptation != null)
-				msgs = ((InternalEObject)adaptation).eInverseRemove(this, HintcoPackage.ADAPTATION__ADAPTABLE, Adaptation.class, msgs);
-			if (newAdaptation != null)
-				msgs = ((InternalEObject)newAdaptation).eInverseAdd(this, HintcoPackage.ADAPTATION__ADAPTABLE, Adaptation.class, msgs);
-			msgs = basicSetAdaptation(newAdaptation, msgs);
-			if (msgs != null) msgs.dispatch();
-		}
-		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, HintcoPackage.PORT_INSTANCE__ADAPTATION, newAdaptation, newAdaptation));
+	public NotificationChain basicSetUnit(CosimUnitInstance newUnit, NotificationChain msgs) {
+		msgs = eBasicSetContainer((InternalEObject)newUnit, HintcoPackage.PORT_INSTANCE__UNIT, msgs);
+		return msgs;
 	}
 
 	/**
@@ -159,9 +145,20 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public CosimUnitInstance getUnit() {
-		if (eContainerFeatureID() != HintcoPackage.PORT_INSTANCE__UNIT) return null;
-		return (CosimUnitInstance)eContainer();
+	public void setUnit(CosimUnitInstance newUnit) {
+		if (newUnit != eInternalContainer() || (eContainerFeatureID() != HintcoPackage.PORT_INSTANCE__UNIT && newUnit != null)) {
+			if (EcoreUtil.isAncestor(this, newUnit))
+				throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+			NotificationChain msgs = null;
+			if (eInternalContainer() != null)
+				msgs = eBasicRemoveFromContainer(msgs);
+			if (newUnit != null)
+				msgs = ((InternalEObject)newUnit).eInverseAdd(this, HintcoPackage.COSIM_UNIT_INSTANCE__PORTS, CosimUnitInstance.class, msgs);
+			msgs = basicSetUnit(newUnit, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, HintcoPackage.PORT_INSTANCE__UNIT, newUnit, newUnit));
 	}
 
 	/**
@@ -169,9 +166,8 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public CosimUnitInstance basicGetUnit() {
-		if (eContainerFeatureID() != HintcoPackage.PORT_INSTANCE__UNIT) return null;
-		return (CosimUnitInstance)eInternalContainer();
+	public PortAdaptation getAdaptation() {
+		return adaptation;
 	}
 
 	/**
@@ -179,8 +175,13 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public NotificationChain basicSetUnit(CosimUnitInstance newUnit, NotificationChain msgs) {
-		msgs = eBasicSetContainer((InternalEObject)newUnit, HintcoPackage.PORT_INSTANCE__UNIT, msgs);
+	public NotificationChain basicSetAdaptation(PortAdaptation newAdaptation, NotificationChain msgs) {
+		PortAdaptation oldAdaptation = adaptation;
+		adaptation = newAdaptation;
+		if (eNotificationRequired()) {
+			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, HintcoPackage.PORT_INSTANCE__ADAPTATION, oldAdaptation, newAdaptation);
+			if (msgs == null) msgs = notification; else msgs.add(notification);
+		}
 		return msgs;
 	}
 
@@ -189,20 +190,18 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public void setUnit(CosimUnitInstance newUnit) {
-		if (newUnit != eInternalContainer() || (eContainerFeatureID() != HintcoPackage.PORT_INSTANCE__UNIT && newUnit != null)) {
-			if (EcoreUtil.isAncestor(this, newUnit))
-				throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+	public void setAdaptation(PortAdaptation newAdaptation) {
+		if (newAdaptation != adaptation) {
 			NotificationChain msgs = null;
-			if (eInternalContainer() != null)
-				msgs = eBasicRemoveFromContainer(msgs);
-			if (newUnit != null)
-				msgs = ((InternalEObject)newUnit).eInverseAdd(this, HintcoPackage.COSIM_UNIT_INSTANCE__PORTS, CosimUnitInstance.class, msgs);
-			msgs = basicSetUnit(newUnit, msgs);
+			if (adaptation != null)
+				msgs = ((InternalEObject)adaptation).eInverseRemove(this, HintcoPackage.PORT_ADAPTATION__PORT, PortAdaptation.class, msgs);
+			if (newAdaptation != null)
+				msgs = ((InternalEObject)newAdaptation).eInverseAdd(this, HintcoPackage.PORT_ADAPTATION__PORT, PortAdaptation.class, msgs);
+			msgs = basicSetAdaptation(newAdaptation, msgs);
 			if (msgs != null) msgs.dispatch();
 		}
 		else if (eNotificationRequired())
-			eNotify(new ENotificationImpl(this, Notification.SET, HintcoPackage.PORT_INSTANCE__UNIT, newUnit, newUnit));
+			eNotify(new ENotificationImpl(this, Notification.SET, HintcoPackage.PORT_INSTANCE__ADAPTATION, newAdaptation, newAdaptation));
 	}
 
 	/**
@@ -210,23 +209,23 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	public EList<Adaptation> selectedAdaptations() {
-		Adaptation _adaptation = this.getAdaptation();
+	public EList<PortAdaptation> selectedAdaptations() {
+		PortAdaptation _adaptation = this.getAdaptation();
 		boolean _tripleEquals = (_adaptation == null);
 		if (_tripleEquals) {
-			return new BasicEList<Adaptation>(java.util.Collections.<Adaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<Adaptation>newArrayList()));
+			return new BasicEList<PortAdaptation>(java.util.Collections.<PortAdaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<PortAdaptation>newArrayList()));
 		}
 		boolean _isSelected = this.getAdaptation().isSelected();
 		if (_isSelected) {
-			Adaptation _adaptation_1 = this.getAdaptation();
-			if ((_adaptation_1 instanceof DecompositionAdaptation)) {
-				Adaptation _adaptation_2 = this.getAdaptation();
-				return ((DecompositionAdaptation) _adaptation_2).selectedAdaptations();
+			PortAdaptation _adaptation_1 = this.getAdaptation();
+			if ((_adaptation_1 instanceof DecompositionPortAdaptation)) {
+				PortAdaptation _adaptation_2 = this.getAdaptation();
+				return ((DecompositionPortAdaptation) _adaptation_2).selectedAdaptations();
 			}
-			Adaptation _adaptation_3 = this.getAdaptation();
-			return new BasicEList<Adaptation>(java.util.Collections.<Adaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<Adaptation>newArrayList(_adaptation_3)));
+			PortAdaptation _adaptation_3 = this.getAdaptation();
+			return new BasicEList<PortAdaptation>(java.util.Collections.<PortAdaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<PortAdaptation>newArrayList(_adaptation_3)));
 		}
-		return new BasicEList<Adaptation>(java.util.Collections.<Adaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<Adaptation>newArrayList()));
+		return new BasicEList<PortAdaptation>(java.util.Collections.<PortAdaptation>unmodifiableList(org.eclipse.xtext.xbase.lib.CollectionLiterals.<PortAdaptation>newArrayList()));
 	}
 
 	/**
@@ -237,14 +236,14 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 	@Override
 	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
 		switch (featureID) {
-			case HintcoPackage.PORT_INSTANCE__ADAPTATION:
-				if (adaptation != null)
-					msgs = ((InternalEObject)adaptation).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - HintcoPackage.PORT_INSTANCE__ADAPTATION, null, msgs);
-				return basicSetAdaptation((Adaptation)otherEnd, msgs);
 			case HintcoPackage.PORT_INSTANCE__UNIT:
 				if (eInternalContainer() != null)
 					msgs = eBasicRemoveFromContainer(msgs);
 				return basicSetUnit((CosimUnitInstance)otherEnd, msgs);
+			case HintcoPackage.PORT_INSTANCE__ADAPTATION:
+				if (adaptation != null)
+					msgs = ((InternalEObject)adaptation).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - HintcoPackage.PORT_INSTANCE__ADAPTATION, null, msgs);
+				return basicSetAdaptation((PortAdaptation)otherEnd, msgs);
 		}
 		return super.eInverseAdd(otherEnd, featureID, msgs);
 	}
@@ -257,10 +256,10 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 	@Override
 	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
 		switch (featureID) {
-			case HintcoPackage.PORT_INSTANCE__ADAPTATION:
-				return basicSetAdaptation(null, msgs);
 			case HintcoPackage.PORT_INSTANCE__UNIT:
 				return basicSetUnit(null, msgs);
+			case HintcoPackage.PORT_INSTANCE__ADAPTATION:
+				return basicSetAdaptation(null, msgs);
 		}
 		return super.eInverseRemove(otherEnd, featureID, msgs);
 	}
@@ -289,11 +288,11 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 		switch (featureID) {
 			case HintcoPackage.PORT_INSTANCE__IDENTIFIER:
 				return getIdentifier();
-			case HintcoPackage.PORT_INSTANCE__ADAPTATION:
-				return getAdaptation();
 			case HintcoPackage.PORT_INSTANCE__UNIT:
 				if (resolve) return getUnit();
 				return basicGetUnit();
+			case HintcoPackage.PORT_INSTANCE__ADAPTATION:
+				return getAdaptation();
 		}
 		return super.eGet(featureID, resolve, coreType);
 	}
@@ -309,12 +308,12 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 			case HintcoPackage.PORT_INSTANCE__IDENTIFIER:
 				setIdentifier((String)newValue);
 				return;
-			case HintcoPackage.PORT_INSTANCE__ADAPTATION:
-				setAdaptation((Adaptation)newValue);
-				return;
 			case HintcoPackage.PORT_INSTANCE__UNIT:
 				setUnit((CosimUnitInstance)newValue);
 				return;
+			case HintcoPackage.PORT_INSTANCE__ADAPTATION:
+				setAdaptation((PortAdaptation)newValue);
+				return;
 		}
 		super.eSet(featureID, newValue);
 	}
@@ -330,12 +329,12 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 			case HintcoPackage.PORT_INSTANCE__IDENTIFIER:
 				setIdentifier(IDENTIFIER_EDEFAULT);
 				return;
-			case HintcoPackage.PORT_INSTANCE__ADAPTATION:
-				setAdaptation((Adaptation)null);
-				return;
 			case HintcoPackage.PORT_INSTANCE__UNIT:
 				setUnit((CosimUnitInstance)null);
 				return;
+			case HintcoPackage.PORT_INSTANCE__ADAPTATION:
+				setAdaptation((PortAdaptation)null);
+				return;
 		}
 		super.eUnset(featureID);
 	}
@@ -350,10 +349,10 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 		switch (featureID) {
 			case HintcoPackage.PORT_INSTANCE__IDENTIFIER:
 				return IDENTIFIER_EDEFAULT == null ? identifier != null : !IDENTIFIER_EDEFAULT.equals(identifier);
-			case HintcoPackage.PORT_INSTANCE__ADAPTATION:
-				return adaptation != null;
 			case HintcoPackage.PORT_INSTANCE__UNIT:
 				return basicGetUnit() != null;
+			case HintcoPackage.PORT_INSTANCE__ADAPTATION:
+				return adaptation != null;
 		}
 		return super.eIsSet(featureID);
 	}
@@ -371,12 +370,6 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 				default: return -1;
 			}
 		}
-		if (baseClass == Adaptable.class) {
-			switch (derivedFeatureID) {
-				case HintcoPackage.PORT_INSTANCE__ADAPTATION: return HintcoPackage.ADAPTABLE__ADAPTATION;
-				default: return -1;
-			}
-		}
 		return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
 	}
 
@@ -393,36 +386,9 @@ public abstract class PortInstanceImpl extends PrecendenceNodeImpl implements Po
 				default: return -1;
 			}
 		}
-		if (baseClass == Adaptable.class) {
-			switch (baseFeatureID) {
-				case HintcoPackage.ADAPTABLE__ADAPTATION: return HintcoPackage.PORT_INSTANCE__ADAPTATION;
-				default: return -1;
-			}
-		}
 		return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
 	}
 
-	/**
-	 * <!-- begin-user-doc -->
-	 * <!-- end-user-doc -->
-	 * @generated
-	 */
-	@Override
-	public int eDerivedOperationID(int baseOperationID, Class<?> baseClass) {
-		if (baseClass == IDed.class) {
-			switch (baseOperationID) {
-				default: return -1;
-			}
-		}
-		if (baseClass == Adaptable.class) {
-			switch (baseOperationID) {
-				case HintcoPackage.ADAPTABLE___SELECTED_ADAPTATIONS: return HintcoPackage.PORT_INSTANCE___SELECTED_ADAPTATIONS;
-				default: return -1;
-			}
-		}
-		return super.eDerivedOperationID(baseOperationID, baseClass);
-	}
-
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->

+ 315 - 0
HintCO/src-gen/ua/ansymo/hintco/impl/UnitAdaptationImpl.java

@@ -0,0 +1,315 @@
+/**
+ */
+package ua.ansymo.hintco.impl;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+
+import org.eclipse.emf.common.util.EList;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import ua.ansymo.hintco.CosimUnitInstance;
+import ua.ansymo.hintco.DecompositionUnitAdaptation;
+import ua.ansymo.hintco.HintcoPackage;
+import ua.ansymo.hintco.UnitAdaptation;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Unit Adaptation</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * </p>
+ * <ul>
+ *   <li>{@link ua.ansymo.hintco.impl.UnitAdaptationImpl#getUnit <em>Unit</em>}</li>
+ *   <li>{@link ua.ansymo.hintco.impl.UnitAdaptationImpl#getParent <em>Parent</em>}</li>
+ * </ul>
+ *
+ * @generated
+ */
+public abstract class UnitAdaptationImpl extends AdaptationImpl implements UnitAdaptation {
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected UnitAdaptationImpl() {
+		super();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected EClass eStaticClass() {
+		return HintcoPackage.Literals.UNIT_ADAPTATION;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public CosimUnitInstance getUnit() {
+		if (eContainerFeatureID() != HintcoPackage.UNIT_ADAPTATION__UNIT) return null;
+		return (CosimUnitInstance)eContainer();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public CosimUnitInstance basicGetUnit() {
+		if (eContainerFeatureID() != HintcoPackage.UNIT_ADAPTATION__UNIT) return null;
+		return (CosimUnitInstance)eInternalContainer();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetUnit(CosimUnitInstance newUnit, NotificationChain msgs) {
+		msgs = eBasicSetContainer((InternalEObject)newUnit, HintcoPackage.UNIT_ADAPTATION__UNIT, msgs);
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setUnit(CosimUnitInstance newUnit) {
+		if (newUnit != eInternalContainer() || (eContainerFeatureID() != HintcoPackage.UNIT_ADAPTATION__UNIT && newUnit != null)) {
+			if (EcoreUtil.isAncestor(this, newUnit))
+				throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+			NotificationChain msgs = null;
+			if (eInternalContainer() != null)
+				msgs = eBasicRemoveFromContainer(msgs);
+			if (newUnit != null)
+				msgs = ((InternalEObject)newUnit).eInverseAdd(this, HintcoPackage.COSIM_UNIT_INSTANCE__ADAPTATION, CosimUnitInstance.class, msgs);
+			msgs = basicSetUnit(newUnit, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, HintcoPackage.UNIT_ADAPTATION__UNIT, newUnit, newUnit));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public DecompositionUnitAdaptation getParent() {
+		if (eContainerFeatureID() != HintcoPackage.UNIT_ADAPTATION__PARENT) return null;
+		return (DecompositionUnitAdaptation)eContainer();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public DecompositionUnitAdaptation basicGetParent() {
+		if (eContainerFeatureID() != HintcoPackage.UNIT_ADAPTATION__PARENT) return null;
+		return (DecompositionUnitAdaptation)eInternalContainer();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public NotificationChain basicSetParent(DecompositionUnitAdaptation newParent, NotificationChain msgs) {
+		msgs = eBasicSetContainer((InternalEObject)newParent, HintcoPackage.UNIT_ADAPTATION__PARENT, msgs);
+		return msgs;
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public void setParent(DecompositionUnitAdaptation newParent) {
+		if (newParent != eInternalContainer() || (eContainerFeatureID() != HintcoPackage.UNIT_ADAPTATION__PARENT && newParent != null)) {
+			if (EcoreUtil.isAncestor(this, newParent))
+				throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+			NotificationChain msgs = null;
+			if (eInternalContainer() != null)
+				msgs = eBasicRemoveFromContainer(msgs);
+			if (newParent != null)
+				msgs = ((InternalEObject)newParent).eInverseAdd(this, HintcoPackage.DECOMPOSITION_UNIT_ADAPTATION__CHILDREN, DecompositionUnitAdaptation.class, msgs);
+			msgs = basicSetParent(newParent, msgs);
+			if (msgs != null) msgs.dispatch();
+		}
+		else if (eNotificationRequired())
+			eNotify(new ENotificationImpl(this, Notification.SET, HintcoPackage.UNIT_ADAPTATION__PARENT, newParent, newParent));
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	public CosimUnitInstance adapted() {
+		CosimUnitInstance _unit = this.getUnit();
+		boolean _tripleNotEquals = (_unit != null);
+		if (_tripleNotEquals) {
+			return this.getUnit();
+		}
+		DecompositionUnitAdaptation _parent = this.getParent();
+		boolean _tripleEquals = (_parent == null);
+		if (_tripleEquals) {
+			return null;
+		}
+		return this.getParent().adapted();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+		switch (featureID) {
+			case HintcoPackage.UNIT_ADAPTATION__UNIT:
+				if (eInternalContainer() != null)
+					msgs = eBasicRemoveFromContainer(msgs);
+				return basicSetUnit((CosimUnitInstance)otherEnd, msgs);
+			case HintcoPackage.UNIT_ADAPTATION__PARENT:
+				if (eInternalContainer() != null)
+					msgs = eBasicRemoveFromContainer(msgs);
+				return basicSetParent((DecompositionUnitAdaptation)otherEnd, msgs);
+		}
+		return super.eInverseAdd(otherEnd, featureID, msgs);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+		switch (featureID) {
+			case HintcoPackage.UNIT_ADAPTATION__UNIT:
+				return basicSetUnit(null, msgs);
+			case HintcoPackage.UNIT_ADAPTATION__PARENT:
+				return basicSetParent(null, msgs);
+		}
+		return super.eInverseRemove(otherEnd, featureID, msgs);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
+		switch (eContainerFeatureID()) {
+			case HintcoPackage.UNIT_ADAPTATION__UNIT:
+				return eInternalContainer().eInverseRemove(this, HintcoPackage.COSIM_UNIT_INSTANCE__ADAPTATION, CosimUnitInstance.class, msgs);
+			case HintcoPackage.UNIT_ADAPTATION__PARENT:
+				return eInternalContainer().eInverseRemove(this, HintcoPackage.DECOMPOSITION_UNIT_ADAPTATION__CHILDREN, DecompositionUnitAdaptation.class, msgs);
+		}
+		return super.eBasicRemoveFromContainerFeature(msgs);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object eGet(int featureID, boolean resolve, boolean coreType) {
+		switch (featureID) {
+			case HintcoPackage.UNIT_ADAPTATION__UNIT:
+				if (resolve) return getUnit();
+				return basicGetUnit();
+			case HintcoPackage.UNIT_ADAPTATION__PARENT:
+				if (resolve) return getParent();
+				return basicGetParent();
+		}
+		return super.eGet(featureID, resolve, coreType);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eSet(int featureID, Object newValue) {
+		switch (featureID) {
+			case HintcoPackage.UNIT_ADAPTATION__UNIT:
+				setUnit((CosimUnitInstance)newValue);
+				return;
+			case HintcoPackage.UNIT_ADAPTATION__PARENT:
+				setParent((DecompositionUnitAdaptation)newValue);
+				return;
+		}
+		super.eSet(featureID, newValue);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public void eUnset(int featureID) {
+		switch (featureID) {
+			case HintcoPackage.UNIT_ADAPTATION__UNIT:
+				setUnit((CosimUnitInstance)null);
+				return;
+			case HintcoPackage.UNIT_ADAPTATION__PARENT:
+				setParent((DecompositionUnitAdaptation)null);
+				return;
+		}
+		super.eUnset(featureID);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public boolean eIsSet(int featureID) {
+		switch (featureID) {
+			case HintcoPackage.UNIT_ADAPTATION__UNIT:
+				return basicGetUnit() != null;
+			case HintcoPackage.UNIT_ADAPTATION__PARENT:
+				return basicGetParent() != null;
+		}
+		return super.eIsSet(featureID);
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
+		switch (operationID) {
+			case HintcoPackage.UNIT_ADAPTATION___ADAPTED:
+				return adapted();
+		}
+		return super.eInvoke(operationID, arguments);
+	}
+
+} //UnitAdaptationImpl

+ 21 - 10
HintCO/src-gen/ua/ansymo/hintco/impl/VariantDiagramImpl.java

@@ -21,7 +21,8 @@ import ua.ansymo.hintco.ExtrapolationAdaptation;
 import ua.ansymo.hintco.HintcoPackage;
 import ua.ansymo.hintco.InterpolationAdaptation;
 import ua.ansymo.hintco.VariantDiagram;
-import ua.ansymo.hintco.XorAdaptation;
+import ua.ansymo.hintco.XorPortAdaptation;
+import ua.ansymo.hintco.XorUnitAdaptation;
 
 /**
  * <!-- begin-user-doc -->
@@ -162,29 +163,39 @@ public class VariantDiagramImpl extends IDedImpl implements VariantDiagram {
 				else {
 					String _xifexpression_2 = null;
 					Alternative _alternative_3 = this.getAlternative();
-					if ((_alternative_3 instanceof XorAdaptation)) {
+					if ((_alternative_3 instanceof XorPortAdaptation)) {
 						Alternative _alternative_4 = this.getAlternative();
-						String _name_1 = ((XorAdaptation) _alternative_4).getName();
+						String _name_1 = ((XorPortAdaptation) _alternative_4).getName();
 						_xifexpression_2 = ((prefix + "xor ") + _name_1);
 					}
 					else {
 						String _xifexpression_3 = null;
 						Alternative _alternative_5 = this.getAlternative();
-						if ((_alternative_5 instanceof ExtrapolationAdaptation)) {
+						if ((_alternative_5 instanceof XorUnitAdaptation)) {
 							Alternative _alternative_6 = this.getAlternative();
-							String _name_2 = ((ExtrapolationAdaptation) _alternative_6).getName();
-							_xifexpression_3 = ((prefix + "extra ") + _name_2);
+							String _name_2 = ((XorUnitAdaptation) _alternative_6).getName();
+							_xifexpression_3 = ((prefix + "xor ") + _name_2);
 						}
 						else {
 							String _xifexpression_4 = null;
 							Alternative _alternative_7 = this.getAlternative();
-							if ((_alternative_7 instanceof InterpolationAdaptation)) {
+							if ((_alternative_7 instanceof ExtrapolationAdaptation)) {
 								Alternative _alternative_8 = this.getAlternative();
-								String _name_3 = ((InterpolationAdaptation) _alternative_8).getName();
-								_xifexpression_4 = ((prefix + "intra ") + _name_3);
+								String _name_3 = ((ExtrapolationAdaptation) _alternative_8).getName();
+								_xifexpression_4 = ((prefix + "extra ") + _name_3);
 							}
 							else {
-								_xifexpression_4 = (prefix + "implement");
+								String _xifexpression_5 = null;
+								Alternative _alternative_9 = this.getAlternative();
+								if ((_alternative_9 instanceof InterpolationAdaptation)) {
+									Alternative _alternative_10 = this.getAlternative();
+									String _name_4 = ((InterpolationAdaptation) _alternative_10).getName();
+									_xifexpression_5 = ((prefix + "intra ") + _name_4);
+								}
+								else {
+									_xifexpression_5 = (prefix + "implement");
+								}
+								_xifexpression_4 = _xifexpression_5;
 							}
 							_xifexpression_3 = _xifexpression_4;
 						}

+ 6 - 6
HintCO/src-gen/ua/ansymo/hintco/impl/XorAdaptationImpl.java

@@ -5,22 +5,22 @@ package ua.ansymo.hintco.impl;
 import org.eclipse.emf.ecore.EClass;
 
 import ua.ansymo.hintco.HintcoPackage;
-import ua.ansymo.hintco.XorAdaptation;
+import ua.ansymo.hintco.XorPortAdaptation;
 
 /**
  * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Xor Adaptation</b></em>'.
+ * An implementation of the model object '<em><b>Xor Port Adaptation</b></em>'.
  * <!-- end-user-doc -->
  *
  * @generated
  */
-public class XorAdaptationImpl extends DecompositionAdaptationImpl implements XorAdaptation {
+public class XorPortAdaptationImpl extends DecompositionPortAdaptationImpl implements XorPortAdaptation {
 	/**
 	 * <!-- begin-user-doc -->
 	 * <!-- end-user-doc -->
 	 * @generated
 	 */
-	protected XorAdaptationImpl() {
+	protected XorPortAdaptationImpl() {
 		super();
 	}
 
@@ -31,7 +31,7 @@ public class XorAdaptationImpl extends DecompositionAdaptationImpl implements Xo
 	 */
 	@Override
 	protected EClass eStaticClass() {
-		return HintcoPackage.Literals.XOR_ADAPTATION;
+		return HintcoPackage.Literals.XOR_PORT_ADAPTATION;
 	}
 
-} //XorAdaptationImpl
+} //XorPortAdaptationImpl

+ 37 - 0
HintCO/src-gen/ua/ansymo/hintco/impl/XorUnitAdaptationImpl.java

@@ -0,0 +1,37 @@
+/**
+ */
+package ua.ansymo.hintco.impl;
+
+import org.eclipse.emf.ecore.EClass;
+
+import ua.ansymo.hintco.HintcoPackage;
+import ua.ansymo.hintco.XorUnitAdaptation;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Xor Unit Adaptation</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * @generated
+ */
+public class XorUnitAdaptationImpl extends DecompositionUnitAdaptationImpl implements XorUnitAdaptation {
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	protected XorUnitAdaptationImpl() {
+		super();
+	}
+
+	/**
+	 * <!-- begin-user-doc -->
+	 * <!-- end-user-doc -->
+	 * @generated
+	 */
+	@Override
+	protected EClass eStaticClass() {
+		return HintcoPackage.Literals.XOR_UNIT_ADAPTATION;
+	}
+
+} //XorUnitAdaptationImpl

+ 82 - 28
HintCO/src-gen/ua/ansymo/hintco/util/HintcoAdapterFactory.java

@@ -96,10 +96,6 @@ public class HintcoAdapterFactory extends AdapterFactoryImpl {
 				return createHierarchicalCosimUnitDeclarationAdapter();
 			}
 			@Override
-			public Adapter caseAdaptable(Adaptable object) {
-				return createAdaptableAdapter();
-			}
-			@Override
 			public Adapter caseCosimUnitInstance(CosimUnitInstance object) {
 				return createCosimUnitInstanceAdapter();
 			}
@@ -136,12 +132,28 @@ public class HintcoAdapterFactory extends AdapterFactoryImpl {
 				return createAdaptationAdapter();
 			}
 			@Override
-			public Adapter caseDecompositionAdaptation(DecompositionAdaptation object) {
-				return createDecompositionAdaptationAdapter();
+			public Adapter casePortAdaptation(PortAdaptation object) {
+				return createPortAdaptationAdapter();
 			}
 			@Override
-			public Adapter caseXorAdaptation(XorAdaptation object) {
-				return createXorAdaptationAdapter();
+			public Adapter caseDecompositionPortAdaptation(DecompositionPortAdaptation object) {
+				return createDecompositionPortAdaptationAdapter();
+			}
+			@Override
+			public Adapter caseUnitAdaptation(UnitAdaptation object) {
+				return createUnitAdaptationAdapter();
+			}
+			@Override
+			public Adapter caseDecompositionUnitAdaptation(DecompositionUnitAdaptation object) {
+				return createDecompositionUnitAdaptationAdapter();
+			}
+			@Override
+			public Adapter caseXorUnitAdaptation(XorUnitAdaptation object) {
+				return createXorUnitAdaptationAdapter();
+			}
+			@Override
+			public Adapter caseXorPortAdaptation(XorPortAdaptation object) {
+				return createXorPortAdaptationAdapter();
 			}
 			@Override
 			public Adapter caseCombineAdaptation(CombineAdaptation object) {
@@ -281,20 +293,6 @@ public class HintcoAdapterFactory extends AdapterFactoryImpl {
 		return null;
 	}
 
-	/**
-	 * Creates a new adapter for an object of class '{@link ua.ansymo.hintco.Adaptable <em>Adaptable</em>}'.
-	 * <!-- begin-user-doc -->
-	 * This default implementation returns null so that we can easily ignore cases;
-	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
-	 * <!-- end-user-doc -->
-	 * @return the new adapter.
-	 * @see ua.ansymo.hintco.Adaptable
-	 * @generated
-	 */
-	public Adapter createAdaptableAdapter() {
-		return null;
-	}
-
 	/**
 	 * Creates a new adapter for an object of class '{@link ua.ansymo.hintco.CosimUnitInstance <em>Cosim Unit Instance</em>}'.
 	 * <!-- begin-user-doc -->
@@ -422,30 +420,86 @@ public class HintcoAdapterFactory extends AdapterFactoryImpl {
 	}
 
 	/**
-	 * Creates a new adapter for an object of class '{@link ua.ansymo.hintco.DecompositionAdaptation <em>Decomposition Adaptation</em>}'.
+	 * Creates a new adapter for an object of class '{@link ua.ansymo.hintco.PortAdaptation <em>Port Adaptation</em>}'.
+	 * <!-- begin-user-doc -->
+	 * This default implementation returns null so that we can easily ignore cases;
+	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
+	 * <!-- end-user-doc -->
+	 * @return the new adapter.
+	 * @see ua.ansymo.hintco.PortAdaptation
+	 * @generated
+	 */
+	public Adapter createPortAdaptationAdapter() {
+		return null;
+	}
+
+	/**
+	 * Creates a new adapter for an object of class '{@link ua.ansymo.hintco.DecompositionPortAdaptation <em>Decomposition Port Adaptation</em>}'.
+	 * <!-- begin-user-doc -->
+	 * This default implementation returns null so that we can easily ignore cases;
+	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
+	 * <!-- end-user-doc -->
+	 * @return the new adapter.
+	 * @see ua.ansymo.hintco.DecompositionPortAdaptation
+	 * @generated
+	 */
+	public Adapter createDecompositionPortAdaptationAdapter() {
+		return null;
+	}
+
+	/**
+	 * Creates a new adapter for an object of class '{@link ua.ansymo.hintco.UnitAdaptation <em>Unit Adaptation</em>}'.
+	 * <!-- begin-user-doc -->
+	 * This default implementation returns null so that we can easily ignore cases;
+	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
+	 * <!-- end-user-doc -->
+	 * @return the new adapter.
+	 * @see ua.ansymo.hintco.UnitAdaptation
+	 * @generated
+	 */
+	public Adapter createUnitAdaptationAdapter() {
+		return null;
+	}
+
+	/**
+	 * Creates a new adapter for an object of class '{@link ua.ansymo.hintco.DecompositionUnitAdaptation <em>Decomposition Unit Adaptation</em>}'.
+	 * <!-- begin-user-doc -->
+	 * This default implementation returns null so that we can easily ignore cases;
+	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
+	 * <!-- end-user-doc -->
+	 * @return the new adapter.
+	 * @see ua.ansymo.hintco.DecompositionUnitAdaptation
+	 * @generated
+	 */
+	public Adapter createDecompositionUnitAdaptationAdapter() {
+		return null;
+	}
+
+	/**
+	 * Creates a new adapter for an object of class '{@link ua.ansymo.hintco.XorUnitAdaptation <em>Xor Unit Adaptation</em>}'.
 	 * <!-- begin-user-doc -->
 	 * This default implementation returns null so that we can easily ignore cases;
 	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
 	 * <!-- end-user-doc -->
 	 * @return the new adapter.
-	 * @see ua.ansymo.hintco.DecompositionAdaptation
+	 * @see ua.ansymo.hintco.XorUnitAdaptation
 	 * @generated
 	 */
-	public Adapter createDecompositionAdaptationAdapter() {
+	public Adapter createXorUnitAdaptationAdapter() {
 		return null;
 	}
 
 	/**
-	 * Creates a new adapter for an object of class '{@link ua.ansymo.hintco.XorAdaptation <em>Xor Adaptation</em>}'.
+	 * Creates a new adapter for an object of class '{@link ua.ansymo.hintco.XorPortAdaptation <em>Xor Port Adaptation</em>}'.
 	 * <!-- begin-user-doc -->
 	 * This default implementation returns null so that we can easily ignore cases;
 	 * it's useful to ignore a case when inheritance will catch all the cases anyway.
 	 * <!-- end-user-doc -->
 	 * @return the new adapter.
-	 * @see ua.ansymo.hintco.XorAdaptation
+	 * @see ua.ansymo.hintco.XorPortAdaptation
 	 * @generated
 	 */
-	public Adapter createXorAdaptationAdapter() {
+	public Adapter createXorPortAdaptationAdapter() {
 		return null;
 	}
 

+ 120 - 43
HintCO/src-gen/ua/ansymo/hintco/util/HintcoSwitch.java

@@ -114,18 +114,11 @@ public class HintcoSwitch<T> extends Switch<T> {
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
-			case HintcoPackage.ADAPTABLE: {
-				Adaptable adaptable = (Adaptable)theEObject;
-				T result = caseAdaptable(adaptable);
-				if (result == null) result = defaultCase(theEObject);
-				return result;
-			}
 			case HintcoPackage.COSIM_UNIT_INSTANCE: {
 				CosimUnitInstance cosimUnitInstance = (CosimUnitInstance)theEObject;
 				T result = caseCosimUnitInstance(cosimUnitInstance);
 				if (result == null) result = caseIDed(cosimUnitInstance);
 				if (result == null) result = casePrecendenceNode(cosimUnitInstance);
-				if (result == null) result = caseAdaptable(cosimUnitInstance);
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
@@ -157,7 +150,6 @@ public class HintcoSwitch<T> extends Switch<T> {
 				T result = casePortInstance(portInstance);
 				if (result == null) result = casePrecendenceNode(portInstance);
 				if (result == null) result = caseIDed(portInstance);
-				if (result == null) result = caseAdaptable(portInstance);
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
@@ -167,7 +159,6 @@ public class HintcoSwitch<T> extends Switch<T> {
 				if (result == null) result = casePortInstance(inputPortInstance);
 				if (result == null) result = casePrecendenceNode(inputPortInstance);
 				if (result == null) result = caseIDed(inputPortInstance);
-				if (result == null) result = caseAdaptable(inputPortInstance);
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
@@ -177,7 +168,6 @@ public class HintcoSwitch<T> extends Switch<T> {
 				if (result == null) result = casePortInstance(outputPortInstance);
 				if (result == null) result = casePrecendenceNode(outputPortInstance);
 				if (result == null) result = caseIDed(outputPortInstance);
-				if (result == null) result = caseAdaptable(outputPortInstance);
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
@@ -194,27 +184,65 @@ public class HintcoSwitch<T> extends Switch<T> {
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
-			case HintcoPackage.DECOMPOSITION_ADAPTATION: {
-				DecompositionAdaptation decompositionAdaptation = (DecompositionAdaptation)theEObject;
-				T result = caseDecompositionAdaptation(decompositionAdaptation);
-				if (result == null) result = caseAdaptation(decompositionAdaptation);
-				if (result == null) result = caseAlternative(decompositionAdaptation);
+			case HintcoPackage.PORT_ADAPTATION: {
+				PortAdaptation portAdaptation = (PortAdaptation)theEObject;
+				T result = casePortAdaptation(portAdaptation);
+				if (result == null) result = caseAdaptation(portAdaptation);
+				if (result == null) result = caseAlternative(portAdaptation);
+				if (result == null) result = defaultCase(theEObject);
+				return result;
+			}
+			case HintcoPackage.DECOMPOSITION_PORT_ADAPTATION: {
+				DecompositionPortAdaptation decompositionPortAdaptation = (DecompositionPortAdaptation)theEObject;
+				T result = caseDecompositionPortAdaptation(decompositionPortAdaptation);
+				if (result == null) result = casePortAdaptation(decompositionPortAdaptation);
+				if (result == null) result = caseAdaptation(decompositionPortAdaptation);
+				if (result == null) result = caseAlternative(decompositionPortAdaptation);
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
-			case HintcoPackage.XOR_ADAPTATION: {
-				XorAdaptation xorAdaptation = (XorAdaptation)theEObject;
-				T result = caseXorAdaptation(xorAdaptation);
-				if (result == null) result = caseDecompositionAdaptation(xorAdaptation);
-				if (result == null) result = caseAdaptation(xorAdaptation);
-				if (result == null) result = caseAlternative(xorAdaptation);
+			case HintcoPackage.UNIT_ADAPTATION: {
+				UnitAdaptation unitAdaptation = (UnitAdaptation)theEObject;
+				T result = caseUnitAdaptation(unitAdaptation);
+				if (result == null) result = caseAdaptation(unitAdaptation);
+				if (result == null) result = caseAlternative(unitAdaptation);
+				if (result == null) result = defaultCase(theEObject);
+				return result;
+			}
+			case HintcoPackage.DECOMPOSITION_UNIT_ADAPTATION: {
+				DecompositionUnitAdaptation decompositionUnitAdaptation = (DecompositionUnitAdaptation)theEObject;
+				T result = caseDecompositionUnitAdaptation(decompositionUnitAdaptation);
+				if (result == null) result = caseUnitAdaptation(decompositionUnitAdaptation);
+				if (result == null) result = caseAdaptation(decompositionUnitAdaptation);
+				if (result == null) result = caseAlternative(decompositionUnitAdaptation);
+				if (result == null) result = defaultCase(theEObject);
+				return result;
+			}
+			case HintcoPackage.XOR_UNIT_ADAPTATION: {
+				XorUnitAdaptation xorUnitAdaptation = (XorUnitAdaptation)theEObject;
+				T result = caseXorUnitAdaptation(xorUnitAdaptation);
+				if (result == null) result = caseDecompositionUnitAdaptation(xorUnitAdaptation);
+				if (result == null) result = caseUnitAdaptation(xorUnitAdaptation);
+				if (result == null) result = caseAdaptation(xorUnitAdaptation);
+				if (result == null) result = caseAlternative(xorUnitAdaptation);
+				if (result == null) result = defaultCase(theEObject);
+				return result;
+			}
+			case HintcoPackage.XOR_PORT_ADAPTATION: {
+				XorPortAdaptation xorPortAdaptation = (XorPortAdaptation)theEObject;
+				T result = caseXorPortAdaptation(xorPortAdaptation);
+				if (result == null) result = caseDecompositionPortAdaptation(xorPortAdaptation);
+				if (result == null) result = casePortAdaptation(xorPortAdaptation);
+				if (result == null) result = caseAdaptation(xorPortAdaptation);
+				if (result == null) result = caseAlternative(xorPortAdaptation);
 				if (result == null) result = defaultCase(theEObject);
 				return result;
 			}
 			case HintcoPackage.COMBINE_ADAPTATION: {
 				CombineAdaptation combineAdaptation = (CombineAdaptation)theEObject;
 				T result = caseCombineAdaptation(combineAdaptation);
-				if (result == null) result = caseDecompositionAdaptation(combineAdaptation);
+				if (result == null) result = caseDecompositionUnitAdaptation(combineAdaptation);
+				if (result == null) result = caseUnitAdaptation(combineAdaptation);
 				if (result == null) result = caseAdaptation(combineAdaptation);
 				if (result == null) result = caseAlternative(combineAdaptation);
 				if (result == null) result = defaultCase(theEObject);
@@ -223,6 +251,7 @@ public class HintcoSwitch<T> extends Switch<T> {
 			case HintcoPackage.APPROXIMATION_ADAPTATION: {
 				ApproximationAdaptation approximationAdaptation = (ApproximationAdaptation)theEObject;
 				T result = caseApproximationAdaptation(approximationAdaptation);
+				if (result == null) result = casePortAdaptation(approximationAdaptation);
 				if (result == null) result = caseAdaptation(approximationAdaptation);
 				if (result == null) result = caseAlternative(approximationAdaptation);
 				if (result == null) result = defaultCase(theEObject);
@@ -231,6 +260,7 @@ public class HintcoSwitch<T> extends Switch<T> {
 			case HintcoPackage.MULTI_RATE_ADAPTATION: {
 				MultiRateAdaptation multiRateAdaptation = (MultiRateAdaptation)theEObject;
 				T result = caseMultiRateAdaptation(multiRateAdaptation);
+				if (result == null) result = caseUnitAdaptation(multiRateAdaptation);
 				if (result == null) result = caseAdaptation(multiRateAdaptation);
 				if (result == null) result = caseAlternative(multiRateAdaptation);
 				if (result == null) result = defaultCase(theEObject);
@@ -240,6 +270,7 @@ public class HintcoSwitch<T> extends Switch<T> {
 				ExtrapolationAdaptation extrapolationAdaptation = (ExtrapolationAdaptation)theEObject;
 				T result = caseExtrapolationAdaptation(extrapolationAdaptation);
 				if (result == null) result = caseApproximationAdaptation(extrapolationAdaptation);
+				if (result == null) result = casePortAdaptation(extrapolationAdaptation);
 				if (result == null) result = caseAdaptation(extrapolationAdaptation);
 				if (result == null) result = caseAlternative(extrapolationAdaptation);
 				if (result == null) result = defaultCase(theEObject);
@@ -249,6 +280,7 @@ public class HintcoSwitch<T> extends Switch<T> {
 				InterpolationAdaptation interpolationAdaptation = (InterpolationAdaptation)theEObject;
 				T result = caseInterpolationAdaptation(interpolationAdaptation);
 				if (result == null) result = caseApproximationAdaptation(interpolationAdaptation);
+				if (result == null) result = casePortAdaptation(interpolationAdaptation);
 				if (result == null) result = caseAdaptation(interpolationAdaptation);
 				if (result == null) result = caseAlternative(interpolationAdaptation);
 				if (result == null) result = defaultCase(theEObject);
@@ -363,21 +395,6 @@ public class HintcoSwitch<T> extends Switch<T> {
 		return null;
 	}
 
-	/**
-	 * Returns the result of interpreting the object as an instance of '<em>Adaptable</em>'.
-	 * <!-- begin-user-doc -->
-	 * This implementation returns null;
-	 * returning a non-null result will terminate the switch.
-	 * <!-- end-user-doc -->
-	 * @param object the target of the switch.
-	 * @return the result of interpreting the object as an instance of '<em>Adaptable</em>'.
-	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
-	 * @generated
-	 */
-	public T caseAdaptable(Adaptable object) {
-		return null;
-	}
-
 	/**
 	 * Returns the result of interpreting the object as an instance of '<em>Cosim Unit Instance</em>'.
 	 * <!-- begin-user-doc -->
@@ -514,32 +531,92 @@ public class HintcoSwitch<T> extends Switch<T> {
 	}
 
 	/**
-	 * Returns the result of interpreting the object as an instance of '<em>Decomposition Adaptation</em>'.
+	 * Returns the result of interpreting the object as an instance of '<em>Port Adaptation</em>'.
+	 * <!-- begin-user-doc -->
+	 * This implementation returns null;
+	 * returning a non-null result will terminate the switch.
+	 * <!-- end-user-doc -->
+	 * @param object the target of the switch.
+	 * @return the result of interpreting the object as an instance of '<em>Port Adaptation</em>'.
+	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+	 * @generated
+	 */
+	public T casePortAdaptation(PortAdaptation object) {
+		return null;
+	}
+
+	/**
+	 * Returns the result of interpreting the object as an instance of '<em>Decomposition Port Adaptation</em>'.
+	 * <!-- begin-user-doc -->
+	 * This implementation returns null;
+	 * returning a non-null result will terminate the switch.
+	 * <!-- end-user-doc -->
+	 * @param object the target of the switch.
+	 * @return the result of interpreting the object as an instance of '<em>Decomposition Port Adaptation</em>'.
+	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+	 * @generated
+	 */
+	public T caseDecompositionPortAdaptation(DecompositionPortAdaptation object) {
+		return null;
+	}
+
+	/**
+	 * Returns the result of interpreting the object as an instance of '<em>Unit Adaptation</em>'.
+	 * <!-- begin-user-doc -->
+	 * This implementation returns null;
+	 * returning a non-null result will terminate the switch.
+	 * <!-- end-user-doc -->
+	 * @param object the target of the switch.
+	 * @return the result of interpreting the object as an instance of '<em>Unit Adaptation</em>'.
+	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+	 * @generated
+	 */
+	public T caseUnitAdaptation(UnitAdaptation object) {
+		return null;
+	}
+
+	/**
+	 * Returns the result of interpreting the object as an instance of '<em>Decomposition Unit Adaptation</em>'.
+	 * <!-- begin-user-doc -->
+	 * This implementation returns null;
+	 * returning a non-null result will terminate the switch.
+	 * <!-- end-user-doc -->
+	 * @param object the target of the switch.
+	 * @return the result of interpreting the object as an instance of '<em>Decomposition Unit Adaptation</em>'.
+	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+	 * @generated
+	 */
+	public T caseDecompositionUnitAdaptation(DecompositionUnitAdaptation object) {
+		return null;
+	}
+
+	/**
+	 * Returns the result of interpreting the object as an instance of '<em>Xor Unit Adaptation</em>'.
 	 * <!-- begin-user-doc -->
 	 * This implementation returns null;
 	 * returning a non-null result will terminate the switch.
 	 * <!-- end-user-doc -->
 	 * @param object the target of the switch.
-	 * @return the result of interpreting the object as an instance of '<em>Decomposition Adaptation</em>'.
+	 * @return the result of interpreting the object as an instance of '<em>Xor Unit Adaptation</em>'.
 	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
 	 * @generated
 	 */
-	public T caseDecompositionAdaptation(DecompositionAdaptation object) {
+	public T caseXorUnitAdaptation(XorUnitAdaptation object) {
 		return null;
 	}
 
 	/**
-	 * Returns the result of interpreting the object as an instance of '<em>Xor Adaptation</em>'.
+	 * Returns the result of interpreting the object as an instance of '<em>Xor Port Adaptation</em>'.
 	 * <!-- begin-user-doc -->
 	 * This implementation returns null;
 	 * returning a non-null result will terminate the switch.
 	 * <!-- end-user-doc -->
 	 * @param object the target of the switch.
-	 * @return the result of interpreting the object as an instance of '<em>Xor Adaptation</em>'.
+	 * @return the result of interpreting the object as an instance of '<em>Xor Port Adaptation</em>'.
 	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
 	 * @generated
 	 */
-	public T caseXorAdaptation(XorAdaptation object) {
+	public T caseXorPortAdaptation(XorPortAdaptation object) {
 		return null;
 	}
 

+ 0 - 1
HintCO/src/ua/ansymo/hintco/AdaptedFMUInstance.xtend

@@ -1,7 +1,6 @@
 package ua.ansymo.hintco
 
 import java.util.Map
-import org.eclipse.core.runtime.Assert
 import org.intocps.fmi.Fmi2Status
 import org.intocps.fmi.FmuInvocationException
 import org.intocps.fmi.IFmiComponent

+ 1 - 1
HintCO/src/ua/ansymo/hintco/ApproximationAdaptedPort.xtend

@@ -8,7 +8,7 @@ abstract class ApproximationAdaptedPort implements IAdaptedInputPort {
 	var protected double previous_val
 	var protected boolean initialized = false
 	
-	new(InputPortInstance instance, Adaptation adaptation) {}
+	new(InputPortInstance instance, PortAdaptation adaptation) {}
 	
 	override setReal(double v) {
 		current_val = v

+ 2 - 2
HintCO/src/ua/ansymo/hintco/CandidateSpaceGenerator.xtend

@@ -155,7 +155,7 @@ class CandidateSpaceGenerator {
 				unit.adaptation = mr
 				mr.rate = 10				
 			} else {
-				val xor = f.createXorAdaptation()
+				val xor = f.createXorUnitAdaptation()
 				unit.adaptation = xor
 				for (r : rates){
 					val mr = f.createMultiRateAdaptation
@@ -197,7 +197,7 @@ class CandidateSpaceGenerator {
 			return
 		}
 		val f = HintcoFactory.eINSTANCE
-		val xor = f.createXorAdaptation()
+		val xor = f.createXorPortAdaptation()
 		inPort.adaptation = xor
 		{
 			val extra = f.createExtrapolationAdaptation()

+ 23 - 5
HintCO/src/ua/ansymo/hintco/CandidatesGenerator.xtend

@@ -127,7 +127,10 @@ class CandidatesGenerator {
 					addConstraint(srcPort, adaptedPort, constraints, n, cs)
 					addConstraint(adaptedPort, adaptedUnit, constraints, n, cs)
 				}
-				DecompositionAdaptation: {
+				DecompositionPortAdaptation: {
+					// Nothing to do.
+				}
+				DecompositionUnitAdaptation: {
 					// Nothing to do.
 				}
 				MultiRateAdaptation: {
@@ -272,14 +275,29 @@ class CandidatesGenerator {
 					}
 				}
 			}
-			Adaptation: {
+			UnitAdaptation: {
+				// Case adaptation, it only has siblings if there is a parent, and the siblings have the same parent.
+				val parent = (highestAlt.alternative as UnitAdaptation).parent
+				if (parent !== null) {
+					for (var i = highestAltIdx+1; i < sortedAlts.length; i++){
+						if (!sortedAlts.get(i).inVariantTree && 
+								sortedAlts.get(i).alternative instanceof UnitAdaptation &&
+								(sortedAlts.get(i).alternative as UnitAdaptation).parent === parent
+						) {
+							r.add(sortedAlts.get(i))
+							sortedAlts.get(i).inVariantTree = true
+						}
+					}
+				}
+			}
+			PortAdaptation: {
 				// Case adaptation, it only has siblings if there is a parent, and the siblings have the same parent.
-				val parent = (highestAlt.alternative as Adaptation).parent
+				val parent = (highestAlt.alternative as PortAdaptation).parent
 				if (parent !== null) {
 					for (var i = highestAltIdx+1; i < sortedAlts.length; i++){
 						if (!sortedAlts.get(i).inVariantTree && 
-								sortedAlts.get(i).alternative instanceof Adaptation &&
-								(sortedAlts.get(i).alternative as Adaptation).parent === parent
+								sortedAlts.get(i).alternative instanceof PortAdaptation &&
+								(sortedAlts.get(i).alternative as PortAdaptation).parent === parent
 						) {
 							r.add(sortedAlts.get(i))
 							sortedAlts.get(i).inVariantTree = true