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

Cleanup: Remove the outdated ConstraintGenerationDecoder marker Iface.

parent fc379d64
No related branches found
No related tags found
1 merge request!63279
This commit is part of merge request !6. Comments created here will be created in the context of that merge request.
Showing
with 9 additions and 62 deletions
ComposableCreator.java 6d2d61205890a2b0b99f41d2caa4debc511c8b4a RED ComposableCreator.java 6d2d61205890a2b0b99f41d2caa4debc511c8b4a RED
ComposableCreatorBase.java bc5479724377964d3ec3ebd9b241172fd81f3ca5 RED ComposableCreatorBase.java 441c8d52ff073a09158d93b4149dd9e4f487f6b1 YELLOW
CompositeCreator.java b2d3b153a1e9670e23f9577c133504d4152d19ab RED CompositeCreator.java b2d3b153a1e9670e23f9577c133504d4152d19ab RED
CompositeCreatorBase.java 20f14d31ada8a4964a0ee05aed20e9c49d7ca90a RED CompositeCreatorBase.java 20f14d31ada8a4964a0ee05aed20e9c49d7ca90a RED
CreateInjectorProvider.java a63c84ad6b1e3a2a5c60464a20baec24fbf117d3 YELLOW CreateInjectorProvider.java a63c84ad6b1e3a2a5c60464a20baec24fbf117d3 YELLOW
......
...@@ -30,7 +30,6 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegen ...@@ -30,7 +30,6 @@ 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.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.FlatPhenotypeMap;
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.decode.ConstraintGenerationDecoder;
import org.fortiss.af3.exploration.alg.service.IExplorationEncoding; import org.fortiss.af3.exploration.alg.service.IExplorationEncoding;
import org.opt4j.core.Genotype; import org.opt4j.core.Genotype;
import org.opt4j.core.problem.Decoder; import org.opt4j.core.problem.Decoder;
...@@ -76,8 +75,7 @@ public abstract class ComposableCreatorBase<G extends ComposableGenotype> ...@@ -76,8 +75,7 @@ public abstract class ComposableCreatorBase<G extends ComposableGenotype>
@Override @Override
final public void registerAssocDecoders(ComposableDecoder<G, ?>... decoders) { final public void registerAssocDecoders(ComposableDecoder<G, ?>... decoders) {
for(ComposableDecoder<G, ?> dec : decoders) { for(ComposableDecoder<G, ?> dec : decoders) {
@SuppressWarnings("unchecked") ComposableDecoder<G, ? extends Phenotype> castedDec = ComposableDecoder<G, ? extends Phenotype> castedDec = dec;
dec;
subDecoders.add(castedDec); subDecoders.add(castedDec);
decoderExecuted.put(castedDec, false); decoderExecuted.put(castedDec, false);
} }
...@@ -124,9 +122,6 @@ public abstract class ComposableCreatorBase<G extends ComposableGenotype> ...@@ -124,9 +122,6 @@ public abstract class ComposableCreatorBase<G extends ComposableGenotype>
P decPhenotype = (P)decoder.decodeComposable(genotype, intermediatePhenos); P decPhenotype = (P)decoder.decodeComposable(genotype, intermediatePhenos);
// Null indicates a decoding error here. // Null indicates a decoding error here.
if(decPhenotype == null && !(decoder instanceof ConstraintGenerationDecoder)) {
throw new DecodingException(genotype, decoder);
}
if(decPhenotype != null) { if(decPhenotype != null) {
phenotypes.putEncoding(decPhenotype.getPTypeToRegister(), decPhenotype); phenotypes.putEncoding(decPhenotype.getPTypeToRegister(), decPhenotype);
......
BindingWalker.java 77b92051f6a3351cc88a36de9890111ce4df8170 YELLOW BindingWalker.java 77b92051f6a3351cc88a36de9890111ce4df8170 YELLOW
DecoderDependencyGraph.java d0327f5eba24c12db5ef5e8c837d99c55b6950b7 RED DecoderDependencyGraph.java 1ee0ae9da8f0f8c55c088b10ae580c20a5cb5bdb RED
DecoderEdge.java e4d8a7ef9f1d118aaa2c544f1a2d110819554480 RED DecoderEdge.java e4d8a7ef9f1d118aaa2c544f1a2d110819554480 RED
DecoderFinder.java 25b0fb2370c4001c683e038c98f425be56d06403 YELLOW DecoderFinder.java 25b0fb2370c4001c683e038c98f425be56d06403 YELLOW
GenotypeFinder.java 9e15e3d94b42fc463724956806bbe22b6eefa631 YELLOW GenotypeFinder.java 9e15e3d94b42fc463724956806bbe22b6eefa631 YELLOW
......
...@@ -25,7 +25,6 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegen ...@@ -25,7 +25,6 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegen
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.exception.MissingDependencyException; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.exception.MissingDependencyException;
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.Phenotype; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.phenotype.Phenotype;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.decode.ConstraintGenerationDecoder;
import org.fortiss.af3.exploration.alg.graph.DependencyGraph; import org.fortiss.af3.exploration.alg.graph.DependencyGraph;
import org.fortiss.af3.exploration.alg.service.IExplorationEncoding; import org.fortiss.af3.exploration.alg.service.IExplorationEncoding;
import org.opt4j.core.problem.Creator; import org.opt4j.core.problem.Creator;
...@@ -69,20 +68,7 @@ public class DecoderDependencyGraph extends ...@@ -69,20 +68,7 @@ public class DecoderDependencyGraph extends
@Override @Override
protected Comparator<ComposableDecoder<ComposableGenotype, Phenotype>> protected Comparator<ComposableDecoder<ComposableGenotype, Phenotype>>
getSubExecListComparator() { getSubExecListComparator() {
return new Comparator<ComposableDecoder<ComposableGenotype, Phenotype>>() { // TODO Auto-generated method stub
@Override return null;
public int compare(ComposableDecoder<ComposableGenotype, Phenotype> o1,
ComposableDecoder<ComposableGenotype, Phenotype> o2) {
if(o1 instanceof ConstraintGenerationDecoder &&
o2 instanceof ConstraintGenerationDecoder) {
return 0;
} else if(o1 instanceof ConstraintGenerationDecoder) {
return 1;
} else if(o2 instanceof ConstraintGenerationDecoder) {
return -1;
}
return 0;
}
};
} }
} }
ConstraintGenerationDecoder.java 854c091376882863d91ce7b422659e3e6c611271 RED
/*-------------------------------------------------------------------------+
| Copyright 2016 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.decode;
import org.fortiss.af3.exploration.alg.service.IExplorationEncoding;
import org.opt4j.core.problem.Decoder;
/**
* Marker interface for {@link Decoder}s that produce constraints that are added to an
* {@link IExplorationEncoding}
*
* @author diewald
*/
public interface ConstraintGenerationDecoder {
// Marker interface.
}
SFGraphDecoder.java 539dc6bb5e99adef7812a0cbd6e0183bf3855e0e RED SFGraphDecoder.java 539dc6bb5e99adef7812a0cbd6e0183bf3855e0e RED
SFMappingConstraintDecoder.java e1bca064d172629e03d4acedcb60b83b89f87d5e RED SFMappingConstraintDecoder.java 6ebda962400d82ea4738eedbedda03ebf3db2a5e RED
SFMappingDecoder.java d7641b11baed3dd5b66817a54fe24064a69ebd48 RED SFMappingDecoder.java 90fd2b466e4d62434068088af0f24d599227c7ca RED
...@@ -26,7 +26,6 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.co ...@@ -26,7 +26,6 @@ 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.encoding.taskmapping.constraint.InternalSeparationConstraint;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.UpdatesEncoding; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.UpdatesEncoding;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.decode.Decodes; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.decode.Decodes;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.decode.ConstraintGenerationDecoder;
import org.fortiss.af3.exploration.alg.dse.module.DecoderModule; import org.fortiss.af3.exploration.alg.dse.module.DecoderModule;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ISafetyFunctionAdapter; import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ISafetyFunctionAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter; import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.ITaskAdapter;
...@@ -41,8 +40,7 @@ import com.google.inject.Provides; ...@@ -41,8 +40,7 @@ import com.google.inject.Provides;
* *
* @author diewald * @author diewald
*/ */
public class SFMappingConstraintDecoder<C> extends DecoderModule<AbstractTaskMappingEncoding> public class SFMappingConstraintDecoder<C> extends DecoderModule<AbstractTaskMappingEncoding> {
implements ConstraintGenerationDecoder {
/** /**
* Updates the input {@link AbstractTaskMappingEncoding} with additionally required allocation * Updates the input {@link AbstractTaskMappingEncoding} with additionally required allocation
......
...@@ -33,7 +33,6 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegen ...@@ -33,7 +33,6 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegen
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.decode.Decodes; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.decode.Decodes;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.decode.Genotyped; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.decode.Genotyped;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.exception.DecodingException; import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.exception.DecodingException;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.decode.ConstraintGenerationDecoder;
import org.fortiss.af3.exploration.alg.dse.module.DecoderModule; import org.fortiss.af3.exploration.alg.dse.module.DecoderModule;
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.mapping.IMappingEntry; import org.fortiss.af3.exploration.alg.dse.sysmodel.mapping.IMappingEntry;
...@@ -48,8 +47,7 @@ import com.google.inject.name.Named; ...@@ -48,8 +47,7 @@ import com.google.inject.name.Named;
* *
* @author diewald * @author diewald
*/ */
public class SFMappingDecoder<C> extends DecoderModule<AbstractTaskMappingEncoding> public class SFMappingDecoder<C> extends DecoderModule<AbstractTaskMappingEncoding> {
implements ConstraintGenerationDecoder {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
......
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