|
|
@@ -44,7 +44,6 @@ class CandidatesGenerator {
|
|
|
val f = HintcoFactory.eINSTANCE
|
|
|
|
|
|
// For each power adaptation, creates an input port and an output power.
|
|
|
- // Then connects the ports among the dual adaptations.
|
|
|
|
|
|
val adaptations = cs.eAllContents.filter(PowerBondAdaptation).toList
|
|
|
|
|
|
@@ -52,23 +51,7 @@ class CandidatesGenerator {
|
|
|
// Assert.isTrue(pbAdaptation.PIn === null )
|
|
|
Assert.isTrue(pbAdaptation.POut === null)
|
|
|
val adaptedUnit = pbAdaptation.adapted
|
|
|
- // Create powerIn power declaration - Not used for now.
|
|
|
-// {
|
|
|
-// val pInId = pbAdaptation.effort.identifier + "_" + pbAdaptation.flow.identifier + "_pIn"
|
|
|
-// Assert.isTrue(!adaptedUnit.ports.exists[p | p.identifier == pInId])
|
|
|
-//
|
|
|
-// var pInPortDeclaration = adaptedUnit.declaration.ports.findFirst[p | p.identifier == pInId]
|
|
|
-// if (pInPortDeclaration === null){
|
|
|
-// pInPortDeclaration = f.createInputPortDeclaration
|
|
|
-// pInPortDeclaration.identifier = pInId
|
|
|
-// pbAdaptation.adapted.declaration.ports.add(pInPortDeclaration)
|
|
|
-// }
|
|
|
-//
|
|
|
-// val pInPort = f.createInputPortInstance
|
|
|
-// pInPort.identifier = pInId
|
|
|
-// adaptedUnit.ports.add(pInPort)
|
|
|
-// pbAdaptation.PIn = pInPort
|
|
|
-// }
|
|
|
+
|
|
|
// Create powerOut declaration
|
|
|
{
|
|
|
val pOutId = pbAdaptation.effort.identifier + "_" + pbAdaptation.flow.identifier + "_pOut"
|
|
|
@@ -87,17 +70,6 @@ class CandidatesGenerator {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // Connect ports - Requires input power ports to be used.
|
|
|
-// for (pbAdaptation : adaptations){
|
|
|
-// if (pbAdaptation.PIn.valueFrom === null){
|
|
|
-// Assert.isTrue(pbAdaptation.POut.valueTo.empty)
|
|
|
-// val dual = pbAdaptation.dual
|
|
|
-// pbAdaptation.POut.valueTo.add(dual.PIn)
|
|
|
-// pbAdaptation.PIn.valueFrom = dual.POut
|
|
|
-// } else {
|
|
|
-// Assert.isTrue(! pbAdaptation.POut.valueTo.empty)
|
|
|
-// }
|
|
|
-// }
|
|
|
}
|
|
|
|
|
|
def createVariantTree(Candidates cs){
|