Commit cc043432 authored by Alexander Diewald's avatar Alexander Diewald

Merge branch '4010' into 'master'

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

See merge request !334
parents da68a8d6 b3c4e12a
......@@ -6,4 +6,4 @@ bb48b2d09b92efcb1b2d3e382555089bb7ed5db5 GRE 62731e1cef32fe93f2c2017f93f5ba1f054d5197 GREEN 79f8960b63762045008d27def3752d735dad43f0 GREEN 4f023e1247701c0e8f329575caddbbcac0066200 GREEN 6a8815a2fcd5d7f0cc8169d11154b04867f06bcd GREEN f260307c09e9d26303a46ca2a69ce6c76eae926f GREEN
......@@ -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