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

Start the deprecation of the Genotyped annotation & PA feature fixes

parent b550af6b
No related branches found
No related tags found
No related merge requests found
Showing
with 57 additions and 152 deletions
DseProcessProblemModule.java 5b2c29705d8e3a038204e20ec6e87c71ccf99760 RED DseProcessProblemModule.java 1c8018fcf28860cbac2cd41e5bc2b572580c0fa9 RED
Opt4JDseTask.java b5cb9e664e7a8fc2b5157bcdcaca740c2fa85336 RED Opt4JDseTask.java b5cb9e664e7a8fc2b5157bcdcaca740c2fa85336 RED
Opt4JDseTaskProvider.java 5e0c1b29c2a00582cb231af97c9ed293663c5e42 YELLOW Opt4JDseTaskProvider.java 5e0c1b29c2a00582cb231af97c9ed293663c5e42 YELLOW
Opt4JExplorationSolutionTransformer.java 238b3fc2f2312e2ec3f28ac75c113221683764ae RED Opt4JExplorationSolutionTransformer.java 238b3fc2f2312e2ec3f28ac75c113221683764ae RED
......
...@@ -16,29 +16,23 @@ ...@@ -16,29 +16,23 @@
package org.fortiss.af3.exploration.alg.dse.backend.opt4j; package org.fortiss.af3.exploration.alg.dse.backend.opt4j;
import static com.google.inject.Guice.createInjector; import static com.google.inject.Guice.createInjector;
import static java.util.stream.Collectors.toMap;
import static org.fortiss.af3.exploration.alg.service.ExplorationServiceManager.getService; import static org.fortiss.af3.exploration.alg.service.ExplorationServiceManager.getService;
import static org.fortiss.af3.exploration.alg.service.internal.ExplorationFeatureGraph.getFeatureAnnotatedArtifacts; import static org.fortiss.af3.exploration.alg.service.internal.ExplorationFeatureGraph.getFeatureAnnotatedArtifacts;
import static org.fortiss.af3.exploration.alg.util.ExplorationFeatureUtils.getEnabledCreators; import static org.fortiss.af3.exploration.alg.util.ExplorationFeatureUtils.getEnabledCreators;
import static org.fortiss.af3.exploration.alg.util.ExplorationFeatureUtils.getEnabledDecoders; import static org.fortiss.af3.exploration.alg.util.ExplorationFeatureUtils.getEnabledDecoders;
import java.lang.annotation.Annotation;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Map;
import java.util.Set; import java.util.Set;
import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInterceptor;
import org.fortiss.af3.exploration.alg.dse.InternalD3SEConfigurationProvider; import org.fortiss.af3.exploration.alg.dse.InternalD3SEConfigurationProvider;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.EncodingProviderModule;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.GenericProcessOperatorModule; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.GenericProcessOperatorModule;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.IterationTimeListener; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.IterationTimeListener;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.create.GuiceCreator; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.create.GuiceCreator;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.create.SubCreatorModule; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.create.SubCreatorModule;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.decode.GuiceDecoder; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.decode.GuiceDecoder;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.decode.SubDecoderModule; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.decode.SubDecoderModule;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.genotype.GenotypeProviderGenerator;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.genotype.Genotyped;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.graph.DependentPhenotypeFinder; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.graph.DependentPhenotypeFinder;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.graph.GenotypeFinder; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.graph.GenotypeFinder;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.phenotype.Phenotype; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.phenotype.Phenotype;
...@@ -50,7 +44,6 @@ import org.fortiss.af3.exploration.alg.module.DecoderModule; ...@@ -50,7 +44,6 @@ import org.fortiss.af3.exploration.alg.module.DecoderModule;
import org.fortiss.af3.exploration.alg.module.IEvaluatorModule; import org.fortiss.af3.exploration.alg.module.IEvaluatorModule;
import org.fortiss.af3.exploration.alg.module.common.input.InputProviderModule; import org.fortiss.af3.exploration.alg.module.common.input.InputProviderModule;
import org.fortiss.af3.exploration.alg.service.IExplorationEvaluationService; import org.fortiss.af3.exploration.alg.service.IExplorationEvaluationService;
import org.fortiss.af3.exploration.alg.service.IExplorationFeatureService;
import org.fortiss.af3.exploration.alg.util.ExplorationAlgUtils; import org.fortiss.af3.exploration.alg.util.ExplorationAlgUtils;
import org.fortiss.af3.exploration.model.ExplorationSpecification; import org.fortiss.af3.exploration.model.ExplorationSpecification;
import org.fortiss.af3.exploration.model.ExplorationTarget; import org.fortiss.af3.exploration.model.ExplorationTarget;
...@@ -92,6 +85,12 @@ public class DseProcessProblemModule extends ProblemModule { ...@@ -92,6 +85,12 @@ public class DseProcessProblemModule extends ProblemModule {
/** References the internal encodings related to the requested Solutions. */ /** References the internal encodings related to the requested Solutions. */
private Set<TypeLiteral<? extends Phenotype>> requestedSolutions; private Set<TypeLiteral<? extends Phenotype>> requestedSolutions;
/** {@link CreatorModule}s enabled by the selected D3SE features. */
private Collection<Class<? extends CreatorModule<?>>> enabledCreators;
/** {@link DecoderModule}s enabled by the selected D3SE features. */
private Collection<Class<? extends DecoderModule<?>>> enabledDecoders;
/** /**
* Instances of {@link IEvaluatorModule}s defined by the {@link ExplorationTarget}s of the * Instances of {@link IEvaluatorModule}s defined by the {@link ExplorationTarget}s of the
* {@link ExplorationSpecification}. * {@link ExplorationSpecification}.
...@@ -104,6 +103,9 @@ public class DseProcessProblemModule extends ProblemModule { ...@@ -104,6 +103,9 @@ public class DseProcessProblemModule extends ProblemModule {
public DseProcessProblemModule(Injector dseInjector) { public DseProcessProblemModule(Injector dseInjector) {
this.dseInjector = dseInjector; this.dseInjector = dseInjector;
this.dse = dseInjector.getInstance(DseSpecification.class); this.dse = dseInjector.getInstance(DseSpecification.class);
this.enabledCreators = getEnabledCreators(dse.getApplicableFeatures());
this.enabledDecoders = getEnabledDecoders(dse.getApplicableFeatures());
} }
/** /**
...@@ -124,9 +126,6 @@ public class DseProcessProblemModule extends ProblemModule { ...@@ -124,9 +126,6 @@ public class DseProcessProblemModule extends ProblemModule {
.getInstance(Key.get(new TypeLiteral<Set<TypeLiteral<? extends Phenotype>>>() {/**/ .getInstance(Key.get(new TypeLiteral<Set<TypeLiteral<? extends Phenotype>>>() {/**/
})); }));
Collection<Class<? extends DecoderModule<?>>> enabledDecoders =
getEnabledDecoders(dse.getApplicableFeatures());
InputProviderModule inputProviderModule = InputProviderModule inputProviderModule =
dseInjector.getInstance(InputProviderModule.class); dseInjector.getInstance(InputProviderModule.class);
Injector protoDecodingInjector = Injector protoDecodingInjector =
...@@ -173,27 +172,17 @@ public class DseProcessProblemModule extends ProblemModule { ...@@ -173,27 +172,17 @@ public class DseProcessProblemModule extends ProblemModule {
private Injector createProtoDecodingInjector( private Injector createProtoDecodingInjector(
Collection<Class<? extends DecoderModule<?>>> enabledDecoders, Collection<Class<? extends DecoderModule<?>>> enabledDecoders,
InputProviderModule inputProviderModule) { InputProviderModule inputProviderModule) {
// We must create and install the Genotype Prototype Providers here to allow Guice analysing
// the dependencies correctly (all available Genotypes are used therefore).
Collection<IExplorationFeature> enabledFeatures =
dseInjector.getInstance(DseSpecification.class).getApplicableFeatures();
Collection<TypeLiteral<? extends Genotype>> availableGenotypes =
getService(IExplorationFeatureService.class)
.getCreatableGenotypesOf(enabledFeatures);
Map<TypeLiteral<? extends Genotype>, Class<? extends Annotation>> provideAnnotations =
availableGenotypes.stream().collect(toMap(g -> g, g -> Genotyped.class));
// TODO(AD): Just use a genotype binding --> no impl needed.
EncodingProviderModule<Genotype> protoGenoProviderModule =
new GenotypeProviderGenerator(availableGenotypes, provideAnnotations)
.getEncodingProviderModule();
InternalD3SEConfigurationProvider cfgProvider = InternalD3SEConfigurationProvider cfgProvider =
dseInjector.getInstance(InternalD3SEConfigurationProvider.class); dseInjector.getInstance(InternalD3SEConfigurationProvider.class);
SubDecoderModule scModule = new SubDecoderModule(enabledDecoders, cfgProvider, MultiThreadingModule mThreadingModule = dseInjector.getInstance(MultiThreadingModule.class);
dseInjector.getInstance(MultiThreadingModule.class));
SubCreatorModule scModule = new SubCreatorModule(enabledCreators, enabledDecoders,
cfgProvider, mThreadingModule);
SubDecoderModule sdModule =
new SubDecoderModule(enabledDecoders, cfgProvider, mThreadingModule);
Injector decodingInjector = Guice.createInjector(scModule, inputProviderModule, Injector decodingInjector =
protoGenoProviderModule, cfgProvider); createInjector(inputProviderModule, scModule, sdModule, cfgProvider);
return decodingInjector; return decodingInjector;
} }
......
GuiceCreator.java 2befc0c44eec5d0b51ea1bad4eec8776ef328908 RED GuiceCreator.java 2befc0c44eec5d0b51ea1bad4eec8776ef328908 RED
SubCreatorModule.java b6f399af830add04c9a7c884c5b97f044f8c86da YELLOW SubCreatorModule.java 84a56a49bcd3ec9f395ce2e6a55e046adcd3c5a5 YELLOW
...@@ -86,11 +86,5 @@ public class SubCreatorModule extends AbstractModule { ...@@ -86,11 +86,5 @@ public class SubCreatorModule extends AbstractModule {
enabledCreators.add(module); enabledCreators.add(module);
install(module); install(module);
} }
Injector decodeModInjector = Guice.createInjector(cfgProvider, decodeInterceptModule);
for(Class<? extends DecoderModule<?>> moduleType : enabledDecoderTypes) {
DecoderModule<?> module = decodeModInjector.getInstance(Key.get(moduleType));
install(module);
}
} }
} }
...@@ -2,4 +2,4 @@ DecodeInterceptor.java 81dd9aa33bb4574cf2b442cc2348a26e05849830 YELLOW ...@@ -2,4 +2,4 @@ DecodeInterceptor.java 81dd9aa33bb4574cf2b442cc2348a26e05849830 YELLOW
DecodingInterceptModule.java 59817f29feb0f2a63510f07a946bdac5f3039794 YELLOW DecodingInterceptModule.java 59817f29feb0f2a63510f07a946bdac5f3039794 YELLOW
GuiceDecoder.java 9bd22b0638ef879f7b0999677760dcf45552fd73 YELLOW GuiceDecoder.java 9bd22b0638ef879f7b0999677760dcf45552fd73 YELLOW
PluginDecoder.java aa3d9b13e068743a7565b59772314edca0cf7363 YELLOW PluginDecoder.java aa3d9b13e068743a7565b59772314edca0cf7363 YELLOW
SubDecoderModule.java 72a553d68d7468611a5eab91766ebd63a68a133b YELLOW SubDecoderModule.java d36aade5105a64716c34a418ce035a65915e975c YELLOW
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
package org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.decode; package org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.decode;
import static com.google.inject.Guice.createInjector;
import java.util.Collection; import java.util.Collection;
import org.fortiss.af3.exploration.alg.dse.InternalD3SEConfigurationProvider; import org.fortiss.af3.exploration.alg.dse.InternalD3SEConfigurationProvider;
...@@ -25,7 +27,6 @@ import org.fortiss.af3.exploration.alg.module.common.evaluator.BooleanValue; ...@@ -25,7 +27,6 @@ import org.fortiss.af3.exploration.alg.module.common.evaluator.BooleanValue;
import org.opt4j.core.Value; import org.opt4j.core.Value;
import com.google.inject.AbstractModule; import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector; import com.google.inject.Injector;
import com.google.inject.Key; import com.google.inject.Key;
import com.google.inject.Module; import com.google.inject.Module;
...@@ -72,10 +73,9 @@ public class SubDecoderModule extends AbstractModule { ...@@ -72,10 +73,9 @@ public class SubDecoderModule extends AbstractModule {
// Install a dummy value provider for the validate methods. // Install a dummy value provider for the validate methods.
install(new ValueProvider<Value<?>>(new BooleanValue(true))); install(new ValueProvider<Value<?>>(new BooleanValue(true)));
Injector decodeModInjector = Guice.createInjector(cfgProvider, decInterceptMod); Injector decodeModInjector = createInjector(cfgProvider, decInterceptMod);
for(Class<? extends DecoderModule<?>> moduleType : enabledDecoders) { for(Class<? extends DecoderModule<?>> moduleType : enabledDecoders) {
DecoderModule<?> module = decodeModInjector.getInstance(Key.get(moduleType)); DecoderModule<?> module = decodeModInjector.getInstance(Key.get(moduleType));
// module.configureOuterBindings(binder());
install(module); install(module);
} }
} }
......
PartitionArchitectureExploration.java e535f082b982c69e8c91c20e864197ffb33f76c2 YELLOW PartitionArchitectureExploration.java e535f082b982c69e8c91c20e864197ffb33f76c2 YELLOW
PartitionMappingDecoderGraph.java 20dc1f476f551c2434479bd00a599943a4b41b3f RED PartitionMappingDecoderGraph.java c811b84db407ccb6e1a437940fecf71fbbf70f96 RED
TaskPartitionMappingIdentityDecoder.java 4f28d6ed4dd07c975cf87c5b8a9853f4cb000c4f YELLOW TaskPartitionMappingIdentityDecoder.java 01cc4cd20122ddc3ff1498c3edb4fd7debbe74d7 YELLOW
...@@ -25,7 +25,6 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.thread.ThreadSc ...@@ -25,7 +25,6 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.thread.ThreadSc
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ICommunicationResourceAdapter; import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ICommunicationResourceAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IExecutionUnitAdapter; 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.IResourceAdapter;
import org.fortiss.af3.exploration.alg.feature.IExplorationFeature;
import org.fortiss.af3.exploration.alg.feature.partition.variable.Partition; import org.fortiss.af3.exploration.alg.feature.partition.variable.Partition;
import org.fortiss.af3.exploration.alg.feature.partition.variable.PartitionMappingEncoding; import org.fortiss.af3.exploration.alg.feature.partition.variable.PartitionMappingEncoding;
import org.fortiss.af3.exploration.alg.feature.platform.PlatformCommunicationGraphEncoding; import org.fortiss.af3.exploration.alg.feature.platform.PlatformCommunicationGraphEncoding;
...@@ -50,7 +49,7 @@ public class PartitionMappingDecoderGraph ...@@ -50,7 +49,7 @@ public class PartitionMappingDecoderGraph
/** Constructor. */ /** Constructor. */
@Inject @Inject
public PartitionMappingDecoderGraph(IExplorationFeature expFeature, public PartitionMappingDecoderGraph(PartitionArchitectureExploration expFeature,
ExplorationFeatureGraph featureGraph, ThreadScope scope) { ExplorationFeatureGraph featureGraph, ThreadScope scope) {
super(expFeature, featureGraph, scope); super(expFeature, featureGraph, scope);
} }
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
package org.fortiss.af3.exploration.alg.feature.partition; package org.fortiss.af3.exploration.alg.feature.partition;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.genotype.Genotyped;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.phenotype.Phenotype; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.phenotype.Phenotype;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.thread.ThreadScope; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.thread.ThreadScope;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IExecutionUnitAdapter; import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IExecutionUnitAdapter;
...@@ -52,16 +51,6 @@ public class TaskPartitionMappingIdentityDecoder ...@@ -52,16 +51,6 @@ public class TaskPartitionMappingIdentityDecoder
super(expFeature, featureGraph, scope); super(expFeature, featureGraph, scope);
} }
/**
* Decodes/Updates the given {@link TaskPartitionMappingEncoding} with the number of
* additional resources of an update {@link PartitionMappingEncoding}.
*/
@Provides
public TaskPartitionMappingEncoding decode(@Genotyped TaskPartitionMappingEncoding tpmEnc,
PartitionMappingEncoding partEnc) {
return alignWithResourceModifications(tpmEnc, partEnc.getRequesters());
}
/** Returns the {@link TaskPartitionMappingEncoding} as its interface. */ /** Returns the {@link TaskPartitionMappingEncoding} as its interface. */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Provides @Provides
......
ExecutionUnitSet.java 3fc1594455878a3bd8a2bab66f8be7701accbd5c YELLOW ExecutionUnitSet.java 3fc1594455878a3bd8a2bab66f8be7701accbd5c YELLOW
PlatformExecUnitSetProvider.java 69716e09fa8206572e319b0ba59e8d0fad8f652f YELLOW PlatformExecUnitSetProvider.java 69716e09fa8206572e319b0ba59e8d0fad8f652f YELLOW
TaskMappingExploration.java cd3586f9c064f8ab91edde8070e3a0efb1895aca RED TaskMappingExploration.java bc80c48ea9f3c45c6dd3aab2b17369c8913cd630 RED
/*-------------------------------------------------------------------------+
| Copyright 2019 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.feature.taskmapping;
import static java.util.stream.Collectors.toSet;
import java.util.Set;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.thread.ThreadScope;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IExecutionUnitAdapter;
import org.fortiss.af3.exploration.alg.feature.platform.PlatformCommunicationGraphEncoding;
import org.fortiss.af3.exploration.alg.module.DecoderModule;
import org.fortiss.af3.exploration.alg.service.internal.ExplorationFeatureGraph;
import org.opt4j.core.Genotype;
import com.google.inject.Inject;
import com.google.inject.Provides;
/**
* Generates a {@link ExecutionUnitSet} that wraps the set of {@link IExecutionUnitAdapter}s
* available for deployment onto a generated target platform.
*
* @author diewald
*/
public class PlatformExecUnitSetProvider extends DecoderModule<ExecutionUnitSet> {
/** Constructor. */
@Inject
public PlatformExecUnitSetProvider(TaskMappingExploration expFeature,
ExplorationFeatureGraph featureGraph, ThreadScope scope) {
super(expFeature, featureGraph, scope);
}
/** See {@link PlatformExecUnitSetProvider}. */
@Provides
public ExecutionUnitSet decode(PlatformCommunicationGraphEncoding pcgEnc) {
Set<IExecutionUnitAdapter> execUnitAdps = pcgEnc.getActualGraph().vertexSet().stream()
.filter(v -> v instanceof IExecutionUnitAdapter)
.map(IExecutionUnitAdapter.class::cast).collect(toSet());
return new ExecutionUnitSet(execUnitAdps);
}
/** {@inheritDoc} */
@Override
public ExecutionUnitSet decode(Genotype arg0) {
// Required by the framework.
return null;
}
/** {@inheritDoc} */
@Override
public void updateIndirectConstraints(ExecutionUnitSet encoding) {
// Not needed for this encoding.
}
}
...@@ -20,8 +20,6 @@ import static java.util.Arrays.asList; ...@@ -20,8 +20,6 @@ import static java.util.Arrays.asList;
import org.fortiss.af3.exploration.alg.feature.ExplorationFeature; import org.fortiss.af3.exploration.alg.feature.ExplorationFeature;
import org.fortiss.af3.exploration.alg.feature.taskmapping.evaluator.internal.TaskExUAssignmentConstraintEvaluator; import org.fortiss.af3.exploration.alg.feature.taskmapping.evaluator.internal.TaskExUAssignmentConstraintEvaluator;
import org.fortiss.af3.exploration.alg.feature.taskmapping.problem.TaskExUMappingIdentityDecoder; import org.fortiss.af3.exploration.alg.feature.taskmapping.problem.TaskExUMappingIdentityDecoder;
import org.fortiss.af3.exploration.alg.feature.taskmapping.problem.TaskGraphDecoder;
import org.fortiss.af3.exploration.alg.feature.taskmapping.problem.TaskGraphEncoding;
import org.fortiss.af3.exploration.alg.feature.taskmapping.problem.comm.MessageDecoder; import org.fortiss.af3.exploration.alg.feature.taskmapping.problem.comm.MessageDecoder;
import org.fortiss.af3.exploration.alg.feature.taskmapping.problem.comm.MessageEncoding; import org.fortiss.af3.exploration.alg.feature.taskmapping.problem.comm.MessageEncoding;
import org.fortiss.af3.exploration.alg.feature.taskmapping.transform.TaskToExUTransformation; import org.fortiss.af3.exploration.alg.feature.taskmapping.transform.TaskToExUTransformation;
...@@ -51,8 +49,6 @@ public class TaskMappingExploration extends ExplorationFeature { ...@@ -51,8 +49,6 @@ public class TaskMappingExploration extends ExplorationFeature {
addVariable(TypeLiteral.get(TaskExUMappingEncoding.class), TaskExUMappingCreator.class, addVariable(TypeLiteral.get(TaskExUMappingEncoding.class), TaskExUMappingCreator.class,
asList(MutateTaskExUMappingModule.class, CrossoverTaskExUMappingModule.class)); asList(MutateTaskExUMappingModule.class, CrossoverTaskExUMappingModule.class));
addProblem(TypeLiteral.get(ExecutionUnitSet.class), PlatformExecUnitSetProvider.class);
addProblem(TypeLiteral.get(TaskGraphEncoding.class), TaskGraphDecoder.class);
addProblem(TypeLiteral.get(TaskExUMappingEncoding.class), addProblem(TypeLiteral.get(TaskExUMappingEncoding.class),
TaskExUMappingIdentityDecoder.class); TaskExUMappingIdentityDecoder.class);
addProblem(TypeLiteral.get(MessageEncoding.class), MessageDecoder.class); addProblem(TypeLiteral.get(MessageEncoding.class), MessageDecoder.class);
......
TaskExUMappingIdentityDecoder.java 7d4f7c5c4aec161eef89de0ae00f14913353604a YELLOW TaskExUMappingIdentityDecoder.java e2872fe77a058d87f3fd09ce509d8b01bd0fad9d YELLOW
TaskGraphDecoder.java 907a7481d65dbe1a84ab476a982d242a376f5952 YELLOW TaskGraphDecoder.java 907a7481d65dbe1a84ab476a982d242a376f5952 YELLOW
TaskGraphEncoding.java 76754df03470a58f328e75111c42adbecd6cb5ce YELLOW TaskGraphEncoding.java 76754df03470a58f328e75111c42adbecd6cb5ce YELLOW
TaskGraphEncodingBase.java f9d0d9a8b4f6616866443f263de17c84f88683b3 YELLOW TaskGraphEncodingBase.java f9d0d9a8b4f6616866443f263de17c84f88683b3 YELLOW
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
package org.fortiss.af3.exploration.alg.feature.taskmapping.problem; package org.fortiss.af3.exploration.alg.feature.taskmapping.problem;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.IdentityArtifact;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.phenotype.Phenotype; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.phenotype.Phenotype;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.thread.ThreadScope; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.thread.ThreadScope;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IExecutionUnitAdapter; import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IExecutionUnitAdapter;
...@@ -23,7 +22,6 @@ import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter; ...@@ -23,7 +22,6 @@ import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
import org.fortiss.af3.exploration.alg.feature.partition.variable.Partition; import org.fortiss.af3.exploration.alg.feature.partition.variable.Partition;
import org.fortiss.af3.exploration.alg.feature.partition.variable.PartitionMappingEncoding; import org.fortiss.af3.exploration.alg.feature.partition.variable.PartitionMappingEncoding;
import org.fortiss.af3.exploration.alg.feature.partition.variable.TaskPartitionMappingEncoding; import org.fortiss.af3.exploration.alg.feature.partition.variable.TaskPartitionMappingEncoding;
import org.fortiss.af3.exploration.alg.feature.taskmapping.ExecutionUnitSet;
import org.fortiss.af3.exploration.alg.feature.taskmapping.TaskMappingExploration; import org.fortiss.af3.exploration.alg.feature.taskmapping.TaskMappingExploration;
import org.fortiss.af3.exploration.alg.feature.taskmapping.variable.TaskExUMappingEncoding; import org.fortiss.af3.exploration.alg.feature.taskmapping.variable.TaskExUMappingEncoding;
import org.fortiss.af3.exploration.alg.module.common.MappingDecoderBase; import org.fortiss.af3.exploration.alg.module.common.MappingDecoderBase;
...@@ -68,17 +66,17 @@ public class TaskExUMappingIdentityDecoder ...@@ -68,17 +66,17 @@ public class TaskExUMappingIdentityDecoder
return TypeLiteral.get(IExecutionUnitAdapter.class); return TypeLiteral.get(IExecutionUnitAdapter.class);
} }
/** // /**
* Decodes/Updates the given {@link TaskPartitionMappingEncoding} with the number of // * Decodes/Updates the given {@link TaskPartitionMappingEncoding} with the number of
* additional resources of an update {@link PartitionMappingEncoding}. // * additional resources of an update {@link PartitionMappingEncoding}.
*/ // */
@Provides // @Provides
@IdentityArtifact // @IdentityArtifact
public TaskExUMappingEncoding decode(TaskExUMappingEncoding temEnc, // public TaskExUMappingEncoding decode(TaskExUMappingEncoding temEnc,
ExecutionUnitSet execUnitSet) { // ExecutionUnitSet execUnitSet) {
alignWithResourceModifications(temEnc, execUnitSet.getExecutionUnits()); // alignWithResourceModifications(temEnc, execUnitSet.getExecutionUnits());
return temEnc; // return temEnc;
} // }
/** Returns the {@link TaskExUMappingEncoding} as its interface. */ /** Returns the {@link TaskExUMappingEncoding} as its interface. */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
......
CreatorModule.java 7ee1e524ddc325607928ea5834d7e6a4e23cd59e YELLOW CreatorModule.java 8f4516d2df275fca99bac1128e35cbf475299274 YELLOW
D3SEConstrainedModule.java be41554ba553334310cba7195fb504bb0cfe677d YELLOW D3SEConstrainedModule.java be41554ba553334310cba7195fb504bb0cfe677d YELLOW
D3SEModule.java 74bc02e6c6920393216d782d1d8c5f89730356b4 RED D3SEModule.java 74bc02e6c6920393216d782d1d8c5f89730356b4 RED
DecoderModule.java e110e69987eab65f2eafd0f05a256e6d598e834f YELLOW DecoderModule.java e110e69987eab65f2eafd0f05a256e6d598e834f YELLOW
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
package org.fortiss.af3.exploration.alg.module; package org.fortiss.af3.exploration.alg.module;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.genotype.Genotyped; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.feature.Features;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.thread.ThreadScope; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.d3seext.thread.ThreadScope;
import org.fortiss.af3.exploration.alg.feature.IExplorationFeature; import org.fortiss.af3.exploration.alg.feature.IExplorationFeature;
import org.fortiss.af3.exploration.alg.service.internal.ExplorationFeatureGraph; import org.fortiss.af3.exploration.alg.service.internal.ExplorationFeatureGraph;
...@@ -49,8 +49,8 @@ public abstract class CreatorModule<G extends Genotype> extends D3SEConstrainedM ...@@ -49,8 +49,8 @@ public abstract class CreatorModule<G extends Genotype> extends D3SEConstrainedM
// consumption. // consumption.
IProvidingModule.getProvidedTypes((Class<? extends IProvidingModule<?>>)getClass()) IProvidingModule.getProvidedTypes((Class<? extends IProvidingModule<?>>)getClass())
.forEach(t -> { .forEach(t -> {
Key<Object> exposedKey = Key<Object> exposedKey = (Key<Object>)Key.get(t.getTypeLiteral(),
(Key<Object>)Key.get(t.getTypeLiteral(), Genotyped.class); Features.get(expFeature.getClass()));
bind(exposedKey).to(t); bind(exposedKey).to(t);
expose(exposedKey); expose(exposedKey);
}); });
......
...@@ -2,13 +2,13 @@ AllResourceInputModule.java 3ce5e093bd45acd6458bd56187e79eb1d70929c9 YELLOW ...@@ -2,13 +2,13 @@ AllResourceInputModule.java 3ce5e093bd45acd6458bd56187e79eb1d70929c9 YELLOW
ComponentInputModule.java fca128bb919588a3767d3f0ee41b9b2a20e72d31 YELLOW ComponentInputModule.java fca128bb919588a3767d3f0ee41b9b2a20e72d31 YELLOW
ContainmentInputModule.java a2e4a55ed2e4eb8fad1760ef84157c339a4c2a27 YELLOW ContainmentInputModule.java a2e4a55ed2e4eb8fad1760ef84157c339a4c2a27 YELLOW
DeployableTaskModule.java 576e0bc74a719f33d848b10da0599730d0d42ab6 YELLOW DeployableTaskModule.java 576e0bc74a719f33d848b10da0599730d0d42ab6 YELLOW
ExecutionUnitTargetModule.java a51691a8d6f67bf64cc75cd6c58744f44f67ab73 YELLOW ExecutionUnitTargetModule.java ea6d6418ddc3f4af40d568d87a3531309c316de7 YELLOW
GatewayUnitInputModule.java b9961a2dee46ad0a28eee641396b57e78ac84c34 YELLOW GatewayUnitInputModule.java b9961a2dee46ad0a28eee641396b57e78ac84c34 YELLOW
InputProviderModule.java 96a63c599bb287f99305f9733320a9d3daab9a97 YELLOW InputProviderModule.java 96a63c599bb287f99305f9733320a9d3daab9a97 YELLOW
MemoryUnitInputModule.java 027fbd5b8fd0dcfa4af62fa7a12e61f13fc57663 YELLOW MemoryUnitInputModule.java 027fbd5b8fd0dcfa4af62fa7a12e61f13fc57663 YELLOW
PlatformCommunicationGraphInputModule.java 5bdfda90c3fa48ca02ec677e8c9928b5889d0dd9 YELLOW PlatformCommunicationGraphInputModule.java 5bdfda90c3fa48ca02ec677e8c9928b5889d0dd9 YELLOW
ResourceConnectionModule.java 7193c9e19b085b9f1571ed2306797f50f169f74f RED ResourceConnectionModule.java 7193c9e19b085b9f1571ed2306797f50f169f74f RED
SafetyFunctionModule.java bc89b96b4713c7e3aaff34f8fe88e85fc740328c YELLOW SafetyFunctionModule.java bc89b96b4713c7e3aaff34f8fe88e85fc740328c YELLOW
TaskGraphInputModule.java 3ebadfbddd7a1e2802701b466816f13944b1f8f9 YELLOW TaskGraphInputModule.java e98da2f722abffee276ccac287566084d4570bd8 YELLOW
TaskSignalInputModule.java 95fac4ead6ca78bdbad31417e6683dc58d47b890 RED TaskSignalInputModule.java 95fac4ead6ca78bdbad31417e6683dc58d47b890 RED
TransmissionUnitInputModule.java 99baf869c40925a24b43a326095df80c1398921a YELLOW TransmissionUnitInputModule.java 99baf869c40925a24b43a326095df80c1398921a YELLOW
...@@ -21,6 +21,7 @@ import java.util.Set; ...@@ -21,6 +21,7 @@ import java.util.Set;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IExecutionUnitAdapter; import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IExecutionUnitAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.af3.AF3ExecutionUnitAdapter; import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.af3.AF3ExecutionUnitAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.mappers.ExecUnitMapper; import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.mappers.ExecUnitMapper;
import org.fortiss.af3.exploration.alg.feature.taskmapping.ExecutionUnitSet;
import org.fortiss.af3.exploration.alg.module.InputModule; import org.fortiss.af3.exploration.alg.module.InputModule;
import org.fortiss.af3.exploration.dseml.model.expression.SuperSet; import org.fortiss.af3.exploration.dseml.model.expression.SuperSet;
import org.fortiss.af3.platform.model.ExecutionUnit; import org.fortiss.af3.platform.model.ExecutionUnit;
...@@ -48,6 +49,15 @@ public class ExecutionUnitTargetModule extends InputModule<Set<IExecutionUnitAda ...@@ -48,6 +49,15 @@ public class ExecutionUnitTargetModule extends InputModule<Set<IExecutionUnitAda
return execUnitTargets; return execUnitTargets;
} }
/**
* Provides the {@link ExecutionUnitSet} abstraction of the execution unit resources. It is .
*/
@Provides
@Singleton
public ExecutionUnitSet getExecutionUnitSet(Set<IExecutionUnitAdapter> execUnits) {
return new ExecutionUnitSet(execUnits);
}
/** /**
* {@link Provides}s the {@link ExecUnitMapper} constructed from the set of input * {@link Provides}s the {@link ExecUnitMapper} constructed from the set of input
* {@link IExecutionUnitAdapter}s. * {@link IExecutionUnitAdapter}s.
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
+--------------------------------------------------------------------------*/ +--------------------------------------------------------------------------*/
package org.fortiss.af3.exploration.alg.module.common.input; package org.fortiss.af3.exploration.alg.module.common.input;
import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -45,8 +44,7 @@ public class TaskGraphInputModule extends InputModule<TaskGraphEncoding> { ...@@ -45,8 +44,7 @@ public class TaskGraphInputModule extends InputModule<TaskGraphEncoding> {
/** See {@link TaskGraphInputModule}. */ /** See {@link TaskGraphInputModule}. */
@Provides @Provides
@Singleton @Singleton
public Collection<TaskGraph> getTaskGraphEnc(Set<ITaskAdapter> tasks, public TaskGraphEncoding getTaskGraphEnc(Set<ITaskAdapter> tasks, Set<ISignalAdapter> signals) {
Set<ISignalAdapter> signals) {
DefaultTaskGraph<ITaskAdapter, ?> monolithicTaskGraph = new TaskGraph(); DefaultTaskGraph<ITaskAdapter, ?> monolithicTaskGraph = new TaskGraph();
monolithicTaskGraph.addAllTask(tasks); monolithicTaskGraph.addAllTask(tasks);
monolithicTaskGraph.addAllSignals(signals); monolithicTaskGraph.addAllSignals(signals);
...@@ -71,6 +69,6 @@ public class TaskGraphInputModule extends InputModule<TaskGraphEncoding> { ...@@ -71,6 +69,6 @@ public class TaskGraphInputModule extends InputModule<TaskGraphEncoding> {
independentTaskGraphs.add(taskGraph); independentTaskGraphs.add(taskGraph);
} }
return independentTaskGraphs; return new TaskGraphEncoding(independentTaskGraphs);
} }
} }
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