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

Exploration.alg: Resolve multiple warnings.

parent 729f08f7
No related branches found
No related tags found
No related merge requests found
Showing
with 46 additions and 26 deletions
Message.java 6c99d518bfc9e31bb174c299017b561ec69314aa RED
MessageGenerator.java 4d7b8bb7d59a10129c686a344241701f9b0fd376 RED
Message.java c76010ee09dbf91335ddbba7dd062c961c94a23b RED
MessageGenerator.java cc0c56a394e5ccbd909d981305d52ba2021fc8fd RED
......@@ -173,7 +173,7 @@ public class Message implements Comparable<Message> {
}
/** Returns the {@link IMappingEntry} of the sender of this message. */
public IMappingEntry getSender() {
public IMappingEntry<?, ?> getSender() {
return sender;
}
......
......@@ -126,6 +126,7 @@ public class MessageGenerator<S extends TaskMappingEntry<IDeployableComponentAda
* {@link IMappingEntry}s if the sender and the receiver are not mapped onto the same
* {@link IExecutionUnitAdapter}.
*/
@SuppressWarnings("unchecked")
private Message generateMessageForSenderEntry(ISignalAdapter<?> senderChannel,
InstantiatedTaskMappingEntry senderMappingEntry,
Collection<S> mappingEntriesOfSuccesors,
......@@ -180,7 +181,8 @@ public class MessageGenerator<S extends TaskMappingEntry<IDeployableComponentAda
private Collection<InternalIsolatedCommunicationSet>
getOtherIsolationCommConstraints(T outGenotype, S entry) {
// TODO: here we use the knowledge that we have instantiated task mapping entries.
IMappingEntry actualEntry = entry.getAssociatedElement(AbstractTaskMappingEntry.class);
IMappingEntry<?, ?> actualEntry =
entry.getAssociatedElement(AbstractTaskMappingEntry.class);
Collection<InternalIsolatedCommunicationSet> otherConstraints = new HashSet<>();
Collection<InternalIsolatedCommunicationSet> isoComm =
......
IMappingEncoding.java cd427e08588b59de29490c75c8a07947a115d4d7 RED
IMappingEntry.java eba204428624604d850b3656ff58d56fb0c69591 RED
IMappingEncoding.java faa8d770688ae74d54318b155be59d39a3fe3cd9 RED
IMappingEntry.java 21bbb8e403894b56a0b0b97685fa526c4ea01c25 RED
......@@ -34,6 +34,10 @@ public interface IMappingEncoding<S extends IRequestAdapter<?>, T extends IResou
*/
public Collection<T> getAllocatedResourcesFor(S source);
/**
* Returns the set of {@link IResourceAdapter}s to which {@link IRequestAdapter}s can be
* allocated.
*/
public Collection<T> getResources();
/**
......
......@@ -33,5 +33,8 @@ public interface IMappingEntry<S extends IRequestAdapter<?>, T extends IResource
/** Return target resource to which the request is mapped. */
T getTarget();
/**
* Creates a clone/copy of the mapping entry containing the same source and target references.
*/
IMappingEntry<S, T> clone();
}
IMessageRouter.java 614435555c3e3966179d5462220a2e008f5a5ec0 RED
MessageRouterBase.java bf2a94c29c4df1128816ba95be1bf55e0aca920b RED
ShortestPathRouter.java 5f5c7ec5a104015ada6d7552bacf2d4d3fe93b1e RED
IMessageRouter.java 502b0083ba82de6a70813c4c7ca9606ebb2ba65f RED
MessageRouter.java f3d02c7b380380b6020eb63240e8dd4537208819 RED
ShortestPathRouter.java 757864be955c0b8fae4ce490cfc843e29ea06729 RED
......@@ -31,8 +31,12 @@ import org.jgrapht.graph.DefaultEdge;
* @author diewald
*/
public interface IMessageRouter {
/**
* Defines the strategy implemented by a message router. Currently, only shortest path routing
* is supported.
*/
public enum RoutingStrategy {
/** Route messages with a minimal number of intermediate hops. */
SHORTEST_PATH;
}
......
......@@ -38,6 +38,7 @@ public class MessageRouter implements IMessageRouter {
/** Representation of input system model */
protected SystemModelAdapter<?, ?, ?, ?, ?, ?> systemModelAdapter;
/** The actual message router that implements a routing strategy. */
private IMessageRouter delegate;
/** Contains the calculated routes of the generated {@link Message}s. */
......
......@@ -44,6 +44,7 @@ import org.jgrapht.graph.DirectedSubgraph;
public class ShortestPathRouter extends MessageRouter {
/** Buffers the already calculated shortest paths for the sender {@link IResourceAdapter}. */
@SuppressWarnings("unused")
private Map<IResourceAdapter<?>, BellmanFordShortestPath<IResourceAdapter<?>, DefaultEdge>> shortestPathForSender;
/** Constructs a simple shortest path router for a given exploration run */
......@@ -80,12 +81,12 @@ public class ShortestPathRouter extends MessageRouter {
// throw e;
// }
if(shortestPathForCurrentMessage == null) {
shortestPathForCurrentMessage =
new BellmanFordShortestPath<IResourceAdapter<?>, DefaultEdge>(
pcgEncoding.getActualGraph(), source);
// shortestPathForSender.put(source, shortestPathForCurrentMessage);
}
// if(shortestPathForCurrentMessage == null) {
shortestPathForCurrentMessage =
new BellmanFordShortestPath<IResourceAdapter<?>, DefaultEdge>(
pcgEncoding.getActualGraph(), source);
// shortestPathForSender.put(source, shortestPathForCurrentMessage);
// }
for(IResourceAdapter<?> currentReceiver : receiverResources) {
List<DefaultEdge> shortestMessagePath = null;
......
TDMABusScheduler.java f25bcd63b0a8dd2f5e72c72261246286bf48c841 RED
TDMABusScheduler.java b637503506b0a53020d35d3d944ec5d8c8f101bf RED
EDFSchedulerBase.java ccef414626ed16974de7a2524cf68fcef718fcb8 RED
FailSilentEDFScheduler.java 121a3f20080cf87677e4cb6c695751ee7cf70cc9 RED
FaultDetectionVotingEDFScheduler.java 01c337cc9870e7ccdf9adf69a61474b0e8f13196 RED
FaultDetectionVotingEDFScheduler.java b16293a95822a802cf87ea88ecba7180913698c9 RED
......@@ -28,8 +28,8 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.solution.TimeSlot;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IDeployableComponentAdapter;
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.dse.sysmodel.arch.taskgraph.AcyclicTaskGraph;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.taskgraph.ChannelAdapterWeightedEdge;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.taskgraph.TaskGraph;
import org.fortiss.af3.exploration.alg.dse.sysmodel.faultmodel.FaultDetector;
import org.fortiss.af3.exploration.model.ExplorationSpecification;
......@@ -66,7 +66,7 @@ public class FaultDetectionVotingEDFScheduler extends
Apfloat voterDelay = new Apfloat(0, DOUBLE_PRECISION);
TaskGraph taskGraph = acycItgEnc.getTaskGraphOf(receiver);
AcyclicTaskGraph taskGraph = acycItgEnc.getTaskGraphOf(receiver);
for(ChannelAdapterWeightedEdge edge : taskGraph.getGraph().incomingEdgesOf(receiver)) {
IDeployableComponentAdapter<?> sender = taskGraph.getGraph().getEdgeSource(edge);
......
DependencyEdge.java 2de1bcec554c6167f132b3808040704867c65b7f RED
DependencyGraph.java e5cb4014cde4fcec189db78b18e374bc4ea29c32 RED
DependencyGraph.java 3c7e6385ed928f6a0bf9d55c05a75415234bb25c RED
IDependencyModule.java 51c66e0f96ef56e9c5f34ead3b4efeddf2193b55 RED
......@@ -79,6 +79,10 @@ public abstract class DependencyGraph<V, T extends IDependencyModule<V, ? extend
/** Operators which implement an identity operation. */
private Multimap<Class<? extends V>, T> identityOperators = HashMultimap.create();
/**
* Identity operators whose only purpose is to place an input encoding in the phenotype. Such a
* operator does not declare any other dependencies.
*/
private Map<Class<? extends V>, T> pureIdentityOperators = new HashMap<>();
/** Constructor. */
......
AF3JGraphTVisualizer.java 3608982f88f8605806a93887c7637f05cfaad39f RED
JGraphTVisualizer.java 178b8a5caeba118ce61d867a4f090bdfaaa33021 RED
NamedAF3Vertex.java a149c2cc614086aeac840e5624af97b906802a4e RED
NamedVertex.java e2e0efb1b9fd37926907a6e3daf1a0e486b12ce7 RED
NamedVertex.java d7f25cd2df6da0569a4b7bcad23683a1cd9d244e RED
ObjectJGraphTVisualizer.java 284fd7554765867b5b08701e502063c54d55ea05 RED
ObjectVertex.java e9249d0502db6fe91b70f333c5dbe30ceadbc0e8 RED
AF3Utils.java ae4bb78f77989e3a5689bfff80298c1bdeccdb3a RED
AF3Utils.java 32a99e6c777f54f31dd81e4771daf6067be1aa7e RED
DesignSpaceExplorationModelElementFactory.java 9dc330973f132c4b936e4dc7ee8407614faf2ff6 RED
ExplorationAlgDebugUtils.java ff9feee46a3d00dd21d007a53f71f2de1ce10a94 RED
ExplorationAlgDebugUtils.java 74c0f408542f3656481173ee71a14dfef0a77814 RED
ExplorationAlgUtils.java 1deb317ed1d276e778fb64d207a1784a4919518b RED
ExplorationEcoreUtils.java 48ed07aec3cd93e66d37abc10d50636d591f1c71 RED
GraphUtils.java a1cec037a4d54bcf196dc5eebddc72b033993d6f RED
......
......@@ -55,6 +55,7 @@ import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.Ta
import org.fortiss.af3.exploration.alg.dse.backend.opt4j.encoding.taskmapping.abstractmapping.AbstractTaskMappingEntry;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IDeployableComponentAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IModelElementAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IResourceAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.IResourceConnectionAdapter.ConnectionType;
import org.fortiss.af3.exploration.alg.dse.sysmodel.arch.SystemModelAdapter;
import org.fortiss.af3.exploration.alg.dse.sysmodel.mapping.IMappingEncoding;
......@@ -604,7 +605,7 @@ public class AF3Utils {
* {@code null} if none is found.
*/
public static ComponentArchitecture getFirstComponentPool(
IMappingEncoding<IDeployableComponentAdapter<?>, ?, IMappingEntry<IDeployableComponentAdapter<?>, ?>> mapping) {
IMappingEncoding<IDeployableComponentAdapter<?>, IResourceAdapter<?>, IMappingEntry<IDeployableComponentAdapter<?>, IResourceAdapter<?>>> mapping) {
for(IDeployableComponentAdapter<?> deployableComponent : mapping.getRequesters()) {
if(deployableComponent.isInstantiation()) {
// TODO: Avoid casting: Parameterize the IModelElementAdapter to use EObject-derived
......
......@@ -109,7 +109,7 @@ public class ExplorationAlgDebugUtils {
encoding.getConstraintsOf(InternalIsolatedCommunicationSet.class);
// TODO: Remove the ugly casting when converting the internal constraints into "real" ones.
for(InternalIsolatedCommunicationSet curConstr : constrs) {
for(IMappingEntry entry : curConstr.getIsolatedCommunicationSet()) {
for(IMappingEntry<?, ?> entry : curConstr.getIsolatedCommunicationSet()) {
if(!encoding.containsEntry((AbstractTaskMappingEntry)entry)) {
return false;
}
......
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