Commit f0e1d6e3 authored by Alexander Diewald's avatar Alexander Diewald

DSE-BusBandwidthOpt: Use integers (ids) to access signal sizes

If a map with signal entries (or any other EMF object) is used in the
functional getter, serialization fails since the serialization of the
EMF framework is orthogonal to the Java serialization mechanisms.
Consequently, we may only use types in the functional getters that are
serializable by Java itself.

Issue-Ref: 4010
Issue-Url: https://af3-developer.fortiss.org/issues/4010Signed-off-by: Alexander Diewald's avatarAlexander Diewald <diewald@fortiss.org>
parent da68a8d6
......@@ -6,4 +6,4 @@ ExplorationModelElementFactory.java bb48b2d09b92efcb1b2d3e382555089bb7ed5db5 GRE
ExplorationReflectionUtils.java 62731e1cef32fe93f2c2017f93f5ba1f054d5197 GREEN
ExplorationUtils.java 79f8960b63762045008d27def3752d735dad43f0 GREEN
ModelSnapshotExtractUtils.java 4f023e1247701c0e8f329575caddbbcac0066200 GREEN
PatternFactoryUtils.java 6a8815a2fcd5d7f0cc8169d11154b04867f06bcd GREEN
PatternFactoryUtils.java f260307c09e9d26303a46ca2a69ce6c76eae926f YELLOW
......@@ -127,9 +127,9 @@ public class PatternFactoryUtils {
Allocation allocation = createAllocation(signal, route2);
Map<Signal, Number> sigSizeMap = createSignalSizeMap(signalSet);
ArithmeticPropertyLiteral<Signal, Number> bandwidth =
createArithmeticPropertyLiteral(signalSet, s -> sigSizeMap.get(s), "Signal Size");
Map<Integer, Integer> sigSizeMap = createSignalSizeMap(signalSet);
ArithmeticPropertyLiteral<Signal, Number> bandwidth = createArithmeticPropertyLiteral(
signalSet, s -> sigSizeMap.get(s.getId()), "Signal Size");
Sum sum = createSum(signalSet.getCastedSet(IModelElement.class), allocation, bandwidth);
......@@ -142,13 +142,13 @@ public class PatternFactoryUtils {
* Fetches the size of all given {@link Signal}s from their source {@link TaskOutputPort}s and
* stores them in an associative {@link Map}.
*/
private static Map<Signal, Number> createSignalSizeMap(Set<Signal> signalSet) {
Map<Signal, Number> sizeMap = new HashMap<>();
private static Map<Integer, Integer> createSignalSizeMap(Set<Signal> signalSet) {
Map<Integer, Integer> sizeMap = new HashMap<>();
for(Signal sig : signalSet.getEntries()) {
TaskOutputPort port = sig.getSourceTaskPort();
Number sigSize = getAnnotationValue(port, MessageSize.class, Integer.class);
sizeMap.put(sig, sigSize);
Integer sigSize = getAnnotationValue(port, MessageSize.class, Integer.class);
sizeMap.put(sig.getId(), sigSize);
}
return sizeMap;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment