diff --git a/org.fortiss.af3.exploration.alg/trunk/META-INF/MANIFEST.MF b/org.fortiss.af3.exploration.alg/trunk/META-INF/MANIFEST.MF index b63c12d386449303d1b996d3946d516098d01108..2e0a6e044a08801272b404bba61ed358d04bea4c 100644 --- a/org.fortiss.af3.exploration.alg/trunk/META-INF/MANIFEST.MF +++ b/org.fortiss.af3.exploration.alg/trunk/META-INF/MANIFEST.MF @@ -141,7 +141,7 @@ Export-Package: com.google.common.annotations, org.fortiss.af3.exploration.model", org.fortiss.af3.exploration.alg.exception, org.fortiss.af3.exploration.alg.guava, - org.fortiss.af3.exploration.alg.port, + org.fortiss.af3.exploration.alg.plot, org.fortiss.af3.exploration.alg.service, org.fortiss.af3.exploration.alg.util, org.fortiss.af3.exploration.dsl.model, diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/backend/Opt4JDseBackend.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/backend/Opt4JDseBackend.java index 31e8c7b3dd27bcc037d66e98866c03a1df310664..9e3076ed55ecdf6f4bceb8bce361cd1d333818af 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/backend/Opt4JDseBackend.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/backend/Opt4JDseBackend.java @@ -34,9 +34,8 @@ import org.fortiss.af3.exploration.alg.dse.Explorer; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.solution.StrictTTSchedule; import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter; import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.af3.AF3SystemModelAdapter; -import org.fortiss.af3.exploration.alg.port.plot.XYPlotter; +import org.fortiss.af3.exploration.alg.plot.XYPlotter; import org.fortiss.af3.exploration.alg.service.IExplorationEncoding; -import org.fortiss.af3.exploration.backend.DseInputContainer; import org.fortiss.af3.exploration.backend.IDseBackend; import org.fortiss.af3.exploration.backend.RuleSetContainer; import org.fortiss.af3.exploration.backend.SuperSetMap; @@ -191,11 +190,6 @@ public class Opt4JDseBackend implements IDseBackend { } } - /** Defines the required input parameters of this DSE backend. */ - protected class Opt4JDSEInputParameters extends DseInputContainer { - // Parameter container wrapping a standard java map. - } - /** {@inheritDoc} */ @Override public String getName() { diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/backend/opt4j/encoding/comm/MessageEncoding.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/backend/opt4j/encoding/comm/MessageEncoding.java index 715477760e5b08997a9583ee9a8a88ccd850dd07..ced70c118f60cc8630af238e79253fdd41397f1b 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/backend/opt4j/encoding/comm/MessageEncoding.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/backend/opt4j/encoding/comm/MessageEncoding.java @@ -23,10 +23,10 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.partitionmappi import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.TaskMappingEncoding; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.TaskMappingEntry; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.ComposablePhenotype; +import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ISignalAdapter; import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter; import org.fortiss.af3.exploration.alg.dse.sysmodel.comm.Message; import org.fortiss.af3.exploration.alg.service.IExplorationEncoding; -import org.fortiss.af3.exploration.backend.IDseInputContainer.SignalType; /** * {@link IExplorationEncoding} that defines the {@link Message}s which are transmitted on a target @@ -53,7 +53,7 @@ public class MessageEncoding<S extends TaskMappingEntry<ITaskAdapter<?>, Partiti /** Returns all messages that are sent periodically. */ public Collection<Message> getPeriodicMessages() { return filterSet(messages, - m -> m.getSignalAdapter().getSignalType() == SignalType.PERIODIC); + m -> m.getSignalAdapter().getSignalType() == ISignalAdapter.SignalType.PERIODIC); } /** {@inheritDoc} */ diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/.ratings b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/.ratings index d20afb79d5f0fd632dffec405598922244cbe007..c40ec26828984867240f33825f14e6b1eae53344 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/.ratings +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/.ratings @@ -10,9 +10,8 @@ IRequestAdapter.java bb7b3c05c4f52215cd79b27207bad8ce66a28506 RED IResourceAdapter.java 634866895c9d1aa427f3c8d47e69acd807d0b582 RED IResourceConnectionAdapter.java 7e20a8c3e60a9892597301556c891ba2dd43387f RED ISafetyFunctionAdapter.java f20249e7c37f54774a9e8eaa0566a85492c80654 RED -ISignalAdapter.java d4e3f25bce705ad35e0ba633cf00b8a51db4cda7 RED +ISignalAdapter.java 4f04154c5802a4f1a5469df90652852e16727421 RED ITaskAdapter.java 97ad40c0ca14be2fb4fd070214a3d6ebe5be914a RED ITransmissionUnitAdapter.java 8965b73bfe9ef232a2a6d5427f7001761716d583 RED InternalComponentParameters.java 2b19f4eeddee84e4c6e558ed9a1613cba33b7665 RED SystemModelAdapter.java 393b4017059b41dc296d881a0fe39cfc83ccaa39 RED -SystemParameterContainer.java eddfc430acd8661dfe8ffbf191ef71a83157eff5 RED diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/ISignalAdapter.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/ISignalAdapter.java index a576d906bd4de73ee42c0a88f8c7f65777caf3ea..2bdb578564cf1d3351c99811c9090e2e9bd70715 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/ISignalAdapter.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/ISignalAdapter.java @@ -17,8 +17,6 @@ package org.fortiss.af3.exploration.alg.dse.sysmodel.arch; import java.util.Collection; -import org.fortiss.af3.exploration.backend.IDseInputContainer.SignalType; - /** * Adapter between logical channels of the system meta-model used in the modeling * tool, and the DSE. @@ -26,6 +24,15 @@ import org.fortiss.af3.exploration.backend.IDseInputContainer.SignalType; * @author barner */ public interface ISignalAdapter<S, T> extends IRequestAdapter<S> { + /** Temporal activation of the signal. */ + public enum SignalType { + /** Purely event-based activation. */ + APERIODIC, + /** Strictly periodic activation. */ + PERIODIC, + /** Temporally upper-bounded, event-based activation. */ + SPORADIC + } /** Returns the source component of this {@link ISignalAdapter}. */ ITaskAdapter<?> getSource(); diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/SystemParameterContainer.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/SystemParameterContainer.java deleted file mode 100644 index eae0c375dcbc9e18c796c68b23998629bf8246d2..0000000000000000000000000000000000000000 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/SystemParameterContainer.java +++ /dev/null @@ -1,210 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2016 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.af3.exploration.alg.dse.sysmodel.arch; - -import java.util.Collection; -import java.util.Map; - -import org.conqat.lib.commons.collections.Pair; -import org.fortiss.af3.component.model.Component; -import org.fortiss.af3.component.model.ComponentArchitecture; -import org.fortiss.af3.component.model.OutputPort; -import org.fortiss.af3.component.model.Port; -import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IResourceConnectionAdapter.ConnectionType; -import org.fortiss.af3.exploration.backend.IDseInputContainer.SignalType; -import org.fortiss.af3.platform.model.ExecutionUnit; -import org.fortiss.af3.platform.model.IPlatformArchitectureElement; -import org.fortiss.af3.platform.model.IPlatformResource; -import org.fortiss.af3.platform.model.PlatformArchitecture; -import org.fortiss.af3.platform.model.annotation.ResourceLink; -import org.fortiss.tooling.base.model.element.IConnector; -import org.fortiss.tooling.base.model.element.IModelElement; - -import com.google.common.collect.Multimap; - -/** - * - * @author diewald - */ -public class SystemParameterContainer { - - /** Collection of deployable {@link Component}s for the target platform. */ - private Collection<Component> deployableComponents; - - /** - * Maps the {@link Port}s of the deployable {@link Component}s to their temporal - * {@link SignalType} (aperiodic, sporadic, etc.). - */ - private Map<Port, SignalType> portSignalTypes; - - /** {@link ExecutionUnit}s to which {@link Component}s are mapped. */ - private Collection<ExecutionUnit> deploymentTargets; - - /** Map relating deployable {@link Component}s with their respective periods. */ - private Map<Component, Double> componentPeriodMap; - - /** - * Relates {@link Component}s from the input {@link ComponentArchitecture} to their diverse - * implementations, i.e. concrete instances (if any). - */ - private Multimap<Component, Component> replacementComponents; - - /** - * Associates deployable {@link Component}s with the number of minimally and maximally allowed - * replication (1 == no replication). - */ - private Map<Component, Pair<Integer, Integer>> componentReplicationBounds; - - /** - * Associates the OutputPorts of the deployable {@link Component}s with the size of the messages - * they emit. - */ - private Map<OutputPort, Long> portMessageSizes; - - /** - * Assotiates elements of the {@link PlatformArchitecture} with their respective mean failure - * rate. - */ - private Map<IPlatformArchitectureElement, Double> resourceFailureProbabilities; - - /** - * Associates {@link IPlatformResource}s with their respective active power consumption (in - * watts). - */ - private Map<IPlatformResource, Double> resourcePowerConsumption; - - /** - * Look up table to determine the input/output directions of {@link IConnector} types of the - * target {@link PlatformArchitecture}. - */ - private Map<Class<? extends IConnector>, ConnectionType> connectionTypeLUT; - - /** - * Identifies the {@link IModelElement} types which establish a connection between two - * {@link PlatformArchitecture}s via an {@link ResourceLink}. - */ - private Pair<Class<? extends IModelElement>, Class<? extends IModelElement>> platfromInterconnectTypes; - - /** Defines the fault containment region defined for the target {@link PlatformArchitecture}. */ - private Class<? extends IPlatformResource> faultContainmentRegion; - - /** Constructor. */ - public SystemParameterContainer(Collection<Component> deployableComponents, - Map<Port, SignalType> portSignalTypes, Collection<ExecutionUnit> deploymentTargets, - Map<Component, Double> componentPeriodMap, - Multimap<Component, Component> replacementComponents, - Map<Component, Pair<Integer, Integer>> componentReplicationBounds, - Map<OutputPort, Long> portMessageSizes, - Map<IPlatformArchitectureElement, Double> resourceFailureMap, - Map<IPlatformResource, Double> resourcePowerConsumption, - Map<Class<? extends IConnector>, ConnectionType> connectionTypeLUT, - Pair<Class<? extends IModelElement>, Class<? extends IModelElement>> platfromInterconnectTypes, - Class<? extends IPlatformResource> faultContainmentRegion) { - this.deployableComponents = deployableComponents; - this.portSignalTypes = portSignalTypes; - this.deploymentTargets = deploymentTargets; - this.componentPeriodMap = componentPeriodMap; - this.replacementComponents = replacementComponents; - this.componentReplicationBounds = componentReplicationBounds; - this.portMessageSizes = portMessageSizes; - this.resourceFailureProbabilities = resourceFailureMap; - this.resourcePowerConsumption = resourcePowerConsumption; - this.connectionTypeLUT = connectionTypeLUT; - this.platfromInterconnectTypes = platfromInterconnectTypes; - this.faultContainmentRegion = faultContainmentRegion; - } - - /** Returns the deployable {@link Component}s. */ - public Collection<Component> getDeployableComponents() { - return deployableComponents; - } - - /** Returns the {@link Port} to signal type associations. */ - public Map<Port, SignalType> getPortSignalTypes() { - return portSignalTypes; - } - - /** Returns the set of deployment targets (to where {@link Component}s may be mapped). */ - public Collection<ExecutionUnit> getDeploymentTargets() { - return deploymentTargets; - } - - /** Returns the associations of deployable {@link Component}s and their defined periods. */ - public Map<Component, Double> getComponentPeriodMap() { - return componentPeriodMap; - } - - /** - * Returns the associations between deployable {@link Component}s and their diverse - * implementations (if any). - */ - public Multimap<Component, Component> getReplacementComponents() { - return replacementComponents; - } - - /** - * Returns the association between deployable {@link Component}s and their minimum and maximum - * replication bound. - */ - public Map<Component, Pair<Integer, Integer>> getComponentReplicationBounds() { - return componentReplicationBounds; - } - - /** - * Returns the associations between the {@link OutputPort}s of deployable {@link Component}s and - * the size of the data they are sending. - */ - public Map<OutputPort, Long> getPortMessageSizes() { - return portMessageSizes; - } - - /** Returns the associations between platform elements and their mean failur probability. */ - public Map<IPlatformArchitectureElement, Double> getResourceFailureProbabilities() { - return resourceFailureProbabilities; - } - - /** - * Returns the associations between platform elements and their mean active power consumption. - */ - public Map<IPlatformResource, Double> getResourcePowerConsumption() { - return resourcePowerConsumption; - } - - /** - * Returns the lookup table mapping platform connectors their respective input output direction - * type. - */ - public Map<Class<? extends IConnector>, ConnectionType> getConnectionTypeLUT() { - return connectionTypeLUT; - } - - /** - * Returns the {@link IModelElement} types connecting entities from different - * {@link PlatformArchitecture}s, e.g. a System Software and a Hardware Architecture. - */ - public Pair<Class<? extends IModelElement>, Class<? extends IModelElement>> - getPlatfromInterconnectTypes() { - return platfromInterconnectTypes; - } - - /** - * Returns the {@link IPlatformResource} that is assumed to be the fault containment region of - * the target platform. - */ - public Class<? extends IPlatformResource> getFaultContainmentRegion() { - return faultContainmentRegion; - } -} diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/af3/.ratings b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/af3/.ratings index b59352373134ef6179c0493688284053d5de937d..8b0d4b1b428b31ff38f0599904e4b8711efa83b2 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/af3/.ratings +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/af3/.ratings @@ -7,7 +7,7 @@ AF3PlatformArchitectureAdapter.java fb657d182999dc73eed16c0adc57c5876c8104b9 RED AF3RequestAdapter.java 7cfea424beeacaac81b48efd4e1c24270dcb3929 RED AF3ResourceAdapter.java 00070d4e3ec7f19a672b6295c546fa1d30d7fc50 RED AF3ResourceConnectionAdapter.java 0e791fd7d9602f4cf00f54c6254d31f1c9cc72b0 RED -AF3SignalAdapter.java 9ef141f12e93b851192d1e8cb0c2f68102afec8c RED +AF3SignalAdapter.java bc102b65b929393808eb747572f9ae05b04a8856 RED AF3SystemModelAdapter.java 6ecf47e813341aa68f049a8cdec77782b98c2a96 RED AF3TaskAdapter.java a3cfe04d7b235cc61031c5477de2cb54ac810aac RED AF3TransmissionUnitAdapter.java 0ce1a08c29d75a05fb49668d02abddd852487a4c RED diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/af3/AF3SignalAdapter.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/af3/AF3SignalAdapter.java index 2cbd39d79e5bada9d6649efd9e29459f421a65b8..7d124a5c25b8267fa3be16d897253252f96c21c7 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/af3/AF3SignalAdapter.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/dse/sysmodel/arch/af3/AF3SignalAdapter.java @@ -25,7 +25,6 @@ import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ISignalAdapter; import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter; import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITransmissionUnitAdapter; import org.fortiss.af3.exploration.alg.exception.InvalidModelException; -import org.fortiss.af3.exploration.backend.IDseInputContainer.SignalType; import org.fortiss.af3.platform.model.annotation.MessageSize; import org.fortiss.af3.task.model.TaskInputPort; import org.fortiss.af3.task.model.TaskOutputPort; diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/.ratings b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/.ratings similarity index 100% rename from org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/.ratings rename to org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/.ratings diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/DO_NOT_REVIEW_PACKAGE b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/DO_NOT_REVIEW_PACKAGE similarity index 100% rename from org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/DO_NOT_REVIEW_PACKAGE rename to org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/DO_NOT_REVIEW_PACKAGE diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/MessagePathOnClicked.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/MessagePathOnClicked.java similarity index 99% rename from org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/MessagePathOnClicked.java rename to org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/MessagePathOnClicked.java index 5c9c3279dbe8034adfffd00a8c4f52bc2f808453..3f375950a59fedad5e2cd025c6c019ec5a1355d5 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/MessagePathOnClicked.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/MessagePathOnClicked.java @@ -13,7 +13,7 @@ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.af3.exploration.alg.port.plot; +package org.fortiss.af3.exploration.alg.plot; import java.awt.BasicStroke; import java.awt.Color; diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/ScheduleGanttRenderer.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/ScheduleGanttRenderer.java similarity index 99% rename from org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/ScheduleGanttRenderer.java rename to org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/ScheduleGanttRenderer.java index bacfe5570e5e6ddbc85bc13ad2b2874401f13241..8696a7574f53b35bc0909e364c430d1f6aa184ee 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/ScheduleGanttRenderer.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/ScheduleGanttRenderer.java @@ -13,7 +13,7 @@ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.af3.exploration.alg.port.plot; +package org.fortiss.af3.exploration.alg.plot; import java.awt.Color; import java.awt.Graphics2D; diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/ScheduleLabelGenerator.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/ScheduleLabelGenerator.java similarity index 98% rename from org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/ScheduleLabelGenerator.java rename to org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/ScheduleLabelGenerator.java index faa3f972c33dbce3d5678e6222aa1f7f0f195d5d..3a96dc0798916a7b661f9529abbf361efdba607b 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/ScheduleLabelGenerator.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/ScheduleLabelGenerator.java @@ -13,7 +13,7 @@ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.af3.exploration.alg.port.plot; +package org.fortiss.af3.exploration.alg.plot; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.solution.StrictTTSchedule; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.solution.StrictTTSchedule.ResourceSchedule; diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/SchedulePlotter.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/SchedulePlotter.java similarity index 98% rename from org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/SchedulePlotter.java rename to org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/SchedulePlotter.java index 50558aa952d3fddc81a68dfdccf645e2e4e5a8c0..993bef41fc93598306cae509b716141722de53ab 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/SchedulePlotter.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/SchedulePlotter.java @@ -13,7 +13,7 @@ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.af3.exploration.alg.port.plot; +package org.fortiss.af3.exploration.alg.plot; import javax.swing.JFrame; diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/ScheduleToolTipGenerator.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/ScheduleToolTipGenerator.java similarity index 98% rename from org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/ScheduleToolTipGenerator.java rename to org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/ScheduleToolTipGenerator.java index d1620c0a7e9967848065a430cc70ec81c46060b7..6fe9d52c967859255527c91a724ad18a785bcab8 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/ScheduleToolTipGenerator.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/ScheduleToolTipGenerator.java @@ -13,7 +13,7 @@ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.af3.exploration.alg.port.plot; +package org.fortiss.af3.exploration.alg.plot; import java.util.HashMap; import java.util.Map; diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/TaskSeriesCollectionFromSchedule.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/TaskSeriesCollectionFromSchedule.java similarity index 99% rename from org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/TaskSeriesCollectionFromSchedule.java rename to org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/TaskSeriesCollectionFromSchedule.java index cbd6a2b27a3902f8f1204bd5edc0b2c4129a13a8..2d63e095ecc978ac9c8770590c31fa2bef0ea0b6 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/TaskSeriesCollectionFromSchedule.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/TaskSeriesCollectionFromSchedule.java @@ -13,7 +13,7 @@ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.af3.exploration.alg.port.plot; +package org.fortiss.af3.exploration.alg.plot; import java.util.ArrayList; import java.util.HashMap; diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/XYPlotter.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/XYPlotter.java similarity index 99% rename from org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/XYPlotter.java rename to org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/XYPlotter.java index 729ffc791f960af0a448405888306a659bf4c766..d82ff81b26b4e75b5ea5ed7d4207f79ac15df687 100644 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/plot/XYPlotter.java +++ b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/plot/XYPlotter.java @@ -13,7 +13,7 @@ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.af3.exploration.alg.port.plot; +package org.fortiss.af3.exploration.alg.plot; import static javax.swing.JOptionPane.YES_OPTION; import static org.fortiss.af3.exploration.alg.ExplorationAlgActivator.PLUGIN_ID; diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/.ratings b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/.ratings deleted file mode 100644 index aeb306a5b583422ef6106b24b23b759197c1e827..0000000000000000000000000000000000000000 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/.ratings +++ /dev/null @@ -1 +0,0 @@ -DSEPortingUtils.java 1cff814a5f34ff225087df1c807c0257a3d36b15 RED diff --git a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/DSEPortingUtils.java b/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/DSEPortingUtils.java deleted file mode 100644 index d528e942de4a7938481a36756e28e9f1f26c29dc..0000000000000000000000000000000000000000 --- a/org.fortiss.af3.exploration.alg/trunk/src/org/fortiss/af3/exploration/alg/port/DSEPortingUtils.java +++ /dev/null @@ -1,417 +0,0 @@ -/*-------------------------------------------------------------------------+ -| Copyright 2017 fortiss GmbH | -| | -| Licensed under the Apache License, Version 2.0 (the "License"); | -| you may not use this file except in compliance with the License. | -| You may obtain a copy of the License at | -| | -| http://www.apache.org/licenses/LICENSE-2.0 | -| | -| Unless required by applicable law or agreed to in writing, software | -| distributed under the License is distributed on an "AS IS" BASIS, | -| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | -| See the License for the specific language governing permissions and | -| limitations under the License. | -+--------------------------------------------------------------------------*/ -package org.fortiss.af3.exploration.alg.port; - -import static org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IResourceConnectionAdapter.ConnectionType.BIDIRECTIONAL; -import static org.fortiss.af3.platform.utils.PlatformArchitectureUtils.getReferencedElementsWithType; -import static org.fortiss.tooling.common.util.LambdaUtils.filterStream; -import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.conqat.lib.commons.collections.Pair; -import org.fortiss.af3.component.model.Component; -import org.fortiss.af3.component.model.OutputPort; -import org.fortiss.af3.component.model.Port; -import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IResourceConnectionAdapter.ConnectionType; -import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemParameterContainer; -import org.fortiss.af3.exploration.backend.IDseInputContainer.DeployableComponents; -import org.fortiss.af3.exploration.backend.IDseInputContainer.SignalType; -import org.fortiss.af3.exploration.backend.IDseInputContainer.TemporalTriggers; -import org.fortiss.af3.exploration.dsl_v2.model.booleanp.allocation.Allocation; -import org.fortiss.af3.exploration.model.ExplorationSpecification; -import org.fortiss.af3.exploration.moea.model.annotation.ComponentDiverseImplRef; -import org.fortiss.af3.expression.model.types.TBool; -import org.fortiss.af3.expression.model.types.TDouble; -import org.fortiss.af3.expression.model.types.TInt; -import org.fortiss.af3.platform.model.ExecutionUnit; -import org.fortiss.af3.platform.model.IPhysicalPlatformArchitectureElement; -import org.fortiss.af3.platform.model.IPlatformArchitectureElement; -import org.fortiss.af3.platform.model.IPlatformResource; -import org.fortiss.af3.platform.model.IVirtualizationPlatformArchitectureElement; -import org.fortiss.af3.platform.model.PlatformArchitecture; -import org.fortiss.af3.platform.model.TransmissionUnit; -import org.fortiss.af3.platform.utils.PlatformArchitectureUtils; -import org.fortiss.af3.project.model.typesystem.IType; -import org.fortiss.af3.task.model.TaskAllocation; -import org.fortiss.af3.task.model.TaskArchitecture; -import org.fortiss.tooling.base.model.element.IConnector; -import org.fortiss.tooling.base.model.element.IModelElement; -import org.fortiss.tooling.kernel.utils.EcoreUtils; - -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; - -/** - * - * @author diewald - */ -public class DSEPortingUtils { - /** - * Lookup table for to determine the direction of a connection by the type of the target - * {@link IConnector}. - */ - // TODO: UsePlatformPort? - @Deprecated - public static Map<Class<? extends IConnector>, ConnectionType> connectionTypeLUT = - Collections.unmodifiableMap(new HashMap<Class<? extends IConnector>, ConnectionType>() { - { - } - }); - - /** - * Returns the type of communication the given port can handle: incoming, outgoing, or - * bidirectional traffic. - * - * @param sourceConnector - * {@link IConnector} to be examined. - * @return The port type (default = bidirectional). - */ - @Deprecated - public static ConnectionType getPortDirection(IConnector sourceConnector) { - ConnectionType connectionTypeSource = connectionTypeLUT.get(sourceConnector.getClass()); - return connectionTypeSource != null ? connectionTypeSource : BIDIRECTIONAL; - } - - /** - * Creates a collection of deployment targets (that are {@link ExecutionUnit}s) from the given - * collection of {@code platformArchitecture}s. - */ - // TODO: Outdated Comment, the identification - @Deprecated - public static Collection<ExecutionUnit> - createDeploymentTargets(ExplorationSpecification expSpec) throws Exception { - Collection<ExecutionUnit> rval = new HashSet<>(); - - Collection<Allocation> allocConstrSet = - EcoreUtils.getChildrenWithType(expSpec, Allocation.class); - for(Allocation alloc : allocConstrSet) { - Collection<IModelElement> targetElementSet = - (Collection<IModelElement>)alloc.getRight().getSetReference().getEntries(); - filterStream(targetElementSet, e -> e instanceof ExecutionUnit) - .map(ExecutionUnit.class::cast).forEach(e -> rval.add(e)); - } - - // for(PlatformArchitecture curPA : platformArchitectures) { - // for(DeploymentGranularity deplAnn : getChildrenWithType(curPA, - // DeploymentGranularity.class)) { - // IModelElement execUnit = deplAnn.getSpecificationOf(); - // - // // If the current deployment target is a virtual ExecutionUnit, e.g. a partition, - // // ensure that none its referenced physical ExecutionUnits (or any of theri parents) - // // are also selected as deployment targets. - // if(execUnit instanceof IVirtualizationPlatformArchitectureElement && - // execUnit instanceof ExecutionUnit) { - // for(IHierarchicElement currentHardwareResource : getReferencedElementsWithType( - // execUnit, IHierarchicElement.class)) { - // if(isAnyParentDeploymentTarget(currentHardwareResource)) { - // String refHwResourceName = currentHardwareResource.toString(); - // if(currentHardwareResource instanceof INamedElement) { - // refHwResourceName = - // ((INamedElement)currentHardwareResource).getName() + - // "(id: " + - // ((INamedElement)currentHardwareResource).getId() + - // ")"; - // } - // throw new Exception("The referenced hardware resource " + - // refHwResourceName + - // " or one of its containers of the virtual element " + - // ((ExecutionUnit)execUnit).getName() + "(id: " + - // ((ExecutionUnit)execUnit).getId() + - // ") has been chosen as a deployment target.\n" + - // "This is not allowed for elements with a virtualization layer."); - // } - // } - // } - // - // if(execUnit instanceof ExecutionUnit && deplAnn.isIsDeploymentTarget()) { - // rval.add((ExecutionUnit)execUnit); - // } - // } - // } - - if(rval.isEmpty()) { - throw new Exception( - "No deployment targets have been specified in the target platform architecture(s)." + - " Please check whether the correct platform architecture was selected and whether" + - " the desired Execution Units were selected as deployment targets" + - " (Platform Model --> Annotation View --> Deployment Target)"); - } - - return rval; - } - - // TODO: Why is the FailureRate annotation bound to IPhysicalPlatformElement instead of - // IPlatformResource? - /** - * Creates a Map that relates all annotated {@link IPlatformArchitectureElement}s with their - * specified failure rate. - */ - @Deprecated - public static Map<IPlatformArchitectureElement, Double> createFailureRateMap( - Collection<PlatformArchitecture> platformArchitectures) throws Exception { - Map<IPlatformArchitectureElement, Double> failureRateMap = new HashMap<>(); - for(PlatformArchitecture pa : platformArchitectures) { - for(IPlatformArchitectureElement platformElement : getChildrenWithType(pa, - IPlatformArchitectureElement.class)) { - failureRateMap.put(platformElement, getResourceFailureRate(platformElement)); - } - } - - return failureRateMap; - } - - /** - * Extracts the failure probability of a given {@link IPlatformResource}. If the - * {@code resourceElement} is a {@link IVirtualizationPlatformArchitectureElement}, the average - * value of the referenced {@link IPhysicalPlatformArchitectureElement}s is used. - * - * @param resourceElement - * resource for which to determine the failure probability. - * @return failure probability of the given {@code resourceElement}. - * @throws Exception - * if the failure probability is not correctly defined in the model. - */ - // TODO: check, whether it make sense to move the failure rate annotation to the AF3 platform - // since it would allow a simple analysis of hierarchical platforms. - @Deprecated - public static Double getResourceFailureRate(IPlatformArchitectureElement resourceElement) - throws Exception { - - // If the annotated element is a part of the system software, the resource links are used to - // determine the speed of the associated resources. - if(resourceElement instanceof IVirtualizationPlatformArchitectureElement) { - Collection<IPhysicalPlatformArchitectureElement> associatedResources = - getReferencedElementsWithType(resourceElement, - IPhysicalPlatformArchitectureElement.class); - - if(!(associatedResources.isEmpty())) { - Double avgFailureRate = Double.valueOf(0); - for(IPhysicalPlatformArchitectureElement currentAssociatedResource : associatedResources) { - if(currentAssociatedResource instanceof IModelElement) { - // TODO: For now, just use a default value. - return 10E-6; - // FailureRate failureRateAnnotation = - // getAnnotation((IModelElement)currentAssociatedResource, - // FailureRate.class); - // - // if(failureRateAnnotation != null) { - // avgFailureRate += failureRateAnnotation.getFailureRate_FIT(); - // } else { - // throw new Exception("The platform resource " + - // currentAssociatedResource + - // " does not have a failure rate annotation."); - // } - } - } - - return avgFailureRate / associatedResources.size(); - } else if(resourceElement instanceof ExecutionUnit) { - // For now the failure rates are only evaluated for ExecutionUnits, so the failure - // rate annotation is only required for these resources. - throw new Exception("The virtual resource " + resourceElement.toString() + - " does not reference a physical resource"); - } - } else { - // TODO: For now, just use a default value. - return 10E-6; - // FailureRate failureRateAnnotation = - // pickFirstInstanceOf(FailureRate.class, - // ((IModelElement)resourceElement).getSpecifications()); - // - // if(failureRateAnnotation != null) { - // return failureRateAnnotation.getFailureRate_FIT(); - // } - // throw new Exception("The platform resource " + resourceElement + - // " does not have a failure rate annotation."); - } - - return null; - // throw new Exception("The failure rate for the platform resource " + resourceElement + - // " coult not be determined."); - } - - /** - * Creates a map of all {@link IPlatformResource} which have an annotated power consumption - * value and their specified value. - */ - @Deprecated - public static Map<IPlatformResource, Double> createPowerConsumptionMap( - Collection<PlatformArchitecture> platformArchitectures) throws Exception { - Map<IPlatformResource, Double> powerConsumptionMap = new HashMap<>(); - powerConsumptionMap.putAll(getTransmissionUnitPowerConsumption(platformArchitectures)); - return powerConsumptionMap; - } - - /** Maps all {@link TransmissionUnit}s to their annotated power consumption value. */ - // TODO: We need a way to define the energy consumed by transmission units like busses: stand-by - // + active. Currently, we hard-code the consumed energy while a transmission Unit is active - // while we assue that it does not consume energy in the idle state. - @Deprecated - public static Map<IPlatformResource, Double> getTransmissionUnitPowerConsumption( - Collection<PlatformArchitecture> platformArchitectures) { - Map<IPlatformResource, Double> powerConsumptionMap = new HashMap<>(); - for(PlatformArchitecture pa : platformArchitectures) { - for(TransmissionUnit tu : getChildrenWithType(pa, TransmissionUnit.class)) { - powerConsumptionMap.put(tu, 1.0); - } - } - - return powerConsumptionMap; - } - - /** - * Maps all deployable {@link Component}s to their specified periodicities. Non-periodic - * {@link Component} are not supported. - */ - // TODO: The period is hard-coded here. It must be taken from the yet-to-come timing model. - @Deprecated - public static Map<Component, Double> - createComponentPeriodMap(Collection<Component> deployableComponents) { - Map<Component, Double> componentPeriodMap = new HashMap<>(); - for(Component deployableComponent : deployableComponents) { - componentPeriodMap.put(deployableComponent, 10.0); - } - return componentPeriodMap; - } - - /** - * Maps all "abstract" and deployable {@link Component}s the set of {@link Component}s which are - * selected as their diverse implementations by means of the {@link ComponentDiverseImplRef} - * annotation. - */ - @Deprecated - public static Multimap<Component, Component> - createComponentReplacementMap(Collection<Component> deployableComponent) { - Multimap<Component, Component> replacementComponentMap = HashMultimap.create(); - for(Component component : deployableComponent) { - // ComponentDiverseImplRef componentReplacementRef = - // AnnotationUtils.getAnnotation(component, ComponentDiverseImplRef.class); - // replacementComponentMap.putAll(component, componentReplacementRef.getComponentRef()); - replacementComponentMap.putAll(component, Collections.emptyList()); - } - return replacementComponentMap; - } - - /** - * Maps all deployable {@link Component}s to their amount of minimal required and maximally - * allowed replicas. A value of 1 implies that the component is present only once (without - * actual replica in the resulting solution calculated by the DSE). - */ - // TODO: How to handle replication? Will be done on the Task level. Annotation can be registered - // in THIS exploration plugin. - @Deprecated - public static Map<Component, Pair<Integer, Integer>> createComponentReplicationMap( - Collection<Component> deployableComponents) throws Exception { - Map<Component, Pair<Integer, Integer>> replicationBoundMap = new HashMap<>(); - for(Component component : deployableComponents) { - // ReplicationBounds replicationBounds = getAnnotation(component, - // ReplicationBounds.class); - // if(replicationBounds == null) { - // throw new Exception("The replication bounds of the component " + - // component.getName() + " is not defined."); - // } - Pair<Integer, Integer> minMaxBounds = new Pair<>(1, 1); - replicationBoundMap.put(component, minMaxBounds); - } - - return replicationBoundMap; - } - - /** - * Returns the temporal triggers of the deployable {@link Component}s' {@link Port}s. - * - * @param deployableComponents - * Collection of {@link Component}s tthat shall be deployed. - * @return Map of the ports with a temporal trigger. - */ - @Deprecated - public static TemporalTriggers - getPortTimingProperties(DeployableComponents deployableComponents) { - TemporalTriggers portSignalTypes = new TemporalTriggers(); - Collection<Port> allPorts = new ArrayList<>(); - for(Component currComp : deployableComponents) { - allPorts.addAll(getChildrenWithType(currComp, Port.class)); - } - allPorts.parallelStream().forEach(p -> portSignalTypes.put(p, SignalType.PERIODIC)); - return portSignalTypes; - } - - /** Maps the {@link OutputPort}s of {@link Component}s to their respective bit size. */ - @Deprecated - public static Map<OutputPort, Long> - createMessageSizeMap(Collection<Component> deployableComponents) throws Exception { - Map<OutputPort, Long> messageSizes = new HashMap<>(); - for(Component component : deployableComponents) { - for(OutputPort port : component.getOutputPorts()) { - IType outType = port.getVariableType(); - // TODO: Primitive fixed bit length assignments for the types. Should be done based - // on the platform. - if(outType instanceof TBool) { - messageSizes.put(port, (long)1); - } else if(outType instanceof TInt) { - messageSizes.put(port, (long)32); - } else if(outType instanceof TDouble) { - messageSizes.put(port, (long)64); - } else { - throw new Exception("No type has been defined for the output port" + port + - " that is compatible with the MOEA-based DSE exploration."); - } - } - } - - return messageSizes; - } - - /** - * Creates a container that contains all required and optional information to execute the - * MOEA-based DSE which are not AF3 standard parameters. - */ - @Deprecated - public static SystemParameterContainer createSystemParameterContainer( - PlatformArchitecture platformArchitecture, TaskArchitecture taskArchitecture, - ExplorationSpecification expSpec) throws Exception { - DeployableComponents deployableComponents = new DeployableComponents(); - // TODO: We select the atomic components from the ComponentArchitecture to be deployed at - // the moment. Instead, the TaskArchitecture should be used here. - for(TaskAllocation taskAlloc : taskArchitecture.getTaskAllocations()) { - deployableComponents.addAll(taskAlloc.getComponents()); - } - - // Set: if we have only a hardware platform, then it will be returned by getHardwarePlatform - // --> no duplicates. - Set<PlatformArchitecture> targetPlatforms = new HashSet<>(); - targetPlatforms.add(platformArchitecture); - targetPlatforms.add( - PlatformArchitectureUtils.getPhysicalPlatformArchitecture(platformArchitecture)); - - Collection<ExecutionUnit> deploymentTargets = createDeploymentTargets(expSpec); - - return new SystemParameterContainer(deployableComponents, - getPortTimingProperties(deployableComponents), deploymentTargets, - createComponentPeriodMap(deployableComponents), - createComponentReplacementMap(deployableComponents), - createComponentReplicationMap(deployableComponents), - createMessageSizeMap(deployableComponents), createFailureRateMap(targetPlatforms), - createPowerConsumptionMap(targetPlatforms), connectionTypeLUT, null, null); - } -}