diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/modeltransformation/deployment/.ratings b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/modeltransformation/deployment/.ratings index e55b25f7ec9cb315d2e1c1c260556e0b6ace9451..8b0b1f1f414642f87e75fe47cffad2f1c08d488b 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/modeltransformation/deployment/.ratings +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/modeltransformation/deployment/.ratings @@ -1,4 +1,4 @@ DeploymentFinalizer.java ce2c53558f008636c3c9f3bddd8432518c0545f1 RED DeploymentInitializer.java e190b0fe5af29c887ed59e011d68cdda5f59cf1d RED DeploymentReplicator.java 6877c3626ef0ee56db14b0af8688e7ec107290bb RED -ExplorationSolutionToDeployment.java 157b59dd1ae63fb4b51738a013945e055bbfaa4f RED +ExplorationSolutionToDeployment.java 6841d5ada7db04f5e6aa68ae40865a3c958ef643 RED diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/modeltransformation/deployment/ExplorationSolutionToDeployment.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/modeltransformation/deployment/ExplorationSolutionToDeployment.java index 21d84f192b21c284ae0b8c1800e149a3772e1db2..1d5c54914de0949ee18830e15021d7970ec1a114 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/modeltransformation/deployment/ExplorationSolutionToDeployment.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/modeltransformation/deployment/ExplorationSolutionToDeployment.java @@ -15,8 +15,6 @@ +--------------------------------------------------------------------------*/ package org.fortiss.af3.exploration.alg.dse.modeltransformation.deployment; -import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.getPhysicalPlatformArchitecture; - import java.util.Collection; import java.util.Collections; import java.util.HashSet; @@ -77,7 +75,7 @@ public class ExplorationSolutionToDeployment extends TransformationStrategyBase< throw new TransformationModuleException(this, "An PlatformArchitecture is required for this module to operate properly."); } - getPhysicalPlatformArchitecture(af3PlatformArchitecture); + // getPhysicalPlatformArchitecture(af3PlatformArchitecture); } /** diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/util/.ratings b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/util/.ratings index e3052f3c43c72aa41865924324cbad7a60d3d5b2..d9ef439a231b0c2e5fd97ec47323af9365c450a7 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/util/.ratings +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/util/.ratings @@ -1,7 +1,7 @@ -AF3Utils.java 0449890944a45bf8cc1c7ce9a578228ba9b824f8 RED +AF3Utils.java c48bfa348731c379205d72fbf0380f505e15176d RED DesignSpaceExplorationModelElementFactory.java 73368ff5bd5ab3dab10aca6a331e14cbde440f59 RED ExplorationAlgDebugUtils.java 06116a61e99717a59b7b01e4e2865bf044a8a0e2 RED -ExplorationAlgUtils.java 2cf411c8d8404d7319d7bc836dd74b5927375711 RED +ExplorationAlgUtils.java 3571ce1be1bcc997d800c59e0108544293194e70 RED ExplorationEcoreUtils.java 48ed07aec3cd93e66d37abc10d50636d591f1c71 RED GraphUtils.java 8b25592f30645f7709af527c72551f038a163833 RED TransformationUtils.java 9b424a20d117a601f9c6a4a4a4ee9e4879c29195 YELLOW diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/util/AF3Utils.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/util/AF3Utils.java index 9525197c8029a8d6da2051877594ef8611bb294f..f372a35e0c0197ba8c18fdef66fe7e5ab468acc0 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/util/AF3Utils.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/util/AF3Utils.java @@ -19,8 +19,6 @@ import static org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IResourceConnect import static org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IResourceConnectionAdapter.ConnectionType.INCOMING; import static org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IResourceConnectionAdapter.ConnectionType.OUTGOING; import static org.fortiss.af3.exploration.alg.util.DesignSpaceExplorationModelElementFactory.createComponentMultiAllocationConstraint; -import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.getReferencedElementsWithType; -import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.getResourceReferences; import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType; import static org.fortiss.tooling.kernel.utils.EcoreUtils.getParentsWithType; import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getParentElement; @@ -293,16 +291,17 @@ public class AF3Utils { throws InvalidPlatformModelException { // By the method signature, we know the instance type is a IConnector class. @SuppressWarnings("unchecked") ConnectionType connectionTypeSource = - systemModelAdapter.getConnectionType( - (Class<? extends IConnector>)sourceConnector.eClass().getInstanceClass()); + systemModelAdapter.getConnectionType((Class<? extends IConnector>)sourceConnector + .eClass().getInstanceClass()); @SuppressWarnings("unchecked") ConnectionType connectionTypeTarget = - systemModelAdapter.getConnectionType( - (Class<? extends IConnector>)targetConnector.eClass().getInstanceClass()); + systemModelAdapter.getConnectionType((Class<? extends IConnector>)targetConnector + .eClass().getInstanceClass()); // assert (connectionTypeSource != null && connectionTypeTarget != null) : // "Could not identify the type of one of the connection targets."; if((connectionTypeSource == INCOMING && connectionTypeTarget == INCOMING) || (connectionTypeSource == OUTGOING && connectionTypeTarget == OUTGOING)) { - throw new InvalidPlatformModelException((PlatformConnectorUnit)sourceConnector, + throw new InvalidPlatformModelException( + (PlatformConnectorUnit)sourceConnector, "A platform port or interface (see above) for incoming or outgoing traffic is connected to an port or interface of the same type. This is not allowed."); } @@ -358,8 +357,8 @@ public class AF3Utils { SystemModelAdapter<?, ?, ?, ?, ?, ?, ?> systemModelAdapter) { // By the method signature, we know the instance type is a IConnector class. @SuppressWarnings("unchecked") ConnectionType connectionTypeSource = - systemModelAdapter.getConnectionType( - (Class<? extends IConnector>)sourceConnector.eClass().getInstanceClass()); + systemModelAdapter.getConnectionType((Class<? extends IConnector>)sourceConnector + .eClass().getInstanceClass()); return connectionTypeSource != null ? connectionTypeSource : BIDIRECTIONAL; } @@ -367,8 +366,8 @@ public class AF3Utils { * Predicate whether the subject {@link PlatformConnectorUnit} is a connector of the given * {@link IModelElementAdapter}. */ - public static boolean isConnectorOf(PlatformConnectorUnit pConn, - IModelElementAdapter<?> element) { + public static boolean + isConnectorOf(PlatformConnectorUnit pConn, IModelElementAdapter<?> element) { return pConn.getOwner() == element.getObject(); } @@ -387,16 +386,18 @@ public class AF3Utils { * {@link PlatformConnectorUnit} for the device-internal communication of the given * {@link IModelElementAdapter}. */ - public static boolean isDeviceInternalPredecessor(PlatformConnectorUnit connCandidate, - IModelElementAdapter<?> element, - DirectedGraph<PlatformConnectorUnit, DefaultEdge> route) { + public static boolean + isDeviceInternalPredecessor(PlatformConnectorUnit connCandidate, + IModelElementAdapter<?> element, + DirectedGraph<PlatformConnectorUnit, DefaultEdge> route) { // The following rules apply for device internal communication: // - Sender Port is on the same device OR // - its reference port is one layer "below", e.g. Gateway -> Router AND // - the sender connector must have been traversed (natural for path walking a multicast // message. - if(route.containsVertex(connCandidate) && (isConnectorOf(connCandidate, element) || - isContainedInResource(connCandidate, element))) { + if(route.containsVertex(connCandidate) && + (isConnectorOf(connCandidate, element) || isContainedInResource(connCandidate, + element))) { return true; } return false; @@ -454,12 +455,9 @@ public class AF3Utils { * Checks whether any parent {@link IPlatformResource} of the given {@code element} is a * deployment target defined by the set of deployment targets ({@code deploymentTargets}). * If any parent element has been found that is a deployment target, {@code true} is returned. - * The method considers parents in the following order: - * <li>Check the direct parent (container). - * </li> - * <li>Check all referenced resources as defined in the {@link ResourceLink} annotation.</li> - * <li>Go to the parent resource and run the same checks.</li> - * <li>Run the above checks for all + * The method considers parents in the following order: <li>Check the direct parent (container). + * </li> <li>Check all referenced resources as defined in the {@link ResourceLink} annotation.</li> + * <li>Go to the parent resource and run the same checks.</li> <li>Run the above checks for all * references Resources as given by the {@link ResourceLink} annotations.</> * * @param element @@ -476,7 +474,8 @@ public class AF3Utils { return false; } - List<IPlatformResource> resRefs = getResourceReferences((IModelElement)element); + // TODO: Replace by Allocation Model + List<IPlatformResource> resRefs = null; // = getResourceReferences((IModelElement)element); if(deploymentTargets.contains(parent)) { return true; @@ -507,8 +506,8 @@ public class AF3Utils { public static <T extends IPlatformResource & IHierarchicElement> boolean isAnyChildDeploymentTarget(IPlatformResource element, Collection<T> deploymentTargets, Class<T> targetType) { - return getChildrenWithType(element, targetType).stream() - .anyMatch(child -> deploymentTargets.contains(child)); + return getChildrenWithType(element, targetType).stream().anyMatch( + child -> deploymentTargets.contains(child)); } /** @@ -522,9 +521,11 @@ public class AF3Utils { * thereby establish a "communication link" between both platforms. * @return Map representing the "inverse" 1:1 references of {@link ResourceLink}s. */ - public static Map<IModelElement, IModelElement> getInverseIntraPlatformReferences( - PlatformArchitecture referencingPlatformArchitecture, - Pair<Class<? extends IModelElement>, Class<? extends IModelElement>> interPlatformConnectingElements) { + public static + Map<IModelElement, IModelElement> + getInverseIntraPlatformReferences( + PlatformArchitecture referencingPlatformArchitecture, + Pair<Class<? extends IModelElement>, Class<? extends IModelElement>> interPlatformConnectingElements) { if(interPlatformConnectingElements == null) { return Collections.emptyMap(); } @@ -534,10 +535,12 @@ public class AF3Utils { for(IModelElement referencingElement : getChildrenWithType(referencingPlatformArchitecture, interPlatformConnectingElements.getFirst())) { - for(IModelElement referencedElement : getReferencedElementsWithType(referencingElement, - interPlatformConnectingElements.getSecond())) { - invElementReferences.put(referencedElement, referencingElement); - } + // TODO: Replace by Allocation Model + // for(IModelElement referencedElement : + // getReferencedElementsWithType(referencingElement, + // interPlatformConnectingElements.getSecond())) { + // invElementReferences.put(referencedElement, referencingElement); + // } } return invElementReferences; @@ -577,12 +580,12 @@ public class AF3Utils { * @return Set of {@link ComponentMultiAllocationConstraint}s with the same references as the * {@link ComponentAllocation}s. */ - public static Collection<ComponentMultiAllocationConstraint> - createConstraintsFromDeployment(Deployment deployment) { + public static Collection<ComponentMultiAllocationConstraint> createConstraintsFromDeployment( + Deployment deployment) { Collection<ComponentAllocation> allocatedComponents = deployment.getComponentAllocations(); Function<ComponentAllocation, ComponentMultiAllocationConstraint> mapper = - ca -> createComponentMultiAllocationConstraint(ca.getComponent(), - new BasicEList<>(Arrays.asList(ca.getExecutionUnit()))); + ca -> createComponentMultiAllocationConstraint(ca.getComponent(), new BasicEList<>( + Arrays.asList(ca.getExecutionUnit()))); return allocatedComponents.stream().map(mapper) .map(ComponentMultiAllocationConstraint.class::cast).collect(Collectors.toList()); } @@ -600,8 +603,10 @@ public class AF3Utils { * @return The {@link ComponentArchitecture} identified as the <i>Component Pool</i> or * {@code null} if none is found. */ - public static ComponentArchitecture getFirstComponentPool( - IMappingEncoding<ITaskAdapter<?>, IResourceAdapter<?>, IMappingEntry<ITaskAdapter<?>, IResourceAdapter<?>>> mapping) { + public static + ComponentArchitecture + getFirstComponentPool( + IMappingEncoding<ITaskAdapter<?>, IResourceAdapter<?>, IMappingEntry<ITaskAdapter<?>, IResourceAdapter<?>>> mapping) { for(ITaskAdapter<?> deployableComponent : mapping.getRequesters()) { if(deployableComponent.isInstantiation()) { // TODO: Avoid casting: Parameterize the IModelElementAdapter to use EObject-derived @@ -691,8 +696,9 @@ public class AF3Utils { EList<Component> parentElements = getParentsWithType(startElement, Component.class); for(Component parentComponent : parentElements) { - AbstractTaskMappingEntry entry = (AbstractTaskMappingEntry)encEntryModelElemAssoc - .inverse().get(parentComponent, AbstractTaskMappingEntry.class); + AbstractTaskMappingEntry entry = + (AbstractTaskMappingEntry)encEntryModelElemAssoc.inverse().get(parentComponent, + AbstractTaskMappingEntry.class); if(entry != null) { return true; } diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/util/ExplorationAlgUtils.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/util/ExplorationAlgUtils.java index 57a4e10ca94ea411ca0155cab3cef3d12bce6e56..3ae0811b433c0be37af094086aff720cb42ea862 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/util/ExplorationAlgUtils.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/util/ExplorationAlgUtils.java @@ -17,7 +17,6 @@ package org.fortiss.af3.exploration.alg.util; import static org.eclipse.emf.ecore.util.EcoreUtil.getAllContents; import static org.fortiss.af3.exploration.alg.util.AF3Utils.isAnyParentDeploymentTarget; -import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.getReferencedElementsWithType; import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType; import static org.fortiss.tooling.kernel.utils.EcoreUtils.getParentsWithType; @@ -51,10 +50,8 @@ import org.fortiss.af3.exploration.model.ExplorationTarget; import org.fortiss.af3.exploration.model.IProblemDimension; import org.fortiss.af3.platform.model.IPlatformResource; import org.fortiss.af3.platform.model.IVirtualizationPlatformArchitectureElement; -import org.fortiss.af3.platform.utils.PlatformArchitectureUtils; import org.fortiss.tooling.base.model.element.IHierarchicElement; import org.fortiss.tooling.base.model.element.IHierarchicElementContainer; -import org.fortiss.tooling.base.model.element.IModelElement; import com.google.common.collect.Multimap; @@ -405,8 +402,9 @@ public class ExplorationAlgUtils { Collection<IPlatformResource> virtualizedResources = new HashSet<IPlatformResource>(); for(IVirtualizationPlatformArchitectureElement currentVirtualizationProvider : virtualizationProviders) { - virtualizedResources.addAll(PlatformArchitectureUtils - .getResourceReferences((IModelElement)currentVirtualizationProvider)); + // TODO: Replace by Allocation Model + // virtualizedResources.addAll(PlatformArchitectureUtils + // .getResourceReferences((IModelElement)currentVirtualizationProvider)); } return (Collections.disjoint(selfAndParentElements, virtualizedResources)) ? false : true; @@ -446,10 +444,12 @@ public class ExplorationAlgUtils { public static boolean haveSameParentHardwareElement(IHierarchicElement elementA, IHierarchicElement elementB, Collection<IVirtualizationPlatformArchitectureElement> virtualizationProviders) { - List<IHierarchicElement> refA = - getReferencedElementsWithType(elementA, IHierarchicElement.class); - List<IHierarchicElement> refB = - getReferencedElementsWithType(elementB, IHierarchicElement.class); + List<IHierarchicElement> refA = null; + // TODO: Replace by Allocation Model + // getReferencedElementsWithType(elementA, IHierarchicElement.class); + List<IHierarchicElement> refB = null; + // TODO: Replace by Allocation Model + // getReferencedElementsWithType(elementB, IHierarchicElement.class); if(refA.size() < 1 || refB.size() < 1) { return false; }