Skip to content
Snippets Groups Projects
Commit 87b4312e authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Exploration.alg: Rename IDeployableComponentAdapter -> ITaskAdapter

* Above renaming.
* Introduce the empty IComponentAdapter interface to reference AF3 components.
refs 3254
parent 09c2fb06
No related branches found
No related tags found
No related merge requests found
Showing
with 115 additions and 115 deletions
CompositeExplorationSolution.java 528283a3dd57500539b2e11dd3d3eb35512de9b8 RED
DSEFactory.java 4a1dab2f05976a1bd191aef340b94b62ef0c6ece RED
DSEFactory.java d8163c2b1df1b9cc690367140096e4b29d4dd2ae RED
Explorer.java b14a77607cfadf81aed523d7b53b14559482c44c RED
ImplicitExplorationTargetFactory.java 7ce651a2161c71a2a90acf0f32b1e50ee23f160f RED
ImplicitExplorationTargetFactory.java 897d89b5d5beb580da9007290acc835ff15e1e7c RED
SolutionQuantification.java efd31f192c3adbf1a4434452a19eb836a17390e2 RED
TaskMappingFactory.java 5c01939ddbc3bf44d81094f4112dbd301a26dee4 RED
TaskMappingFactory.java 87cfb7ec5e24acb167fa4ffd7210b093fa5b5b4d RED
......@@ -58,7 +58,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.problem.taskmapping.ins
import org.fortiss.af3.exploration.alg.dse.evaluator.ArchitectureEvaluator;
import org.fortiss.af3.exploration.alg.dse.sysmodel.FailSilentExecModelFactory;
import org.fortiss.af3.exploration.alg.dse.sysmodel.FaultDetectionVotingExecModelFactory;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IDeployableComponentAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
import org.fortiss.af3.exploration.moea.model.DseSpecification;
import org.fortiss.af3.exploration.moea.model.feature.SafetyExploration;
......@@ -279,7 +279,7 @@ public class DSEFactory {
* describes
* the problem of instantiating a mapped logical/functional application architecture to a
* defined platform architecture. Here, the focus is on optimizing the instantiation of
* "abstract" {@link IDeployableComponentAdapter}s.
* "abstract" {@link ITaskAdapter}s.
*
* @param tmFactory
* Factory which manages the creation tasks associated with task mapping problems
......
......@@ -19,7 +19,7 @@ import java.util.ArrayList;
import java.util.Collection;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IDeployableComponentAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.taskgraph.TaskGraph;
import org.fortiss.af3.exploration.alg.exception.ConstraintGenerationException;
......@@ -97,7 +97,7 @@ public class ImplicitExplorationTargetFactory {
throws ConstraintGenerationException {
Collection<ExplorationConstraint<?>> constraints = new ArrayList<>();
for(TaskGraph tg : systemModelAdapter.getTaskGraphs()) {
for(IDeployableComponentAdapter<?> component : tg.getTasks()) {
for(ITaskAdapter<?> component : tg.getTasks()) {
if(!(component.getObject() instanceof Component)) {
throw new ConstraintGenerationException(PeriodConstraint.class,
"Invalid model element type for this constraint: " +
......
......@@ -35,7 +35,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.problem.comm.MessageDec
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.problem.instantiatetaskgraph.InstantiatedTaskMappingDecoder;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.problem.instantiatetaskgraph.InstantiatedTaskMappingDecoderAcyclic;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.problem.taskmapping.instantiate.AbstractTaskMappingDecoder;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IDeployableComponentAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.mapping.comm.IMessageRouter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.mapping.comm.ShortestPathRouter;
......@@ -295,7 +295,7 @@ public abstract class TaskMappingFactory<S extends InstantiatedTaskMappingEntry,
/**
* Creates a scheduling strategy-"independent" decoder for task mapping encodings. It provides a
* {@link ShortestPathRouter} to find the shortest communication path between two communicating
* instantiations of an {@link IDeployableComponentAdapter} for a given platform.
* instantiations of an {@link ITaskAdapter} for a given platform.
*/
public IMessageRouter
createShortestPathRouter(SystemModelAdapter<?, ?, ?, ?, ?, ?> systemModelAdapter) {
......
AbstractTaskMappingCreator.java 6c3f2cd98a2d40f6fc0e1dbfca0ce3cddc5a7961 RED
AbstractTaskMappingCreator.java 64a04dad3e653ee9b5bd91dfa842e2043eda3e94 RED
FailSilentTaskMappingCreator.java 6aa1828a87ab6bdaa8077101e004fe4ddddd8a7f RED
FaultDetectionVotingTaskMappingCreator.java 2cc96c6197eaafa803b9794246ff40346802342a RED
TaskMappingCreator.java d39c3554074646dfe9acc343c268baacd2960027 RED
TaskMappingCreator.java d3c381308b8c8cafda84feed0ea443f62ea563d3 RED
......@@ -23,7 +23,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegen
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.graph.DecoderDependencyGraph;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.FlatPhenotypeMap;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.Phenotype;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IDeployableComponentAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
import org.fortiss.af3.exploration.alg.exception.ExplorationException;
import org.fortiss.af3.exploration.alg.service.IExplorationEncoding;
......@@ -55,7 +55,7 @@ public class AbstractTaskMappingCreator
*
* @throws ExplorationException
* if no valid allocation targets can be identified for one
* {@link IDeployableComponentAdapter}.
* {@link ITaskAdapter}.
*/
@Override
public AbstractTaskMappingEncoding createComposable(FlatGenotypeMap createdGenotypes,
......
......@@ -20,7 +20,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.Ta
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.TaskMappingEntry;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.create.ComposableCreatorBase;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.graph.DecoderDependencyGraph;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IDeployableComponentAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
import org.fortiss.af3.exploration.moea.model.DseSpecification;
import org.opt4j.core.Genotype;
......@@ -34,7 +34,7 @@ import com.google.inject.Inject;
* @author huang
*/
public abstract class TaskMappingCreator<S extends TaskMappingEntry<IDeployableComponentAdapter<?>, Partition>, T extends TaskMappingEncoding<IDeployableComponentAdapter<?>, S>>
public abstract class TaskMappingCreator<S extends TaskMappingEntry<ITaskAdapter<?>, Partition>, T extends TaskMappingEncoding<ITaskAdapter<?>, S>>
extends ComposableCreatorBase<T> {
/** DSE specification. */
......
ArchExpSubEncoding.java 60e13a2cb13bb36e9f8f7149f322dbed5398eafb RED
ArchitectureExplorationEncoding.java e7ff265079ae5838bf84abf9d05712409031a970 RED
MappingEncoding.java f23852b2e5ae6e327a6c5609142e0307ca6bf5a1 RED
MappingEntryBase.java 11073c027f7f28dfa1a8a3fe80cca68b0a66b48a RED
MappingEntryBase.java 8dfa84697f5042eb09522d4fc49a58115c6e3027 RED
......@@ -18,7 +18,7 @@ package org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding;
import java.util.Collection;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.TaskMappingEntry;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IDeployableComponentAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IRequestAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IResourceAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.mapping.IMappingEntry;
......@@ -37,7 +37,7 @@ public abstract class MappingEntryBase<S extends IRequestAdapter<?>, T extends I
/** Deployment target to which task is mapped */
protected T target;
/** {@link IDeployableComponentAdapter} that is "realized" by this {@link TaskMappingEntry}. */
/** {@link ITaskAdapter} that is "realized" by this {@link TaskMappingEntry}. */
protected S source;
/** Associated {@link IMappingEntry}s that were generated during the DSE process. */
......
MessageEncoding.java 07156d0dd672656302f8d1eac27018ed32e718d1 RED
MessageEncoding.java f52ba1f6179357209a1fd265238746102a1c3728 RED
......@@ -23,7 +23,7 @@ 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.IDeployableComponentAdapter;
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;
......@@ -34,7 +34,7 @@ import org.fortiss.af3.exploration.backend.IDseInputContainer.SignalType;
*
* @author diewald
*/
public class MessageEncoding<S extends TaskMappingEntry<IDeployableComponentAdapter<?>, Partition>, T extends TaskMappingEncoding<IDeployableComponentAdapter<?>, S>>
public class MessageEncoding<S extends TaskMappingEntry<ITaskAdapter<?>, Partition>, T extends TaskMappingEncoding<ITaskAdapter<?>, S>>
implements IExplorationEncoding, ComposablePhenotype<T> {
/** Contains the set of generated messages. */
......
PlatformCommunicationGraphEncoding.java 92da4ce692afa447c13769a3bda1f3bb1fa7d783 RED
PlatformCommunicationGraphEncoding.java cf2aba24c9e569e37996e57b2df017f83a3e28db RED
......@@ -18,7 +18,7 @@ package org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.platform;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.partitionmapping.PartitionMappingEncoding;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.genotype.ComposableGenotype;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.ComposablePhenotype;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IDeployableComponentAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IResourceAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
import org.fortiss.af3.exploration.alg.graph.display.JGraphTVisualizer;
......@@ -28,7 +28,7 @@ import org.jgrapht.graph.DefaultEdge;
/**
* Abstracts the communication network present in a platform system meta-model to a flat graph. This
* graph is needed to manage the communication of logical {@link IDeployableComponentAdapter}s after
* graph is needed to manage the communication of logical {@link ITaskAdapter}s after
* they have been deployed onto a concrete platform. More precisely, the graph is used for routing
* of (physical) messages and their scheduling on the communication resources, like busses.
*
......
......@@ -2,4 +2,4 @@ AbstractTaskGraphEncoding.java 79c2482106c0fa2895dc5ca2760bc68e8199ea89 RED
InstantiatedAcyclicTaskGraphEncoding.java 5446f693086aaa2a0b39e1c8180af186a7c55809 RED
InstantiatedTaskGraphEncoding.java 1ffb6b33efb6673d51a8ef99822caf42f43b2782 RED
SafeTaskGraphEncoding.java 49f4c06f6db45e7751794bcc7e3892570c8daa29 RED
TaskGraphEncoding.java 85067f10567e2104119c61d8e599a7f28f18932d RED
TaskGraphEncoding.java e9d40278aca607bd27a817c4859b493ef4c32ce3 RED
......@@ -24,7 +24,7 @@ import java.util.stream.Collectors;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.component.model.Component;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.ComposablePhenotype;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IDeployableComponentAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IExecutionUnitAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.taskgraph.ChannelAdapterWeightedEdge;
......@@ -49,20 +49,20 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph>
protected Collection<T> taskGraphs;
/**
* Collection of {@link IDeployableComponentAdapter}s that shall be mapped to deployment targets
* Collection of {@link ITaskAdapter}s that shall be mapped to deployment targets
* ({@link IExecutionUnitAdapter}).
*/
protected Collection<IDeployableComponentAdapter<C>> deployableComponents = new HashSet<>();
protected Collection<ITaskAdapter<C>> deployableComponents = new HashSet<>();
/**
* Subset of {@link IDeployableComponentAdapter}s from the collection of deployable components
* Subset of {@link ITaskAdapter}s from the collection of deployable components
* that may be replicated.
*/
protected Collection<IDeployableComponentAdapter<C>> replicableComponents = new HashSet<>();
protected Collection<ITaskAdapter<C>> replicableComponents = new HashSet<>();
/**
* Constructor that initializes {@code this} encoding with the collection of
* {@link IDeployableComponentAdapter}s as they are extracted from the input models.
* {@link ITaskAdapter}s as they are extracted from the input models.
*/
@SuppressWarnings("unchecked")
public TaskGraphEncoding(SystemModelAdapter<C, ?, ?, ?, ?, ?> systemModelAdapter) {
......@@ -77,7 +77,7 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph>
/**
* Constructor that initializes {@code this} encoding with the collection of
* {@link IDeployableComponentAdapter}s as they are extracted from the input models.
* {@link ITaskAdapter}s as they are extracted from the input models.
*/
public TaskGraphEncoding(SystemModelAdapter<C, ?, ?, ?, ?, ?> systemModelAdapter,
Collection<T> taskGraphs) {
......@@ -87,8 +87,8 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph>
this.deployableComponents.clear();
for(TaskGraph tg : taskGraphs) {
@SuppressWarnings("unchecked") Collection<? extends IDeployableComponentAdapter<C>> tasks =
(Collection<? extends IDeployableComponentAdapter<C>>)tg.getTasks();
@SuppressWarnings("unchecked") Collection<? extends ITaskAdapter<C>> tasks =
(Collection<? extends ITaskAdapter<C>>)tg.getTasks();
deployableComponents.addAll(tasks);
}
}
......@@ -109,10 +109,10 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph>
}
/**
* Adds the given {@link IDeployableComponentAdapter} to its corresponding {@link TaskGraph} in
* Adds the given {@link ITaskAdapter} to its corresponding {@link TaskGraph} in
* {@code this} encoding.
*/
public void addTask(IDeployableComponentAdapter<C> task) {
public void addTask(ITaskAdapter<C> task) {
// TODO: Here, we use the assumption that the given task refers to a task that is also
// present in the system model adapter.
......@@ -148,10 +148,10 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph>
/**
* Adds all signals defined in the input models for the given
* {@link IDeployableComponentAdapter} which must be contained in any of the internal
* {@link ITaskAdapter} which must be contained in any of the internal
* {@link TaskGraph}s.
*/
public void addSignalsOf(IDeployableComponentAdapter<C> task) {
public void addSignalsOf(ITaskAdapter<C> task) {
// The given task must be in the any of the task graphs!
T taskGraph = getGraphOf(task, taskGraphs);
......@@ -165,12 +165,12 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph>
systemTG.getGraph().outgoingEdgesOf(task);
for(ChannelAdapterWeightedEdge edge : incomingEdges) {
IDeployableComponentAdapter<?> source = systemTG.getGraph().getEdgeSource(edge);
ITaskAdapter<?> source = systemTG.getGraph().getEdgeSource(edge);
taskGraph.getGraph().addEdge(source, task, edge);
}
for(ChannelAdapterWeightedEdge edge : outgoingEdges) {
IDeployableComponentAdapter<?> target = systemTG.getGraph().getEdgeTarget(edge);
ITaskAdapter<?> target = systemTG.getGraph().getEdgeTarget(edge);
taskGraph.getGraph().addEdge(task, target, edge);
}
}
......@@ -179,8 +179,8 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph>
* Adds the signals of a cloned task by querying the existing signals from the clone's original
* task.
*/
public void addClonedSignalsOf(IDeployableComponentAdapter<C> originalTask,
IDeployableComponentAdapter<C> clonedTask) {
public void addClonedSignalsOf(ITaskAdapter<C> originalTask,
ITaskAdapter<C> clonedTask) {
// The given task must be in the any of the task graphs!
T taskGraph = getGraphOf(originalTask, taskGraphs);
......@@ -193,26 +193,26 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph>
taskGraph.getGraph().outgoingEdgesOf(originalTask);
for(ChannelAdapterWeightedEdge edge : incomingEdges) {
IDeployableComponentAdapter<?> source = taskGraph.getGraph().getEdgeSource(edge);
ITaskAdapter<?> source = taskGraph.getGraph().getEdgeSource(edge);
taskGraph.getGraph().addEdge(source, clonedTask,
new ChannelAdapterWeightedEdge(edge.getChannelAdapter()));
}
for(ChannelAdapterWeightedEdge edge : outgoingEdges) {
IDeployableComponentAdapter<?> target = taskGraph.getGraph().getEdgeTarget(edge);
ITaskAdapter<?> target = taskGraph.getGraph().getEdgeTarget(edge);
taskGraph.getGraph().addEdge(clonedTask, target,
new ChannelAdapterWeightedEdge(edge.getChannelAdapter()));
}
}
/**
* Clones the given {@link IDeployableComponentAdapter} and adds it to the corresponding task
* Clones the given {@link ITaskAdapter} and adds it to the corresponding task
* graph and further data structures.
*/
public IDeployableComponentAdapter<C> cloneTask(IDeployableComponentAdapter<C> task) {
public ITaskAdapter<C> cloneTask(ITaskAdapter<C> task) {
// Clone the task and add it to the corresponding task graph.
TaskGraph taskGraph = getGraphOf(task, taskGraphs);
IDeployableComponentAdapter<C> clonedTask = task.clone();
ITaskAdapter<C> clonedTask = task.clone();
taskGraph.addTask(clonedTask);
addClonedSignalsOf(task, clonedTask);
// Add the cloned task to the cache sets.
......@@ -227,24 +227,24 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph>
/** Returns the {@link TaskGraph} containing the given task or {@code null} if none is found. */
// TODO: Change the parameter again to IDeployableComponentAdapter<C>: pass the type parameter
// to the scheduler.
public T getTaskGraphOf(IDeployableComponentAdapter<?> task) {
public T getTaskGraphOf(ITaskAdapter<?> task) {
return getGraphOf(task, taskGraphs);
}
/** Whether {@code this} encoding contains the given task. */
public boolean containsTask(IDeployableComponentAdapter<C> task) {
public boolean containsTask(ITaskAdapter<C> task) {
return getGraphOf(task, taskGraphs) != null;
}
/**
* Removes the given {@link IDeployableComponentAdapter} from the {@link TaskGraph} containing
* Removes the given {@link ITaskAdapter} from the {@link TaskGraph} containing
* the particular task and from the caches.
* <p>
* <i>Side-note:</i> Each task may be located in only one {@link TaskGraph}.
*
* @returns {@code true} iff a containing {@link TaskGraph} has been found.
*/
public boolean removeTask(IDeployableComponentAdapter<C> task) {
public boolean removeTask(ITaskAdapter<C> task) {
TaskGraph taskGraph = getGraphOf(task, taskGraphs);
if(taskGraph != null) {
taskGraph.removeTask(task);
......@@ -260,9 +260,9 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph>
* Returns the deployable (software) component that are present in the internal
* {@link TaskGraph}s. May contain "abstract" {@link Component}s.
*/
public Collection<IDeployableComponentAdapter<?>> getDeployableComponents() {
public Collection<ITaskAdapter<?>> getDeployableComponents() {
// return deployableComponents;
Collection<IDeployableComponentAdapter<?>> deplComp = new HashSet<>();
Collection<ITaskAdapter<?>> deplComp = new HashSet<>();
for(T tg : taskGraphs) {
deplComp.addAll(tg.getTasks());
}
......@@ -271,17 +271,17 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph>
// TODO: Consider implementing this method as a map, since this operation is run often?
/**
* Returns the {@link IDeployableComponentAdapter} that is constructed form the given object.
* Returns the {@link ITaskAdapter} that is constructed form the given object.
*
* @param originalEObject
* The object for which the corresponding {@link IDeployableComponentAdapter} shall
* The object for which the corresponding {@link ITaskAdapter} shall
* be identified.
* @return The asociated {@link IDeployableComponentAdapter}, or {@code null} if none can be
* @return The asociated {@link ITaskAdapter}, or {@code null} if none can be
* identified.
*/
public synchronized IDeployableComponentAdapter<C>
public synchronized ITaskAdapter<C>
getDeployableComponentOf(EObject originalEObject) {
for(IDeployableComponentAdapter<C> deployableComponentAdapter : deployableComponents) {
for(ITaskAdapter<C> deployableComponentAdapter : deployableComponents) {
if(deployableComponentAdapter.getObject() == originalEObject) {
return deployableComponentAdapter;
}
......@@ -293,18 +293,18 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph>
* Returns the deployable (software) components that my be
* replicated. May contain "abstract" {@link Component}s.
*/
public Collection<IDeployableComponentAdapter<C>> getReplicableComponents() {
public Collection<ITaskAdapter<C>> getReplicableComponents() {
return replicableComponents;
}
/**
* Returns the {@link IDeployableComponentAdapter} that wraps the given {@link EObject}. Here,
* only those {@link IDeployableComponentAdapter} are searched which can be actually executed on
* Returns the {@link ITaskAdapter} that wraps the given {@link EObject}. Here,
* only those {@link ITaskAdapter} are searched which can be actually executed on
* {@link ExecutionUnit}s, i.e. "abstract" components are not considered.
*/
public IDeployableComponentAdapter<C>
public ITaskAdapter<C>
getReplicableDeployableComponentOf(EObject originalEObject) {
for(IDeployableComponentAdapter<C> deployableComponentAdapter : replicableComponents) {
for(ITaskAdapter<C> deployableComponentAdapter : replicableComponents) {
if(deployableComponentAdapter.getObject() == originalEObject) {
return deployableComponentAdapter;
}
......
TaskMappingEncoding.java 18a5a3aa6edbfaf22497f329e7c4a99f526cc142 RED
TaskMappingEntry.java 6d6f0d8700aad210d47ee29f7581ed4f231c3d1a RED
TaskMappingEncoding.java ff2ea5d0f4f9273d97968167e8b4e7a20ae44fea RED
TaskMappingEntry.java 8872e14a5d29f267ce2be78e9a3f3f817f16edd2 RED
......@@ -39,7 +39,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.co
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.constraint.InternalSeparationConstraint;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.genotype.ComposableGenotype;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.encoding.ConstrainedEncoding;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IDeployableComponentAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IExecutionUnitAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IResourceAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
......@@ -66,7 +66,7 @@ import com.google.common.collect.Multimap;
*/
// TODO: The CompositePhenotype is not typed correctly: An additional Type parameter would be needed
// for the subclass of TaskMappingEncoding and passed to the CompositePhenotype.
public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<?>, T extends TaskMappingEntry<S, Partition>>
public abstract class TaskMappingEncoding<S extends ITaskAdapter<?>, T extends TaskMappingEntry<S, Partition>>
extends MappingEncoding<TaskMappingEncoding<S, T>, S, Partition, T>
implements IMappingEncoding<S, Partition, T>, ComposableGenotype, ArchExpSubEncoding,
IExplorationEncoding, ConstrainedEncoding, Cloneable {
......@@ -85,27 +85,27 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
HashMultimap.create();
/**
* Map of disallowed {@link IDeployableComponentAdapter} -> {@link IExecutionUnitAdapter}
* Map of disallowed {@link ITaskAdapter} -> {@link IExecutionUnitAdapter}
* allocations.
*/
// TODO: Move to a central place, but where?
protected Multimap<IDeployableComponentAdapter<?>, IExecutionUnitAdapter<?>> disallowedAllocations;
protected Multimap<ITaskAdapter<?>, IExecutionUnitAdapter<?>> disallowedAllocations;
/**
* Map of disallowed {@link IDeployableComponentAdapter} -> {@link IExecutionUnitAdapter}
* Map of disallowed {@link ITaskAdapter} -> {@link IExecutionUnitAdapter}
* allocations.
*/
// TODO: Move to a central place, but where?
protected Multimap<IDeployableComponentAdapter<?>, IExecutionUnitAdapter<?>> allowedAllocations;
protected Multimap<ITaskAdapter<?>, IExecutionUnitAdapter<?>> allowedAllocations;
/** Deployable component adapters that shall not be considered by the redundancy operator. */
protected Collection<IDeployableComponentAdapter<?>> fixAllocatedComponents;
protected Collection<ITaskAdapter<?>> fixAllocatedComponents;
/** Representation of input system */
protected SystemModelAdapter<?, ?, ?, ?, ?, ?> systemModelAdapter;
/**
* Collection of deployable {@link IDeployableComponentAdapter}s represented by {@code this}
* Collection of deployable {@link ITaskAdapter}s represented by {@code this}
* mapping.
*/
protected Collection<S> deployableComponents;
......@@ -143,7 +143,7 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
*
* @throws ExplorationException
* if no valid allocation targets can be identified for one
* {@link IDeployableComponentAdapter}.
* {@link ITaskAdapter}.
*/
public TaskMappingEncoding(DseSpecification dse,
SystemModelAdapter<?, ?, ?, ?, ?, ?> systemModelAdapter, boolean initialize)
......@@ -160,7 +160,7 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
*
* @throws ExplorationException
* if no valid allocation targets can be identified for one
* {@link IDeployableComponentAdapter}.
* {@link ITaskAdapter}.
*/
public TaskMappingEncoding(DseSpecification dse,
SystemModelAdapter<?, ?, ?, ?, ?, ?> systemModelAdapter,
......@@ -177,12 +177,12 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
*
* @throws ExplorationException
* if no valid allocation targets can be identified for one
* {@link IDeployableComponentAdapter}.
* {@link ITaskAdapter}.
*/
public TaskMappingEncoding(DseSpecification dse,
SystemModelAdapter<?, ?, ?, ?, ?, ?> systemModelAdapter,
PartitionMappingEncoding partMappingEncoding, TaskGraphEncoding<?, ?, ?> tgEncoding,
TaskMappingEncoding<IDeployableComponentAdapter<?>, ?> incompleteEncoding)
TaskMappingEncoding<ITaskAdapter<?>, ?> incompleteEncoding)
throws ExplorationException {
this(dse, systemModelAdapter, partMappingEncoding, tgEncoding);
completeEncoding(incompleteEncoding);
......@@ -219,9 +219,9 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
*/
// TODO: Exchange this workaround with a mechanism that allows to "reserve" deployable
// components (-> marker) to not be processed by subsequent operators.
private Collection<IDeployableComponentAdapter<?>> createFixAllocationCollection() {
Collection<IDeployableComponentAdapter<?>> fixAllocatedComponents = new HashSet<>();
for(IDeployableComponentAdapter<?> compAdp : deployableComponents) {
private Collection<ITaskAdapter<?>> createFixAllocationCollection() {
Collection<ITaskAdapter<?>> fixAllocatedComponents = new HashSet<>();
for(ITaskAdapter<?> compAdp : deployableComponents) {
Optional<ComponentMultiDislocationConstraint> constr =
dse.getTargetSpecification().getTargets().stream()
.filter(c -> (c instanceof ComponentMultiDislocationConstraint))
......@@ -241,7 +241,7 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
*/
// TODO: Exchange this workaround with a mechanism that allows to "reserve" deployable
// components (-> marker) to not be processed by subsequent operators.
public void addFixAllocation(IDeployableComponentAdapter<?> compAdp,
public void addFixAllocation(ITaskAdapter<?> compAdp,
Collection<IExecutionUnitAdapter<?>> validAllocTargets) {
fixAllocatedComponents.add(compAdp);
validAllocTargets.forEach(t -> allowedAllocations.put(compAdp, t));
......@@ -251,16 +251,16 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
* Creates a map which refers those {@link IExecutionUnitAdapter}s that are invalid allocation
* targets of the given component.
*/
private Multimap<IDeployableComponentAdapter<?>, IExecutionUnitAdapter<?>>
private Multimap<ITaskAdapter<?>, IExecutionUnitAdapter<?>>
createDisallowedAllocationMap() {
Multimap<IDeployableComponentAdapter<?>, IExecutionUnitAdapter<?>> rval =
Multimap<ITaskAdapter<?>, IExecutionUnitAdapter<?>> rval =
HashMultimap.create();
Collection<ComponentMultiDislocationConstraint> forbiddenDeploymentConstraints =
getChildrenWithType(dse, ComponentMultiDislocationConstraint.class);
for(ComponentMultiDislocationConstraint currentConstraint : forbiddenDeploymentConstraints) {
for(IDeployableComponentAdapter<?> currentComponentAdapter : systemModelAdapter
for(ITaskAdapter<?> currentComponentAdapter : systemModelAdapter
.getDeployableComponents()) {
if(currentComponentAdapter.getObject() == currentConstraint.getComponent()) {
// TODO: Remove dependency on AF3 here.
......@@ -282,19 +282,19 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
/**
* Creates a lookup map that holds the collection of all disallowed mapping targets of
* {@link IDeployableComponentAdapter}s.
* {@link ITaskAdapter}s.
*/
private Multimap<IDeployableComponentAdapter<?>, IExecutionUnitAdapter<?>>
private Multimap<ITaskAdapter<?>, IExecutionUnitAdapter<?>>
createAllowedAllocationMap() {
Multimap<IDeployableComponentAdapter<?>, IExecutionUnitAdapter<?>> rval =
Multimap<ITaskAdapter<?>, IExecutionUnitAdapter<?>> rval =
HashMultimap.create();
Collection<ComponentMultiAllocationConstraint> allowedDeploymentConstraints =
getChildrenWithType(dse, ComponentMultiAllocationConstraint.class);
Collection<IDeployableComponentAdapter<?>> constrainedComponentAdps = new HashSet<>();
Collection<ITaskAdapter<?>> constrainedComponentAdps = new HashSet<>();
for(ComponentMultiAllocationConstraint currentConstraint : allowedDeploymentConstraints) {
for(IDeployableComponentAdapter<?> currentComponentAdapter : systemModelAdapter
for(ITaskAdapter<?> currentComponentAdapter : systemModelAdapter
.getDeployableComponents()) {
if(currentComponentAdapter.getObject() == currentConstraint.getComponent()) {
constrainedComponentAdps.add(currentComponentAdapter);
......@@ -313,7 +313,7 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
}
}
for(IDeployableComponentAdapter<?> curDeplComp : deployableComponents) {
for(ITaskAdapter<?> curDeplComp : deployableComponents) {
// TODO: create a field for the deployment targets.
if(!constrainedComponentAdps.contains(curDeplComp)) {
systemModelAdapter.getDeploymentTargets().forEach(t -> rval.put(curDeplComp, t));
......@@ -328,8 +328,8 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
* {@link ComponentMultiAllocationConstraint} is defined, otherwise {@code null} is returned.
*/
public Collection<IExecutionUnitAdapter<?>>
getAllowedAllocations(IDeployableComponentAdapter<?> deployableComponent) {
IDeployableComponentAdapter<?> origComponent = systemModelAdapter
getAllowedAllocations(ITaskAdapter<?> deployableComponent) {
ITaskAdapter<?> origComponent = systemModelAdapter
.getDeployableComponentOf((EObject)deployableComponent.getObject());
return allowedAllocations.get(origComponent);
}
......@@ -339,8 +339,8 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
* {@link ComponentMultiDislocationConstraint} is defined, otherwise null is returned.
*/
public Collection<IExecutionUnitAdapter<?>>
getDisAllowedAllocations(IDeployableComponentAdapter<?> deployableComponent) {
IDeployableComponentAdapter<?> origComponent = systemModelAdapter
getDisAllowedAllocations(ITaskAdapter<?> deployableComponent) {
ITaskAdapter<?> origComponent = systemModelAdapter
.getDeployableComponentOf((EObject)deployableComponent.getObject());
return disallowedAllocations.get(origComponent);
}
......@@ -387,7 +387,7 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
}
/**
* Initializes the allocation table for the {@link IDeployableComponentAdapter}s that are not
* Initializes the allocation table for the {@link ITaskAdapter}s that are not
* yet present in the given {@code incompleteEncoding}.
*
* @param incompleteEncoding
......@@ -425,7 +425,7 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
}
/**
* Creates {@link TaskMappingEntry}s for the given set of {@link IDeployableComponentAdapter}s.
* Creates {@link TaskMappingEntry}s for the given set of {@link ITaskAdapter}s.
*
* @param allocatableComponents
* Collection of components to generated {@link TaskMappingEntry}s for.
......@@ -478,7 +478,7 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
* Creates an (encoding specific) mapping entry the describes that a given deployable component
* is mapped to a deployment target.
*/
protected abstract T createEntry(IDeployableComponentAdapter<?> deployableComponent,
protected abstract T createEntry(ITaskAdapter<?> deployableComponent,
Partition deploymentTarget);
/**
......@@ -491,7 +491,7 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
* {@link TaskMappingEntry}.
* @return The created {@link TaskMappingEntry}.
*/
public <U extends TaskMappingEntry<IDeployableComponentAdapter<?>, Partition>> T
public <U extends TaskMappingEntry<ITaskAdapter<?>, Partition>> T
createAndAddEntry(U mappingEntry) {
T newEntry = createEntry(mappingEntry);
addAllocation(newEntry);
......@@ -507,7 +507,7 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
* derived.
* @return The created {@link TaskMappingEntry}.
*/
protected abstract <U extends TaskMappingEntry<IDeployableComponentAdapter<?>, Partition>> T
protected abstract <U extends TaskMappingEntry<ITaskAdapter<?>, Partition>> T
createEntry(U allocEntry);
/**
......@@ -587,7 +587,7 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
}
/**
* Removes a randomly selected entry of the given {@link IDeployableComponentAdapter} from the
* Removes a randomly selected entry of the given {@link ITaskAdapter} from the
* mapping.
*/
public T removeRandomEntry(S deployableComponent) {
......@@ -600,7 +600,7 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
}
/**
* Removes the given {@link IDeployableComponentAdapter} and, consequently, all associated
* Removes the given {@link ITaskAdapter} and, consequently, all associated
* entries from the mapping.
*/
@SuppressWarnings({"rawtypes", "unchecked"})
......@@ -616,7 +616,7 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
* Determines if a deployable component is subject to a
* {@link ComponentMultiAllocationConstraint}
*/
public boolean hasLimitedDeployment(IDeployableComponentAdapter<?> deployableComponent) {
public boolean hasLimitedDeployment(ITaskAdapter<?> deployableComponent) {
return allowedAllocations.containsKey(deployableComponent);
}
......@@ -678,7 +678,7 @@ public abstract class TaskMappingEncoding<S extends IDeployableComponentAdapter<
* {@link ComponentMultiDislocationConstraint}s.
*/
private Collection<IExecutionUnitAdapter<?>>
getExcludedDeploymentTargets(IDeployableComponentAdapter<?> deployableComponent) {
getExcludedDeploymentTargets(ITaskAdapter<?> deployableComponent) {
Collection<IExecutionUnitAdapter<?>> rval = getDisAllowedAllocations(deployableComponent);
// Collection<InternalSeparationConstraint> sepConstraints =
......
......@@ -16,14 +16,14 @@
package org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.MappingEntryBase;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IDeployableComponentAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IExecutionUnitAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IRequestAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IResourceAdapter;
/**
* Base class for {@link TaskMappingEntry}s representing the one allocation of an
* {@link IDeployableComponentAdapter} to an {@link IExecutionUnitAdapter}.
* {@link ITaskAdapter} to an {@link IExecutionUnitAdapter}.
*
* @author barner
*/
......
AbstractTaskMappingEncoding.java 3f3a6ad042d6eafebe3c3ed47f4ccbde11a2b8fb RED
AbstractTaskMappingEntry.java b039009446aa861a4a13fa4ceb479a4ca9818045 RED
AbstractTaskMappingEncoding.java 7c37f41a2322d747a90f6179a40c41da77d3e14f RED
AbstractTaskMappingEntry.java 0bef4c1102baf6bfbddc759fd103cf18df4b5553 RED
......@@ -27,7 +27,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.Ta
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.TaskMappingEntry;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.genotype.ComposableGenotype;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.ComposablePhenotype;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IDeployableComponentAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
import org.fortiss.af3.exploration.alg.exception.ExplorationException;
import org.fortiss.af3.exploration.moea.model.DseSpecification;
......@@ -40,7 +40,7 @@ import org.opt4j.core.Genotype;
* @author diewald
*/
public class AbstractTaskMappingEncoding
extends TaskMappingEncoding<IDeployableComponentAdapter<?>, AbstractTaskMappingEntry> {
extends TaskMappingEncoding<ITaskAdapter<?>, AbstractTaskMappingEntry> {
/**
* Constructor that is initialized with a reference to the DSE specification and the input
......@@ -57,7 +57,7 @@ public class AbstractTaskMappingEncoding
*
* @throws ExplorationException
* if no valid allocation targets can be identified for one
* {@link IDeployableComponentAdapter}.
* {@link ITaskAdapter}.
*/
public AbstractTaskMappingEncoding(DseSpecification dse,
SystemModelAdapter<?, ?, ?, ?, ?, ?> systemModelAdapter,
......@@ -78,7 +78,7 @@ public class AbstractTaskMappingEncoding
*
* @throws ExplorationException
* if no valid allocation targets can be identified for one
* {@link IDeployableComponentAdapter}.
* {@link ITaskAdapter}.
*/
public AbstractTaskMappingEncoding(DseSpecification dse,
SystemModelAdapter<?, ?, ?, ?, ?, ?> systemModelAdapter, boolean initialize)
......@@ -91,7 +91,7 @@ public class AbstractTaskMappingEncoding
*
* @throws ExplorationException
* if no valid allocation targets can be identified for one
* {@link IDeployableComponentAdapter}.
* {@link ITaskAdapter}.
*/
public AbstractTaskMappingEncoding(DseSpecification dse,
SystemModelAdapter<?, ?, ?, ?, ?, ?> systemModelAdapter,
......@@ -108,7 +108,7 @@ public class AbstractTaskMappingEncoding
*
* @throws ExplorationException
* if no valid allocation targets can be identified for one
* {@link IDeployableComponentAdapter}.
* {@link ITaskAdapter}.
*/
public AbstractTaskMappingEncoding(DseSpecification dse,
SystemModelAdapter<?, ?, ?, ?, ?, ?> systemModelAdapter,
......@@ -119,7 +119,7 @@ public class AbstractTaskMappingEncoding
/** {@inheritDoc} */
@Override
public AbstractTaskMappingEntry createEntry(IDeployableComponentAdapter<?> deployableComponent,
public AbstractTaskMappingEntry createEntry(ITaskAdapter<?> deployableComponent,
Partition deploymentTarget) {
// Request not needed to construct a {@link FailSilentTaskMappingEncoding}
if(deploymentTarget == null) {
......@@ -131,7 +131,7 @@ public class AbstractTaskMappingEncoding
/** {@inheritDoc} */
@Override
protected <S extends TaskMappingEntry<IDeployableComponentAdapter<?>, Partition>>
protected <S extends TaskMappingEntry<ITaskAdapter<?>, Partition>>
AbstractTaskMappingEntry createEntry(S allocEntry) {
// TODO: Remove the ugly casts.
return new AbstractTaskMappingEntry(allocEntry.getSource(), allocEntry.getTarget());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment