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 114 additions and 114 deletions
......@@ -22,16 +22,16 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.ab
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.instantiatedmapping.InstantiatedTaskMappingEncoding;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.instantiatedmapping.InstantiatedTaskMappingEntry;
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.operator.mutate.taskmapping.MutateTasksBase;
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.opt4j.operators.mutate.Mutate;
/**
* {@link Mutate} operator which manipulates the instantiation of the referenced
* {@link IDeployableComponentAdapter} of a {@link InstantiatedTaskMappingEntry}. The instantiated
* {@link IDeployableComponentAdapter} is randomly selected from the set of instantiatable
* {@link IDeployableComponentAdapter}s of the associated {@link AbstractTaskMappingEntry}.
* {@link ITaskAdapter} of a {@link InstantiatedTaskMappingEntry}. The instantiated
* {@link ITaskAdapter} is randomly selected from the set of instantiatable
* {@link ITaskAdapter}s of the associated {@link AbstractTaskMappingEntry}.
* <p>
* <b>NOTE:</b> Currently, this is a Nop operator, as a correct handling of {@link TaskGraph}s and
* an appropriate reliability analysis must be worked out.
......@@ -42,17 +42,17 @@ public class MutateTaskInstance
extends
MutateTasksBase<InstantiatedTaskMappingEntry, InstantiatedTaskMappingEncoding<InstantiatedTaskMappingEntry>> {
/**
* Collection of {@link IDeployableComponentAdapter}s which must be instantiated to obtain a
* Collection of {@link ITaskAdapter}s which must be instantiated to obtain a
* "concrete" logical model".
*/
private Collection<IDeployableComponentAdapter<?>> abstractComponents;
private Collection<ITaskAdapter<?>> abstractComponents;
/** Constructor. */
public MutateTaskInstance(SystemModelAdapter<?, ?, ?, ?, ?, ?> systemModelAdapter) {
super(systemModelAdapter);
abstractComponents = new HashSet<IDeployableComponentAdapter<?>>();
abstractComponents = new HashSet<ITaskAdapter<?>>();
for(IDeployableComponentAdapter<?> deployableComponent : systemModelAdapter
for(ITaskAdapter<?> deployableComponent : systemModelAdapter
.getDeployableComponents()) {
if(deployableComponent.isInstantiationRequired()) {
abstractComponents.add(deployableComponent);
......
MutateAllocation.java 4be3752ce942ef18fdf362d8b96b5947a0edc68a RED
MutateRedundancy.java 05466c1910bdf50c849cf22f8e668426e6fad0d3 RED
MutateRedundancyDecrement.java 3a000150f2e86902b9ce85c7672884e94fa19cc4 RED
MutateRedundancyIncrement.java f6093ed138ecc6a6cd3282df8440f8fcdb40aa53 RED
MutateAllocation.java 728685a4052cf266b94d165bd58d9b2982efaa2f RED
MutateRedundancy.java 3ea1cdb42e3aa3000e5db3d581f28ee21272186a RED
MutateRedundancyDecrement.java b6bb89127a938dafabc4c48ebe8ceb2f42d946dd RED
MutateRedundancyIncrement.java 92967225c7a135759f7ce70d4eb69d983d2dcff7 RED
MutateTaskMappingModule.java 22c97eb8bd2dbf8a5a9eae145010f4fa14932c8c RED
MutateTasksBase.java f0d224a24113d04b3f60a749f74b8aa5a9349204 RED
MutateTasksBase.java 85e3f642be9d4df9d52f0fe700f51ab229279cee RED
......@@ -24,7 +24,7 @@ import java.util.List;
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.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.IExecutionUnitAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
import org.fortiss.af3.exploration.alg.exception.ExplorationException;
......@@ -35,7 +35,7 @@ import org.fortiss.af3.exploration.alg.exception.ExplorationException;
*
* @author huang
*/
public class MutateAllocation<S extends TaskMappingEntry<IDeployableComponentAdapter<?>, Partition>, T extends TaskMappingEncoding<IDeployableComponentAdapter<?>, S>>
public class MutateAllocation<S extends TaskMappingEntry<ITaskAdapter<?>, Partition>, T extends TaskMappingEncoding<ITaskAdapter<?>, S>>
extends MutateTasksBase<S, T> {
/** Constructs a new allocation mutation operator for a given exploration run */
......@@ -51,9 +51,9 @@ public class MutateAllocation<S extends TaskMappingEntry<IDeployableComponentAda
public void mutate(T encoding, double rate) {
checkReplicationCount(encoding);
Collection<IDeployableComponentAdapter<?>> encDeplComponents =
Collection<ITaskAdapter<?>> encDeplComponents =
new ArrayList<>(encoding.getRequesters());
for(IDeployableComponentAdapter<?> deployableComponent : encDeplComponents) {
for(ITaskAdapter<?> deployableComponent : encDeplComponents) {
if(rand.nextDouble() < rate) {
Collection<S> assignedResources = encoding.getMappingEntriesOf(deployableComponent);
if(assignedResources == null) {
......@@ -76,7 +76,7 @@ public class MutateAllocation<S extends TaskMappingEntry<IDeployableComponentAda
/** Checks the replication count and prints a message in case of errors. */
private void checkReplicationCount(T encoding) {
if(CHECK_REPLICATION_COUNT) {
for(IDeployableComponentAdapter<?> currentComponent : systemModelAdapter
for(ITaskAdapter<?> currentComponent : systemModelAdapter
.getDeployableComponents()) {
if(encoding.getAllocatedResourcesFor(currentComponent).size() != 1) {
System.out.println("Encoding replications exceed the allowed amount");
......@@ -86,14 +86,14 @@ public class MutateAllocation<S extends TaskMappingEntry<IDeployableComponentAda
}
/**
* Performs the actual re-allocation of the given {@link IDeployableComponentAdapter}.
* Performs the actual re-allocation of the given {@link ITaskAdapter}.
*
* @throws ExplorationException
* if no valid allocation targets can be identified for one
* {@link IDeployableComponentAdapter}.
* {@link ITaskAdapter}.
*/
private void reAllocateMappingEntry(T encoding,
IDeployableComponentAdapter<?> deployableComponent) throws ExplorationException {
ITaskAdapter<?> deployableComponent) throws ExplorationException {
// The assigned resources must be an indexed list, such that randomly determined allocations
// can be directly removed using a random number generator.
List<S> assignedResources =
......
......@@ -22,7 +22,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.encoding.taskmapping.constraint.InternalReplicationConstraint;
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;
......@@ -31,7 +31,7 @@ import org.fortiss.af3.exploration.alg.exception.ExplorationException;
*
* @author huang
*/
public abstract class MutateRedundancy<S extends TaskMappingEntry<IDeployableComponentAdapter<?>, Partition>, T extends TaskMappingEncoding<IDeployableComponentAdapter<?>, S>>
public abstract class MutateRedundancy<S extends TaskMappingEntry<ITaskAdapter<?>, Partition>, T extends TaskMappingEncoding<ITaskAdapter<?>, S>>
extends MutateTasksBase<S, T> {
/** Constructs a new redundancy mutation operator for a given exploration run */
......@@ -42,7 +42,7 @@ public abstract class MutateRedundancy<S extends TaskMappingEntry<IDeployableCom
/** {@inheritDoc} */
@Override
public void mutate(T encoding, double rate) {
for(IDeployableComponentAdapter<?> deployableComponent : encoding.getRequesters()) {
for(ITaskAdapter<?> deployableComponent : encoding.getRequesters()) {
if(rand.nextDouble() < rate) {
// TODO: remove filter for fixed Deployment: It is not needed.
// No replication for Components with a fixed Deployment & Components which shall
......@@ -82,8 +82,8 @@ public abstract class MutateRedundancy<S extends TaskMappingEntry<IDeployableCom
*
* @throws ExplorationException
* if no valid allocation targets can be identified for one
* {@link IDeployableComponentAdapter}.
* {@link ITaskAdapter}.
*/
protected abstract void mutate(T encoding, IDeployableComponentAdapter<?> deployableComponent,
protected abstract void mutate(T encoding, ITaskAdapter<?> deployableComponent,
int minReplicatation, int maxReplication) throws ExplorationException;
}
......@@ -20,7 +20,7 @@ import java.util.List;
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.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.SystemModelAdapter;
/**
......@@ -28,7 +28,7 @@ import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
*
* @author huang
*/
public class MutateRedundancyDecrement<S extends TaskMappingEntry<IDeployableComponentAdapter<?>, Partition>, T extends TaskMappingEncoding<IDeployableComponentAdapter<?>, S>>
public class MutateRedundancyDecrement<S extends TaskMappingEntry<ITaskAdapter<?>, Partition>, T extends TaskMappingEncoding<ITaskAdapter<?>, S>>
extends MutateRedundancy<S, T> {
/** Constructs a new decrement redundancy mutation operator for a given exploration run */
......@@ -38,7 +38,7 @@ public class MutateRedundancyDecrement<S extends TaskMappingEntry<IDeployableCom
/** {@inheritDoc} */
@Override
protected void mutate(T encoding, IDeployableComponentAdapter<?> deployableComponent,
protected void mutate(T encoding, ITaskAdapter<?> deployableComponent,
int minReplicatation, int maxReplication) {
List<S> assignedResources = encoding.getMappingEntriesOf(deployableComponent);
assert (assignedResources != null);
......
......@@ -21,7 +21,7 @@ import org.conqat.lib.commons.collections.CollectionUtils;
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.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.SystemModelAdapter;
import org.fortiss.af3.exploration.alg.exception.ExplorationException;
......@@ -30,7 +30,7 @@ import org.fortiss.af3.exploration.alg.exception.ExplorationException;
*
* @author huang
*/
public class MutateRedundancyIncrement<S extends TaskMappingEntry<IDeployableComponentAdapter<?>, Partition>, T extends TaskMappingEncoding<IDeployableComponentAdapter<?>, S>>
public class MutateRedundancyIncrement<S extends TaskMappingEntry<ITaskAdapter<?>, Partition>, T extends TaskMappingEncoding<ITaskAdapter<?>, S>>
extends MutateRedundancy<S, T> {
/** Constructs a new increment redundancy mutation operator for a given exploration run */
public MutateRedundancyIncrement(SystemModelAdapter<?, ?, ?, ?, ?, ?> systemModelAdapter) {
......@@ -43,7 +43,7 @@ public class MutateRedundancyIncrement<S extends TaskMappingEntry<IDeployableCom
* @throws ExplorationException
*/
@Override
protected void mutate(T encoding, IDeployableComponentAdapter<?> deployableComponent,
protected void mutate(T encoding, ITaskAdapter<?> deployableComponent,
int minReplicatation, int maxReplication) throws ExplorationException {
Collection<S> assignedResources = encoding.getMappingEntriesOf(deployableComponent);
assert (assignedResources != null);
......
......@@ -19,7 +19,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.operator.mutate.MutateBase;
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;
/**
......@@ -27,7 +27,7 @@ import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
*
* @author huang
*/
public abstract class MutateTasksBase<S extends TaskMappingEntry<IDeployableComponentAdapter<?>, Partition>, T extends TaskMappingEncoding<IDeployableComponentAdapter<?>, S>>
public abstract class MutateTasksBase<S extends TaskMappingEntry<ITaskAdapter<?>, Partition>, T extends TaskMappingEncoding<ITaskAdapter<?>, S>>
extends MutateBase<T> {
/** Constructor. */
......
MessageDecoder.java 8763b821ca5bbb4637aadf78c599f5fe103eb5cf RED
MessageDecoder.java 74e6d7c77fc31809f104d3b0aff037eb9c24c851 RED
......@@ -32,7 +32,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegen
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.exception.DecodingException;
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.IResourceAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.comm.Message;
......@@ -52,7 +52,7 @@ import com.google.inject.Inject;
*
* @author diewald
*/
public class MessageDecoder<S extends TaskMappingEntry<IDeployableComponentAdapter<?>, Partition>, T extends TaskMappingEncoding<IDeployableComponentAdapter<?>, S>>
public class MessageDecoder<S extends TaskMappingEntry<ITaskAdapter<?>, Partition>, T extends TaskMappingEncoding<ITaskAdapter<?>, S>>
extends ComposableDecoderBase<T, MessageEncoding<S, T>> {
/** References the input system models. */
......
InstantiatedTaskMappingDecoder.java 57e46646ba44ffaa4af2612718dc31feb47b9f35 RED
InstantiatedTaskMappingDecoder.java 287c38c6f85cb60c1d1ae830fb8792ee54037bfe RED
InstantiatedTaskMappingDecoderAcyclic.java 7abff3b7998604fa61a32b4cfa1d98fb9960ffb6 RED
......@@ -33,7 +33,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegen
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.exception.DecodingException;
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.dse.sysmodel.arch.taskgraph.ChannelAdapterWeightedEdge;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.taskgraph.DefaultTaskGraph;
......@@ -95,16 +95,16 @@ public class InstantiatedTaskMappingDecoder<T extends InstantiatedTaskMappingEnt
private void removeInterSafetyChannelSignals(SafetyFunctionArchEncoding<?> sfEnc,
InstantiatedTaskGraphEncoding<T, C> itgEnc) throws DecodingException {
for(SafetyFunctionArchEntry<?> sfEntry : sfEnc.getAllEntries()) {
Collection<IDeployableComponentAdapter<?>> sfCompAdps =
Collection<ITaskAdapter<?>> sfCompAdps =
castToRawColl(sfEntry.getSafetyFunctionAdapter().getRealizingComponents());
assert (sfCompAdps.size() > 0);
IDeployableComponentAdapter<?> sfCompAdp = sfCompAdps.stream().findAny().get();
ITaskAdapter<?> sfCompAdp = sfCompAdps.stream().findAny().get();
// Get the "containing" task graph. We must check all replacement components (instances)
// since we don't know which one was instantiated (or it would be more costly to find
// out).
DefaultTaskGraph<?> sfTG = null;
for(IDeployableComponentAdapter<?> curSFCompAdp : sfCompAdp
for(ITaskAdapter<?> curSFCompAdp : sfCompAdp
.getReplacementComponents()) {
sfTG = itgEnc.getTaskGraphOf(curSFCompAdp);
if(sfTG != null) {
......@@ -116,34 +116,34 @@ public class InstantiatedTaskMappingDecoder<T extends InstantiatedTaskMappingEnt
" of the Component Adapter " + sfCompAdp.getName() + ".");
}
Collection<IDeployableComponentAdapter<?>> connectedSFUnits = new ArrayList<>();
Collection<IDeployableComponentAdapter<?>> connectedDiagUnits = new ArrayList<>();
Collection<IDeployableComponentAdapter<?>> connectedOutUnit = new ArrayList<>();
Collection<ITaskAdapter<?>> connectedSFUnits = new ArrayList<>();
Collection<ITaskAdapter<?>> connectedDiagUnits = new ArrayList<>();
Collection<ITaskAdapter<?>> connectedOutUnit = new ArrayList<>();
for(int channelIdx = 0; channelIdx < sfEntry.getNumChannels(); channelIdx++) {
Collection<IDeployableComponentAdapter<?>> sfUnits =
Collection<ITaskAdapter<?>> sfUnits =
castToRawColl(sfEntry.getSafetyFunctionAdapter().getRealizingComponents());
Collection<IDeployableComponentAdapter<?>> diagUnits =
Collection<ITaskAdapter<?>> diagUnits =
castToRawColl(sfEntry.getSafetyFunctionAdapter().getDiagnosticComponents());
// TODO: knowledge about the modeL: output unit not instantiated:
IDeployableComponentAdapter<?> outputUnit =
ITaskAdapter<?> outputUnit =
sfEntry.getSafetyFunctionAdapter().getOutputComponent();
// TODO: only for a single diag unit.
Collection<IDeployableComponentAdapter<?>> realizingSFUnits =
Collection<ITaskAdapter<?>> realizingSFUnits =
itgEnc.getDeployableComponents().stream()
.filter(d -> sfUnits.contains(d.getReplacedComponent()))
.collect(Collectors.toList());
Collection<IDeployableComponentAdapter<?>> realizingDiagUnits =
Collection<ITaskAdapter<?>> realizingDiagUnits =
itgEnc.getDeployableComponents().stream()
.filter(d -> diagUnits.contains(d.getReplacedComponent()))
.collect(Collectors.toList());
Collection<IDeployableComponentAdapter<?>> outComps =
Collection<ITaskAdapter<?>> outComps =
itgEnc.getDeployableComponents().stream()
.filter(d -> d.getObject() == outputUnit.getObject())
.collect(Collectors.toList());
// Pick an sf component instance that is assigned to the current channel.
IDeployableComponentAdapter<?> currentChannelSFUnit = null;
for(IDeployableComponentAdapter<?> curSFUnit : realizingSFUnits) {
ITaskAdapter<?> currentChannelSFUnit = null;
for(ITaskAdapter<?> curSFUnit : realizingSFUnits) {
if(!connectedSFUnits.contains(curSFUnit)) {
// Remember that the diagnostic unit is associated with one channel --> no
// elimination of the signal.
......@@ -153,8 +153,8 @@ public class InstantiatedTaskMappingDecoder<T extends InstantiatedTaskMappingEnt
}
}
// Pick an diagnostic component instance that is assigned to the current channel.
IDeployableComponentAdapter<?> currentChannelDiagUnit = null;
for(IDeployableComponentAdapter<?> curDiagUnit : realizingDiagUnits) {
ITaskAdapter<?> currentChannelDiagUnit = null;
for(ITaskAdapter<?> curDiagUnit : realizingDiagUnits) {
if(!connectedDiagUnits.contains(curDiagUnit)) {
// Remember that the diagnostic unit is associated with one channel --> no
// elimination of the signal.
......@@ -164,8 +164,8 @@ public class InstantiatedTaskMappingDecoder<T extends InstantiatedTaskMappingEnt
}
}
// Pick an io component instance that is assigned to the current channel.
IDeployableComponentAdapter<?> currentChannelOutputUnit = null;
for(IDeployableComponentAdapter<?> curOutUnit : outComps) {
ITaskAdapter<?> currentChannelOutputUnit = null;
for(ITaskAdapter<?> curOutUnit : outComps) {
if(!connectedOutUnit.contains(curOutUnit)) {
// Remember that the diagnostic unit is associated with one channel --> no
// elimination of the signal.
......@@ -187,30 +187,30 @@ public class InstantiatedTaskMappingDecoder<T extends InstantiatedTaskMappingEnt
* @param sfTG
* {@link TaskGraph} containing the safety function instances.
* @param realizingSFUnits
* {@link IDeployableComponentAdapter}s realizing the safety function's protection
* {@link ITaskAdapter}s realizing the safety function's protection
* element.
* @param realizingDiagUnits
* {@link IDeployableComponentAdapter}s realizing the safety function's diagnostic
* {@link ITaskAdapter}s realizing the safety function's diagnostic
* element.
* @param outComps
* {@link IDeployableComponentAdapter}s realizing the safety function's output
* {@link ITaskAdapter}s realizing the safety function's output
* aggregation element, e.g., a voter.
* @param currentChannelSFUnit
* {@link IDeployableComponentAdapter} of the currently processed protection element.
* {@link ITaskAdapter} of the currently processed protection element.
* @param currentChannelDiagUnit
* {@link IDeployableComponentAdapter} of the currently processed diagnostic element.
* {@link ITaskAdapter} of the currently processed diagnostic element.
* @param currentChannelOutputUnit
* {@link IDeployableComponentAdapter} of the currently processed output aggregation
* {@link ITaskAdapter} of the currently processed output aggregation
* element.
*/
private void updateTaskGraph(DefaultTaskGraph<?> sfTG,
Collection<IDeployableComponentAdapter<?>> realizingSFUnits,
Collection<IDeployableComponentAdapter<?>> realizingDiagUnits,
Collection<IDeployableComponentAdapter<?>> outComps,
IDeployableComponentAdapter<?> currentChannelSFUnit,
IDeployableComponentAdapter<?> currentChannelDiagUnit,
IDeployableComponentAdapter<?> currentChannelOutputUnit) {
for(IDeployableComponentAdapter<?> curSFUnit : realizingSFUnits) {
Collection<ITaskAdapter<?>> realizingSFUnits,
Collection<ITaskAdapter<?>> realizingDiagUnits,
Collection<ITaskAdapter<?>> outComps,
ITaskAdapter<?> currentChannelSFUnit,
ITaskAdapter<?> currentChannelDiagUnit,
ITaskAdapter<?> currentChannelOutputUnit) {
for(ITaskAdapter<?> curSFUnit : realizingSFUnits) {
if(currentChannelSFUnit != curSFUnit) {
// Eliminate all other signals to different channels.
ChannelAdapterWeightedEdge interChannelSignal =
......@@ -220,7 +220,7 @@ public class InstantiatedTaskMappingDecoder<T extends InstantiatedTaskMappingEnt
sfTG.getGraph().removeEdge(interChannelSignal);
}
}
for(IDeployableComponentAdapter<?> curDiagUnit : realizingDiagUnits) {
for(ITaskAdapter<?> curDiagUnit : realizingDiagUnits) {
if(currentChannelDiagUnit != curDiagUnit) {
// Eliminate all other signals to different channels.
ChannelAdapterWeightedEdge interChannelSignal =
......@@ -230,7 +230,7 @@ public class InstantiatedTaskMappingDecoder<T extends InstantiatedTaskMappingEnt
sfTG.getGraph().removeEdge(interChannelSignal);
}
}
for(IDeployableComponentAdapter<?> curOutUnit : outComps) {
for(ITaskAdapter<?> curOutUnit : outComps) {
if(currentChannelOutputUnit != curOutUnit) {
// Eliminate all other signals to different channels.
ChannelAdapterWeightedEdge interChannelSignal =
......
SFEncodingDecoder.java 8e1594c92aa5e0c23d07038bb63db5b483c4f727 RED
SFGraphDecoder.java 7290792dbf7bd2f22e909a1f166ab2dcaae7ee7d RED
SFMappingConstraintDecoder.java 31ccf2a6cb337edce54fd77edb793e096f1a393d RED
SFMappingDecoder.java 48342dcb954a8129e640ab89bbaf57fe028febf9 RED
SFGraphDecoder.java 614f9894d678367b356e987df7e407b001bbeada RED
SFMappingConstraintDecoder.java 6c72acbd0a65d0db701da8ab4de2e26869f10493 RED
SFMappingDecoder.java 7d95377e4eda5ddeb17da9c0db1e32a254d3c294 RED
......@@ -32,13 +32,13 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegen
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.problem.ArchExpSubDecoder;
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 com.google.inject.Inject;
/**
* {@link ComposableDecoder} that generates {@link IDeployableComponentAdapter}s from the
* {@link ComposableDecoder} that generates {@link ITaskAdapter}s from the
* chosen architecture of a safety function.
*
* @author diewald
......@@ -100,7 +100,7 @@ public class SFGraphDecoder<C>
*/
private boolean containsDiagUnits(SafetyFunctionArchEntry<C> sFAEntry,
SafeTaskGraphEncoding<C> encoding) {
Collection<IDeployableComponentAdapter<C>> sfComps =
Collection<ITaskAdapter<C>> sfComps =
sFAEntry.getSafetyFunctionAdapter().getDiagnosticComponents();
if(!sfComps.isEmpty()) {
return encoding.containsTask(sfComps.stream().findAny().get());
......@@ -114,16 +114,16 @@ public class SFGraphDecoder<C>
*/
private void addDiagUnits(SafetyFunctionArchEntry<C> sFAEntry,
SafeTaskGraphEncoding<C> encoding) {
Collection<IDeployableComponentAdapter<C>> diagComps =
Collection<ITaskAdapter<C>> diagComps =
sFAEntry.getSafetyFunctionAdapter().getDiagnosticComponents();
addTasks(diagComps, encoding);
}
/**
* Adds the given collection of {@link IDeployableComponentAdapter}s from the
* Adds the given collection of {@link ITaskAdapter}s from the
* {@link SafetyFunctionArchEntry} to the {@link TaskGraphEncoding}.
*/
private void addTasks(Collection<IDeployableComponentAdapter<C>> deplComp,
private void addTasks(Collection<ITaskAdapter<C>> deplComp,
SafeTaskGraphEncoding<C> encoding) {
// Add the Components.
deplComp.stream().forEach(task -> encoding.addTask(task));
......@@ -135,7 +135,7 @@ public class SFGraphDecoder<C>
/** Removes the diagnostic units from the {@link TaskGraphEncoding}. */
private void removeDiagUnits(SafetyFunctionArchEntry<C> sFAEntry,
SafeTaskGraphEncoding<C> encoding) {
Collection<IDeployableComponentAdapter<C>> sfComps =
Collection<ITaskAdapter<C>> sfComps =
sFAEntry.getSafetyFunctionAdapter().getDiagnosticComponents();
sfComps.stream().forEach(t -> encoding.removeTask(t));
}
......
......@@ -29,7 +29,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegen
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.decode.ConstraintGenerationDecoder;
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.ISafetyFunctionAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
......@@ -67,13 +67,13 @@ public class SFMappingConstraintDecoder<C>
public AbstractTaskMappingEncoding updateComposable(SafetyFunctionArchEncoding<C> inGenotype,
AbstractTaskMappingEncoding outGenotype,
FlatPhenotypeMap<Phenotype> decodedPhenotypes) {
Collection<IDeployableComponentAdapter<C>> deplComps = new HashSet<>();
Collection<ITaskAdapter<C>> deplComps = new HashSet<>();
deplComps.addAll(systemModelAdapter.getDeployableComponents());
for(SafetyFunctionArchEntry<C> sFAEntry : inGenotype.getAllEntries()) {
int channelNumber = sFAEntry.getNumChannels();
Collection<InternalReplicationConstraint> replicationConstraints = new HashSet<>();
for(IDeployableComponentAdapter<?> comp : sFAEntry.getSafetyFunctionAdapter()
for(ITaskAdapter<?> comp : sFAEntry.getSafetyFunctionAdapter()
.getAllComponents()) {
replicationConstraints
.add(new InternalReplicationConstraint(comp, channelNumber, channelNumber));
......
......@@ -37,7 +37,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegen
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.decode.ConstraintGenerationDecoder;
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.IMappingEntry;
import org.fortiss.af3.exploration.alg.exception.ExplorationException;
......@@ -93,17 +93,17 @@ public class SFMappingDecoder<C>
}
// TODO: replace with a dynamic mechanism for the retrieval of deployable components.
Collection<IDeployableComponentAdapter<C>> deplComps = new HashSet<>();
Collection<ITaskAdapter<C>> deplComps = new HashSet<>();
deplComps.addAll(systemModelAdapter.getDeployableComponents());
for(SafetyFunctionArchEntry<C> sFAEntry : inGenotype.getAllEntries()) {
boolean diagPresent = sFAEntry.isDiagnosicUnitPresent();
int channelNumber = sFAEntry.getNumChannels();
Collection<IDeployableComponentAdapter<C>> sfComps =
Collection<ITaskAdapter<C>> sfComps =
sFAEntry.getSafetyFunctionAdapter().getRealizingComponents();
Collection<IDeployableComponentAdapter<C>> diagComps =
Collection<ITaskAdapter<C>> diagComps =
sFAEntry.getSafetyFunctionAdapter().getDiagnosticComponents();
IDeployableComponentAdapter<C> outComponent =
ITaskAdapter<C> outComponent =
sFAEntry.getSafetyFunctionAdapter().getOutputComponent();
// We assume that the entry number must be equal for all realizing components of a
......@@ -116,7 +116,7 @@ public class SFMappingDecoder<C>
// the creation phase.
Set<IMappingEntry<?, ?>> existingEntries = new HashSet<>();
if(outGenotype.getConstraintsOf(InternalIsolatedCommunicationSet.class).isEmpty()) {
for(IDeployableComponentAdapter<C> comp : sFAEntry.getSafetyFunctionAdapter()
for(ITaskAdapter<C> comp : sFAEntry.getSafetyFunctionAdapter()
.getAllComponents()) {
Collection<AbstractTaskMappingEntry> curEntry =
outGenotype.getMappingEntriesOf(comp);
......@@ -187,10 +187,10 @@ public class SFMappingDecoder<C>
*
* @throws ExplorationException
* if no valid allocation targets can be identified for one
* {@link IDeployableComponentAdapter}.
* {@link ITaskAdapter}.
*/
private void addMissingDiagUnits(AbstractTaskMappingEncoding outGenotype,
Collection<IDeployableComponentAdapter<C>> diagComps, int entryNumber)
Collection<ITaskAdapter<C>> diagComps, int entryNumber)
throws ExplorationException {
List<InternalIsolatedCommunicationSet> isoComm = new ArrayList<>(
outGenotype.getConstraintsOf(InternalIsolatedCommunicationSet.class));
......@@ -203,8 +203,8 @@ public class SFMappingDecoder<C>
/** Entirely removes the diagnostic units of a safety function from a given mapping. */
private void removeDiagUnits(AbstractTaskMappingEncoding outGenotype,
Collection<IDeployableComponentAdapter<C>> diagComps) {
for(IDeployableComponentAdapter<?> diagComp : diagComps) {
Collection<ITaskAdapter<C>> diagComps) {
for(ITaskAdapter<?> diagComp : diagComps) {
Collection<AbstractTaskMappingEntry> removedEntries = outGenotype.removeTask(diagComp);
Collection<InternalIsolatedCommunicationSet> isoCommConstrs =
outGenotype.getConstraintsOf(InternalIsolatedCommunicationSet.class);
......@@ -218,17 +218,17 @@ public class SFMappingDecoder<C>
/**
* Adds one random entry to the task mapping for each of the given
* {@link IDeployableComponentAdapter}s.
* {@link ITaskAdapter}s.
*
* @throws ExplorationException
* if no valid allocation targets can be identified for one
* {@link IDeployableComponentAdapter}.
* {@link ITaskAdapter}.
*/
private Set<IMappingEntry<?, ?>> addSFComponents(AbstractTaskMappingEncoding outGenotype,
Collection<IDeployableComponentAdapter<C>> sfComps) throws ExplorationException {
Collection<ITaskAdapter<C>> sfComps) throws ExplorationException {
Set<IMappingEntry<?, ?>> createdEntries = new HashSet<>();
if(sfComps != null) {
for(IDeployableComponentAdapter<C> curSFComp : sfComps) {
for(ITaskAdapter<C> curSFComp : sfComps) {
createdEntries.add(outGenotype.createAndAddRandomEntry(curSFComp));
}
}
......
AbstractTaskMappingIdentityDecoder.java b1556259f12c67e465031f63f21a47e327f42ab9 RED
TaskMappingDecoderBase.java 969f0a27fad48ecf6de04e9ea4034602aeb21a20 RED
TaskMappingDecoderBase.java 0b0fefc3bb48ea5b65956266b48bd97eed90d9f5 RED
......@@ -26,7 +26,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegen
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.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.IResourceAdapter;
import org.fortiss.af3.exploration.alg.exception.ExplorationException;
......@@ -34,7 +34,7 @@ import org.fortiss.af3.exploration.alg.exception.ExplorationException;
*
* @author diewald
*/
public abstract class TaskMappingDecoderBase<S extends TaskMappingEntry<IDeployableComponentAdapter<?>, Partition>, T extends TaskMappingEncoding<IDeployableComponentAdapter<?>, S>, P extends ComposablePhenotype<?>>
public abstract class TaskMappingDecoderBase<S extends TaskMappingEntry<ITaskAdapter<?>, Partition>, T extends TaskMappingEncoding<ITaskAdapter<?>, S>, P extends ComposablePhenotype<?>>
extends ComposableDecoderBase<T, P> {
/**
......
AbstractTaskMappingDecoder.java 8daae35d8536b37e000eed45cec870fa94958f2e RED
FailSilentAbstractTaskMappingDecoder.java 64dc3dac76cabf96f0dc39e5e7192c5caa04a7b0 RED
FaultDetectionVotingAbstractTaskMappingDecoder.java 68bcd5b7faedc97269973023e5f9b6eebb020c1e RED
FailSilentAbstractTaskMappingDecoder.java e68e58f1eb1a5400060f804701873eab36c710ed RED
FaultDetectionVotingAbstractTaskMappingDecoder.java a3dcf021b83dce8574f076440fc2fadfc2402a23 RED
TaskInstanceResourceAlignmentDecoder.java 116f72a16a02c9aac617cc4c9684cd583b87e1b6 RED
......@@ -30,7 +30,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegen
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.exception.DecodingException;
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.moea.model.DseSpecification;
......@@ -78,7 +78,7 @@ public class FailSilentAbstractTaskMappingDecoder extends
FlatPhenotypeMap<Phenotype> decodedPhenotypes) throws DecodingException {
outGenotype.replaceConstraints(inGenotype.getConstraints());
for(IDeployableComponentAdapter<?> comp : inGenotype.getRequesters()) {
for(ITaskAdapter<?> comp : inGenotype.getRequesters()) {
Collection<AbstractTaskMappingEntry> abstrEntries =
inGenotype.getMappingEntriesOf(comp);
Collection<FailSilentTaskMappingEntry> instEntries;
......@@ -107,9 +107,9 @@ public class FailSilentAbstractTaskMappingDecoder extends
}
// Remove all tasks that are present in the output encoding but not in the input encoding.
Collection<IDeployableComponentAdapter<?>> rmTasks = new ArrayList<>();
for(IDeployableComponentAdapter<?> comp : outGenotype.getRequesters()) {
IDeployableComponentAdapter<?> rmComponent = comp;
Collection<ITaskAdapter<?>> rmTasks = new ArrayList<>();
for(ITaskAdapter<?> comp : outGenotype.getRequesters()) {
ITaskAdapter<?> rmComponent = comp;
if(comp.isInstantiation()) {
comp = comp.getReplacedComponent();
}
......
......@@ -29,7 +29,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.in
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.extensions.compositegene.exception.DecodingException;
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.moea.model.DseSpecification;
import org.opt4j.core.problem.Decoder;
......@@ -78,7 +78,7 @@ public class FaultDetectionVotingAbstractTaskMappingDecoder extends
FlatPhenotypeMap<Phenotype> decodedPhenotypes) throws DecodingException {
outGenotype.replaceConstraints(inGenotype.getConstraints());
for(IDeployableComponentAdapter<?> comp : inGenotype.getRequesters()) {
for(ITaskAdapter<?> comp : inGenotype.getRequesters()) {
Collection<AbstractTaskMappingEntry> abstrEntries =
inGenotype.getMappingEntriesOf(comp);
Collection<FaultDetectionVotingTaskMappingEntry> instEntries;
......@@ -107,9 +107,9 @@ public class FaultDetectionVotingAbstractTaskMappingDecoder extends
}
// Remove all tasks that are present in the output encoding but not in the input encoding.
Collection<IDeployableComponentAdapter<?>> rmTasks = new ArrayList<>();
for(IDeployableComponentAdapter<?> comp : outGenotype.getRequesters()) {
IDeployableComponentAdapter<?> rmComponent = comp;
Collection<ITaskAdapter<?>> rmTasks = new ArrayList<>();
for(ITaskAdapter<?> comp : outGenotype.getRequesters()) {
ITaskAdapter<?> rmComponent = comp;
if(comp.isInstantiation()) {
comp = comp.getReplacedComponent();
}
......
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