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

Exploration.alg: Resolve multiple warnings.

parent 729f08f7
No related branches found
No related tags found
No related merge requests found
Showing
with 68 additions and 47 deletions
CompositeExplorationSolution.java 528283a3dd57500539b2e11dd3d3eb35512de9b8 RED
DSEFactory.java e8a221bb175a30be7d4e780c58c2ba809980c47b RED
Explorer.java 367aeeeeb26d22791c640e1b74c0af43277a3037 RED
DSEFactory.java 4a1dab2f05976a1bd191aef340b94b62ef0c6ece RED
Explorer.java b14a77607cfadf81aed523d7b53b14559482c44c RED
ImplicitExplorationTargetFactory.java 7ce651a2161c71a2a90acf0f32b1e50ee23f160f RED
SolutionQuantification.java efd31f192c3adbf1a4434452a19eb836a17390e2 RED
TaskMappingFactory.java f8f5541a563b46050daaf1c6a854c233e90792f7 RED
TaskMappingFactory.java 5c01939ddbc3bf44d81094f4112dbd301a26dee4 RED
......@@ -122,7 +122,7 @@ public class DSEFactory {
createSafetyFunctionArchProblem(archExpProblemModule, systemModelAdapter, execDepGraph);
}
createPartitionMappingProblem(archExpProblemModule, dse, systemModelAdapter, execDepGraph);
createPlatformCommunicationGraphProblem(archExpProblemModule, dse, systemModelAdapter,
createPlatformCommunicationGraphProblem(archExpProblemModule, systemModelAdapter,
execDepGraph);
createAbstractTaskMappingProblem(tmFactory, archExpProblemModule, dse, systemModelAdapter,
execDepGraph);
......@@ -211,8 +211,14 @@ public class DSEFactory {
archExpProblemModule.registerSubProblem(pmEnodingClass, pmCreator, pmDecoders);
}
/**
* Creates a subproblem to obtain a flat graph of the communication network of target platform.
* It is intended to connect the virtual and physical architecture. The implementation as an
* encoding allows to consider changes made to the target platform during the exploration.
*/
@SuppressWarnings("unchecked")
private void createPlatformCommunicationGraphProblem(
ArchitectureExplorationProblemModule archExpProblemModule, DseSpecification dse,
ArchitectureExplorationProblemModule archExpProblemModule,
SystemModelAdapter<?, ?, ?, ?, ?, ?> systemModelAdapter,
DecoderDependencyGraph execDepGraph) throws CycleFoundException {
Class<PlatformCommunicationGraphEncoding> pmEnodingClass =
......@@ -223,7 +229,6 @@ public class DSEFactory {
@SuppressWarnings("rawtypes") List<ComposableDecoder> pmDecoders = new ArrayList<>();
PartitionMappingDecoderGraph pmgDecoder = new PartitionMappingDecoderGraph();
pmDecoders.add(pmgDecoder);
// pmCreator.registerAssocDecoders(pmgDecoder);
archExpProblemModule.registerSubProblem(pmEnodingClass, pmCreator, pmDecoders);
}
......@@ -335,6 +340,7 @@ public class DSEFactory {
* @throws UnsupportedDataTypeException
* if the given {@link ExecutionModel} is not "wrapped" to factory in this method.
*/
@SuppressWarnings("unchecked")
public <S extends TaskMappingEntry<?, Partition>>
TaskMappingFactory<?, ? extends TaskMappingEncoding<?, S>>
createTaskMappingFactory(ExecutionModel execModel) throws UnsupportedDataTypeException {
......
Opt4JExplorationSolutionSet.java fd1ca946198990604ea7a521e9d0335bef4ad8e1 RED
Opt4JExplorerBackend.java b647535f92ebdf1e428757f6fe1e918964feb4f2 RED
Opt4JExplorerBackend.java 1cbe89233576aa55d6705b92fc31934a5f4eb584 RED
Opt4JSingleExplorationSolution.java 5b9e6ccdb887605faaa4d2a8b17b8fa1350fbafd RED
PartitionMappingCreator.java 9c831443bf9cdc547dede8df28dcaf8cfac3ab55 RED
PartitionMappingCreator.java dd76847eaeb119609c58ea7412cd9ae4330d7a7e RED
PlatformCommunicationGraphCreator.java dca11304889fd796f721c4035940290a602659fb RED
ArchExpSubEncoding.java 60e13a2cb13bb36e9f8f7149f322dbed5398eafb RED
ArchitectureExplorationEncoding.java e7ff265079ae5838bf84abf9d05712409031a970 RED
MappingEncoding.java f7db94bf2af8dd5817ad564135d226301c6b41d5 RED
MappingEntryBase.java f173c8ee60dd175e9bc1240d1e1cc14d46d24d69 RED
MappingEncoding.java f23852b2e5ae6e327a6c5609142e0307ca6bf5a1 RED
MappingEntryBase.java 11073c027f7f28dfa1a8a3fe80cca68b0a66b48a RED
......@@ -119,6 +119,7 @@ public abstract class MappingEncoding<G extends Genotype, S extends IRequestAdap
return allocationMap.keySet();
}
/** {@inheritDoc} */
@Override
public abstract MappingEncoding<G, S, T, M> clone();
}
......@@ -27,6 +27,8 @@ import com.google.common.collect.ClassToInstanceMap;
import com.google.common.collect.MutableClassToInstanceMap;
/**
* Base class for {@link IMappingEntry}s. Defines fields for source and target allocations plus
* associated mapping entries residing in other {@link MappingEncoding} than the current one.
*
* @author diewald
*/
......@@ -42,6 +44,7 @@ public abstract class MappingEntryBase<S extends IRequestAdapter<?>, T extends I
protected ClassToInstanceMap<IMappingEntry<S, T>> associatedEntries =
MutableClassToInstanceMap.create();
/** Constructor. */
public MappingEntryBase(S source, T target) {
this.source = source;
this.target = target;
......@@ -84,6 +87,7 @@ public abstract class MappingEntryBase<S extends IRequestAdapter<?>, T extends I
return associatedEntries.getInstance(type);
}
/** {@inheritDoc} */
@Override
public abstract IMappingEntry<S, T> clone();
}
InternalIsolatedCommunicationSet.java 3957bb1e915e770b731e671900913a135b78b475 RED
InternalIsolatedCommunicationSet.java 250ff5f0ee41829b051b4c597810ae80dc73a0cc RED
......@@ -48,9 +48,9 @@ public class InternalIsolatedCommunicationSet extends EObjectImpl
private boolean isSoft = false;
private Set<IMappingEntry> isolatedCommunicationSet;
private Set<IMappingEntry<?, ?>> isolatedCommunicationSet;
public InternalIsolatedCommunicationSet(Set<IMappingEntry> isolatedCommunicationSet) {
public InternalIsolatedCommunicationSet(Set<IMappingEntry<?, ?>> isolatedCommunicationSet) {
this.isolatedCommunicationSet = isolatedCommunicationSet;
}
......@@ -121,30 +121,32 @@ public class InternalIsolatedCommunicationSet extends EObjectImpl
// NOP.
}
public Set<IMappingEntry> getIsolatedCommunicationSet() {
public Set<IMappingEntry<?, ?>> getIsolatedCommunicationSet() {
return isolatedCommunicationSet;
}
public void setIsolatedCommunicationSet(Set<IMappingEntry> isolatedCommunicationSet) {
public void setIsolatedCommunicationSet(Set<IMappingEntry<?, ?>> isolatedCommunicationSet) {
this.isolatedCommunicationSet = isolatedCommunicationSet;
}
public void addToIsolatedCommunicationSet(Collection<? extends IMappingEntry> addEntries) {
public void
addToIsolatedCommunicationSet(Collection<? extends IMappingEntry<?, ?>> addEntries) {
this.isolatedCommunicationSet.addAll(addEntries);
}
public void removeFromIsolatedCommunicationSet(Collection<? extends IMappingEntry> rmEntries) {
public void removeFromIsolatedCommunicationSet(
Collection<? extends IMappingEntry<?, ?>> rmEntries) {
this.isolatedCommunicationSet.removeAll(rmEntries);
}
public void replaceEntry(IMappingEntry oldEntry, IMappingEntry newEntry) {
public void replaceEntry(IMappingEntry<?, ?> oldEntry, IMappingEntry<?, ?> newEntry) {
this.isolatedCommunicationSet.remove(oldEntry);
this.isolatedCommunicationSet.add(newEntry);
}
public void replaceEntriesIfPresent(
Map<? extends IMappingEntry, ? extends IMappingEntry> replacementMap) {
for(Entry<? extends IMappingEntry, ? extends IMappingEntry> entry : replacementMap
Map<? extends IMappingEntry<?, ?>, ? extends IMappingEntry<?, ?>> replacementMap) {
for(Entry<? extends IMappingEntry<?, ?>, ? extends IMappingEntry<?, ?>> entry : replacementMap
.entrySet()) {
if(contains(entry.getKey())) {
replaceEntry(entry.getKey(), entry.getValue());
......@@ -152,7 +154,7 @@ public class InternalIsolatedCommunicationSet extends EObjectImpl
}
}
public boolean contains(IMappingEntry entry) {
public boolean contains(IMappingEntry<?, ?> entry) {
return isolatedCommunicationSet.contains(entry);
}
......
Partition.java b870fdd306818d8195b662daee9546feebb28e18 RED
PartitionMappingEncoding.java 91d0233fc1e2301b40cc955defa82dafadc724df RED
PartitionMappingEntry.java 16130a3bd2f157c4f5f5ef6cb91d1b72137f0acd RED
PartitionMappingEncoding.java 09dd8deba0a922ba9f5bdf8138676e945095edfc RED
PartitionMappingEntry.java 2f8f082e6bcd49dbe2f5ba88724850b54b20d637 RED
......@@ -36,10 +36,18 @@ import org.fortiss.af3.exploration.alg.dse.sysmodel.random.RandomExploration;
public class PartitionMappingEncoding extends
MappingEncoding<PartitionMappingEncoding, Partition, IResourceAdapter<?>, PartitionMappingEntry>
implements ComposableGenotype, Cloneable {
/** Set of physical target resources, i.e., execution units. */
private Collection<? extends IResourceAdapter<?>> targetSet;
/** Strategy that defines how the initial mapping is constructed. */
public enum CREATE_STARTEGY {
MIN_SET, RANDOM_SET, MAX_SET
/** One Partition per physical execution unit. */
MIN_SET,
/** Random number of partitions per physical execution unit. */
RANDOM_SET,
/** Same number of partitions per physical execution units as tasks exist in the system. */
MAX_SET
}
/** Constructor. */
......
PlatformCommunicationGraphEncoding.java 92da4ce692afa447c13769a3bda1f3bb1fa7d783 RED
......@@ -84,8 +84,6 @@ public class PlatformCommunicationGraphEncoding implements IExplorationEncoding,
public PlatformCommunicationGraphEncoding newInstance() {
PlatformCommunicationGraphEncoding pcgEncoding =
new PlatformCommunicationGraphEncoding(systemModelAdapter, this.platformGraph);
// Graphs.addGraph(pcgEncoding.platformGraph, this.platformGraph);
return pcgEncoding;
}
......
AbstractTaskGraphEncoding.java cb575233524890c6687479dc65d782b5836c0858 RED
InstantiatedAcyclicTaskGraphEncoding.java 1af9264d3486603df67ac8cd223348429566d81c RED
InstantiatedTaskGraphEncoding.java 7b2e02e92ec82f8c6a796d19c01de6ff82f12cfc RED
AbstractTaskGraphEncoding.java 79c2482106c0fa2895dc5ca2760bc68e8199ea89 RED
InstantiatedAcyclicTaskGraphEncoding.java 5446f693086aaa2a0b39e1c8180af186a7c55809 RED
InstantiatedTaskGraphEncoding.java 1ffb6b33efb6673d51a8ef99822caf42f43b2782 RED
SafeTaskGraphEncoding.java 49f4c06f6db45e7751794bcc7e3892570c8daa29 RED
TaskGraphEncoding.java 96dee6e872b408cef6630b700da2ee91eb5e2853 RED
TaskGraphEncoding.java 85067f10567e2104119c61d8e599a7f28f18932d RED
......@@ -27,8 +27,8 @@ import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.taskgraph.TaskGraph;
*
* @author diewald
*/
public class AbstractTaskGraphEncoding<G extends ComposableGenotype, C> extends
TaskGraphEncoding<G, C, DefaultTaskGraph> {
public class AbstractTaskGraphEncoding<G extends ComposableGenotype, C>
extends TaskGraphEncoding<G, C, DefaultTaskGraph<?>> {
/** Constructor. See {@link TaskGraphEncoding#TaskGraphEncoding(SystemModelAdapter)}. */
public AbstractTaskGraphEncoding(SystemModelAdapter<C, ?, ?, ?, ?, ?> systemModelAdapter) {
......
......@@ -40,7 +40,7 @@ public class InstantiatedAcyclicTaskGraphEncoding<T extends InstantiatedTaskMapp
*/
public InstantiatedAcyclicTaskGraphEncoding(
SystemModelAdapter<C, ?, ?, ?, ?, ?> systemModelAdapter,
Collection<DefaultTaskGraph> taskGraphs) {
Collection<DefaultTaskGraph<?>> taskGraphs) {
super(systemModelAdapter, AcyclicTaskGraph.transformToAcyclicGraphs(taskGraphs));
}
......@@ -51,7 +51,8 @@ public class InstantiatedAcyclicTaskGraphEncoding<T extends InstantiatedTaskMapp
}
/** Copy Constructor. See {@link TaskGraphEncoding#TaskGraphEncoding(TaskGraphEncoding)}. */
public InstantiatedAcyclicTaskGraphEncoding(InstantiatedAcyclicTaskGraphEncoding<T, C> encoding) {
public InstantiatedAcyclicTaskGraphEncoding(
InstantiatedAcyclicTaskGraphEncoding<T, C> encoding) {
super(encoding);
}
......
......@@ -29,14 +29,14 @@ import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.taskgraph.TaskGraph;
*
* @author diewald
*/
public class InstantiatedTaskGraphEncoding<T extends InstantiatedTaskMappingEntry, C> extends
TaskGraphEncoding<InstantiatedTaskMappingEncoding<T>, C, DefaultTaskGraph> {
public class InstantiatedTaskGraphEncoding<T extends InstantiatedTaskMappingEntry, C>
extends TaskGraphEncoding<InstantiatedTaskMappingEncoding<T>, C, DefaultTaskGraph<?>> {
/**
* Constructor. See {@link TaskGraphEncoding#TaskGraphEncoding(SystemModelAdapter, Collection)}.
*/
public InstantiatedTaskGraphEncoding(SystemModelAdapter<C, ?, ?, ?, ?, ?> systemModelAdapter,
Collection<DefaultTaskGraph> taskGraphs) {
Collection<DefaultTaskGraph<?>> taskGraphs) {
super(systemModelAdapter, taskGraphs);
}
......
......@@ -39,8 +39,8 @@ import org.opt4j.core.Genotype;
*
* @author diewald
*/
public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph> implements
IExplorationEncoding, ComposablePhenotype<G>, Cloneable {
public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph>
implements IExplorationEncoding, ComposablePhenotype<G>, Cloneable {
/** References the {@link SystemModelAdapter} which adapts the input models. */
protected SystemModelAdapter<C, ?, ?, ?, ?, ?> systemModelAdapter;
......@@ -68,9 +68,8 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph> imple
public TaskGraphEncoding(SystemModelAdapter<C, ?, ?, ?, ?, ?> systemModelAdapter) {
this.systemModelAdapter = systemModelAdapter;
taskGraphs =
(Collection<T>)systemModelAdapter.getTaskGraphs().stream().map(tg -> tg.copy())
.collect(Collectors.toSet());
taskGraphs = (Collection<T>)systemModelAdapter.getTaskGraphs().stream().map(tg -> tg.copy())
.collect(Collectors.toSet());
replicableComponents.addAll(systemModelAdapter.getReplicableComponents());
deployableComponents.addAll(systemModelAdapter.getDeployableComponents());
......@@ -244,7 +243,7 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph> imple
* <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) {
TaskGraph taskGraph = getGraphOf(task, taskGraphs);
if(taskGraph != null) {
......@@ -280,8 +279,8 @@ public class TaskGraphEncoding<G extends Genotype, C, T extends TaskGraph> imple
* @return The asociated {@link IDeployableComponentAdapter}, or {@code null} if none can be
* identified.
*/
public synchronized IDeployableComponentAdapter<C> getDeployableComponentOf(
EObject originalEObject) {
public synchronized IDeployableComponentAdapter<C>
getDeployableComponentOf(EObject originalEObject) {
for(IDeployableComponentAdapter<C> deployableComponentAdapter : deployableComponents) {
if(deployableComponentAdapter.getObject() == originalEObject) {
return deployableComponentAdapter;
......
TaskMappingEncoding.java f2cc21b6294896288c9bfe70870bf38d0b30cb71 RED
TaskMappingEntry.java 83535c1ad58bc3016f2d9fe409d5b1f80394b501 RED
TaskMappingEncoding.java 18a5a3aa6edbfaf22497f329e7c4a99f526cc142 RED
TaskMappingEntry.java 6d6f0d8700aad210d47ee29f7581ed4f231c3d1a RED
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