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

DSE-DI: Cleanup for DI-based decoders (DI --> Guice).


* Create a GuiceDecoder class that serves as a container at which
  Guice-based decoders can be registered. It calls the Decoder that
  provides the demanded output encoding (Provides annotation). The
  Guice injector will be responsible to resolve the dependencies between
  the decoders.
* Simplify the Phenotype classes such that there exists only a single
  phenotype that can host sub-phenotypes.
* Also remove the generic from the phenotype that declares it's primary
  input genotype: There is almost no gain in terms of safety/robustness
  versus a ton of code complications.

Signed-off-by: default avatarAlexander Diewald <diewald@fortiss.org>
parent 9bf4fcf3
No related branches found
No related tags found
1 merge request!2Dependency injection
Showing
with 52 additions and 48 deletions
common.ecore 3e3e3a1484cebe698e99621a60be4fa285238c92 RED
explorationDsl.ecore 6950a6116721764800ad6bf3b301e0dec934c365 RED
moea.ecore 099cf6fd45522f4b427d21f6bca28ec493e36c35 RED
ExplorationAlg.java 23b771227aa82ddc80f010e14d1ef977e47fbdd5 RED ExplorationAlg.java 7ef701a3a7624df35f3bb76048af31a41aafe3cd RED
ExplorationAlgActivator.java d51cc105f23cc84dee0130d36fbd5bbd840c0398 RED ExplorationAlgActivator.java 1970505dc53286fd3752c909abc568e0bf598fe0 RED
ComponentImplDiversityRefValueProvider.java d2cbe7d1acefd9941a766ea7cf2ac958a4347ef6 RED ComponentImplDiversityRefValueProvider.java 30d88e9a239c9e7db07d94b5279f0e9e01f0724a RED
MaxReplicationBoundValueProvider.java 78cde3b9543ff06c9310f96de8ad24e9feacc5d4 RED MaxReplicationBoundValueProvider.java 965e454e52d5ec88bf718c528caa12237e7ddeb6 RED
MinReplicationBoundValueProvider.java 7ef7176ae0f4e64ad0e0923f09f3bc8fe0a14b67 RED MinReplicationBoundValueProvider.java c6c1939474c0cd6b47bc89d1c068509039ef270e RED
Opt4JDseBackend.java f0485dc7fbc69c31f2f7fd15a7dad582ee5d7636 RED Opt4JDseBackend.java 91928dee43716df571dc3a6a5f4031401ed3ae61 RED
CompositeExplorationSolution.java 88849af9f8a52684cc523f89e235599e16dd9ac3 RED CompositeExplorationSolution.java 1910fcd1d1e4a1b003b7a4e1bb52460eec5362dd RED
DSEFactory.java 0a2f2cc6a197e760c1f8223339ffa5f16856b184 RED DSEFactory.java ae8a0f876a1db3372d116066db10aa1e736980ab RED
Explorer.java 2194a74cbe51ca9e7dafb008dcefb51a54064dc8 RED Explorer.java 91cdb26b6f42e4e5e82a26f7dbd9141ec2ff7b18 RED
ImplicitExplorationTargetFactory.java 6c16c6712886b549dda0a73aef4a4c3fe18c1850 RED ImplicitExplorationTargetFactory.java 25c3c668ed268843f8af7e37eb03370ed513b482 RED
SolutionQuantification.java efd31f192c3adbf1a4434452a19eb836a17390e2 RED SolutionQuantification.java 19cd7caa721bbca3112af7825c7fb20a96a4a799 RED
TaskMappingFactory.java 5e41df9d45e338dbcfa95bc3818ca17774951893 RED TaskMappingFactory.java 47e6b1cd8e26a4a5e775beddff030dcf5df2e33d RED
ExplorerBackendBase.java ed85fa4a1638a3e50df5dc2f9d8bfc09f158452c RED ExplorerBackendBase.java 3171b381ae145417c339607ccc57eb8037cbb354 RED
IExplorerBackend.java 92b54d5179ebb9fe969664a215e1fb701ed98d15 RED IExplorerBackend.java 608f40896becf86dd68cc7b6994383e58c0885a8 RED
SolutionCandidateBase.java d4b54cf5ec00fc62028d75c44068c99261af3a3c RED SolutionCandidateBase.java ba1b16d55680ea45bffd665ac7b0fd71b589b769 RED
...@@ -23,7 +23,7 @@ import javax.activation.UnsupportedDataTypeException; ...@@ -23,7 +23,7 @@ import javax.activation.UnsupportedDataTypeException;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.fortiss.af3.exploration.alg.dse.DSEFactory; import org.fortiss.af3.exploration.alg.dse.DSEFactory;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.ComposablePhenotype; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.Phenotype;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.Phenotype; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.Phenotype;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.problem.EvaluatorWrapper; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.problem.EvaluatorWrapper;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.solution.IExplorationSolution; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.solution.IExplorationSolution;
...@@ -62,7 +62,7 @@ public abstract class ExplorerBackendBase<O extends IOptimizer> implements IExpl ...@@ -62,7 +62,7 @@ public abstract class ExplorerBackendBase<O extends IOptimizer> implements IExpl
/** Representation of system model (=input) that is evaluated during this DSE run */ /** Representation of system model (=input) that is evaluated during this DSE run */
protected SystemModelAdapter<?, ?, ?, ?, ?, ?, ?> systemModelAdapter; protected SystemModelAdapter<?, ?, ?, ?, ?, ?, ?> systemModelAdapter;
/** Set of requested {@link ComposablePhenotype}s that form the solution set. */ /** Set of requested {@link Phenotype}s that form the solution set. */
protected Set<Class<? extends IExplorationEncoding>> requestedSolutions; protected Set<Class<? extends IExplorationEncoding>> requestedSolutions;
/** /**
......
Opt4JExplorationSolutionSet.java fd1ca946198990604ea7a521e9d0335bef4ad8e1 RED Opt4JExplorationSolutionSet.java 8578ee9c438bc3327a64172e996306a89606c782 RED
Opt4JExplorerBackend.java 60aa6a82a54b7fff0819591939fb91db10116bf1 RED Opt4JExplorerBackend.java 000231dcd7f3a76d06567c7bb987410fa80602ba RED
Opt4JSingleExplorationSolution.java 5b9e6ccdb887605faaa4d2a8b17b8fa1350fbafd RED Opt4JSingleExplorationSolution.java 41ce92d11b2e7a6a8c39bffa990c691160c36c8d RED
ArchitectureExplorationCreator.java d0a638d783ec90959bf1f95af42ea5a15606ebd2 RED ArchitectureExplorationCreator.java 1d101999bf56eca36a607b45c7e8fddb5fe06b67 RED
InitialEncodingProvider.java 20e7cff927769c1911855e1549eca382be3effea RED InitialEncodingProvider.java d378a0d5e952144ee93eff3557bd2253f84e62a9 RED
PartitionMappingCreator.java 624850b3bbf31e965005ed1acf8622e81f1103b6 RED PartitionMappingCreator.java 6c83f8a857b0fa1e1bf90121a91d58038ed5d9d0 RED
PlatformCommunicationGraphCreator.java fd016186eea8e716f9f6699b46c5d386acf2db8a RED PlatformCommunicationGraphCreator.java 54301f92ded2065b76a45ad27aeb6a8dcbac01fb RED
SafetyFunctionArchCreator.java 29178efd61d31c86d719a8fac9a110745e3cf5aa RED SafetyFunctionArchCreator.java e15712cd3dbf2a62f38c5dcad6cf101fff8525e1 RED
AbstractTaskMappingCreator.java f0cee5bfa4e83539c2b7ad2ac8e66c1457c39ab5 RED AbstractTaskMappingCreator.java 813a927b1b10b29e7707f4207901d3e0a3529b43 RED
FailSilentTaskMappingCreator.java e21d4f6d6ed24fb42adeb9cd9f7b0069aeb40fd5 RED FailSilentTaskMappingCreator.java 7375dc0d4c424606672e0fd88a2f97bf2f0c58ea RED
FaultDetectionVotingTaskMappingCreator.java 8b18ef5401d28cc61ba4ce3545c16d531289549e RED FaultDetectionVotingTaskMappingCreator.java 0b8ce4eb8f73d3fa0fa1d3ef0d4ffec2e2be253e RED
TaskMappingCreator.java 154b1528e3b96078a4f00a633adce5fbe6233151 RED TaskMappingCreator.java 1b09ee1d49cd4a8424d922fa605463f810063c78 RED
ArchExpSubEncoding.java 60e13a2cb13bb36e9f8f7149f322dbed5398eafb RED ArchExpSubEncoding.java 0cd944e97251e7e37e06400b104bc3158f5ee30e RED
ArchitectureExplorationEncoding.java e7ff265079ae5838bf84abf9d05712409031a970 RED ArchitectureExplorationEncoding.java fbc6b8031c3673ff380a044398faac7ee18dcc39 RED
MappingEncoding.java f23852b2e5ae6e327a6c5609142e0307ca6bf5a1 RED MappingEncoding.java 75baf2518a5be578cc35bfec4b2a305d29bef1e9 RED
MappingEntryBase.java 8dfa84697f5042eb09522d4fc49a58115c6e3027 RED MappingEntryBase.java 6c8e8c59126d3d381fc98284f2ce2bef469b0b4d RED
...@@ -23,7 +23,7 @@ import java.util.Map; ...@@ -23,7 +23,7 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.TaskMappingEncoding; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.TaskMappingEncoding;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.ComposablePhenotype; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.PhenotypeBase;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IRequestAdapter; 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.arch.IResourceAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.mapping.IMappingEncoding; import org.fortiss.af3.exploration.alg.dse.sysmodel.mapping.IMappingEncoding;
...@@ -40,7 +40,7 @@ import com.google.common.collect.ListMultimap; ...@@ -40,7 +40,7 @@ import com.google.common.collect.ListMultimap;
* @author diewald * @author diewald
*/ */
public abstract class MappingEncoding<G extends Genotype, S extends IRequestAdapter<?>, T extends IResourceAdapter<?>, M extends IMappingEntry<S, T>> public abstract class MappingEncoding<G extends Genotype, S extends IRequestAdapter<?>, T extends IResourceAdapter<?>, M extends IMappingEntry<S, T>>
implements ComposablePhenotype<G>, IMappingEncoding<S, T, M>, Cloneable { extends PhenotypeBase implements IMappingEncoding<S, T, M>, Cloneable {
/** /**
* Allocation map * Allocation map
......
MessageEncoding.java 523e16c2ec3d890b6715bfcd24ab39da4f850621 RED MessageEncoding.java bb8e1c30c878dc4fe0bc56aa097060ac003ad891 RED
...@@ -22,7 +22,8 @@ import java.util.Collection; ...@@ -22,7 +22,8 @@ import java.util.Collection;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.partitionmapping.Partition; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.partitionmapping.Partition;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.TaskMappingEncoding; 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.encoding.taskmapping.TaskMappingEntry;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.ComposablePhenotype; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.Phenotype;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.PhenotypeBase;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ISignalAdapter; 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.ITaskAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.comm.Message; import org.fortiss.af3.exploration.alg.dse.sysmodel.comm.Message;
...@@ -35,7 +36,7 @@ import org.fortiss.af3.exploration.alg.service.IExplorationEncoding; ...@@ -35,7 +36,7 @@ import org.fortiss.af3.exploration.alg.service.IExplorationEncoding;
* @author diewald * @author diewald
*/ */
public class MessageEncoding<S extends TaskMappingEntry<ITaskAdapter<?>, Partition>, T extends TaskMappingEncoding<ITaskAdapter<?>, S>> public class MessageEncoding<S extends TaskMappingEntry<ITaskAdapter<?>, Partition>, T extends TaskMappingEncoding<ITaskAdapter<?>, S>>
implements IExplorationEncoding, ComposablePhenotype<T> { extends PhenotypeBase implements IExplorationEncoding {
/** Contains the set of generated messages. */ /** Contains the set of generated messages. */
Collection<Message> messages; Collection<Message> messages;
...@@ -57,9 +58,8 @@ public class MessageEncoding<S extends TaskMappingEntry<ITaskAdapter<?>, Partiti ...@@ -57,9 +58,8 @@ public class MessageEncoding<S extends TaskMappingEntry<ITaskAdapter<?>, Partiti
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override @Override
public Class<? extends ComposablePhenotype<?>> getPTypeToRegister() { public Class<? extends Phenotype> getPTypeToRegister() {
return (Class<? extends ComposablePhenotype<?>>)MessageEncoding.class; return MessageEncoding.class;
} }
} }
InternalIsolatedCommunicationSet.java 46aa91e7690c31e46c6e852d8eed54b246fa4654 RED InternalIsolatedCommunicationSet.java 7b5f0edda6a6bcadd60ced408f214c5d4bac59c0 RED
Partition.java 9cde7e1eed7eb12767b0f8f2c104afab6d64a9c1 RED Partition.java 89cfb87a73d3ae080a9dbe5594b48ad552f7a9f1 RED
PartitionMappingEncoding.java 45388dce4228074541b17410baabf30f9c22f858 RED PartitionMappingEncoding.java f974bacb9d792679e784b150b5ed4bf04b07987d RED
PartitionMappingEntry.java 2f8f082e6bcd49dbe2f5ba88724850b54b20d637 RED PartitionMappingEntry.java 1af8d4e9544e3493329d93fc5d948b9d5e0bb158 RED
...@@ -22,7 +22,7 @@ import java.util.Map; ...@@ -22,7 +22,7 @@ import java.util.Map;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.MappingEncoding; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.MappingEncoding;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.genotype.ComposableGenotype; 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.backend.opt4j.extensions.compositegene.phenotype.Phenotype;
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.dse.sysmodel.random.RandomExploration; import org.fortiss.af3.exploration.alg.dse.sysmodel.random.RandomExploration;
...@@ -33,7 +33,8 @@ import org.fortiss.af3.exploration.alg.dse.sysmodel.random.RandomExploration; ...@@ -33,7 +33,8 @@ import org.fortiss.af3.exploration.alg.dse.sysmodel.random.RandomExploration;
* *
* @author diewald * @author diewald
*/ */
public class PartitionMappingEncoding extends public class PartitionMappingEncoding
extends
MappingEncoding<PartitionMappingEncoding, Partition, IResourceAdapter<?>, PartitionMappingEntry> MappingEncoding<PartitionMappingEncoding, Partition, IResourceAdapter<?>, PartitionMappingEntry>
implements ComposableGenotype, Cloneable { implements ComposableGenotype, Cloneable {
/** Set of physical target resources, i.e., execution units. */ /** Set of physical target resources, i.e., execution units. */
...@@ -131,7 +132,7 @@ public class PartitionMappingEncoding extends ...@@ -131,7 +132,7 @@ public class PartitionMappingEncoding extends
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public Class<? extends ComposablePhenotype<?>> getPTypeToRegister() { public Class<? extends Phenotype> getPTypeToRegister() {
return getClass(); return getClass();
} }
......
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