diff --git a/AlgebraicDataflowArchitectureModel/src/simulator/ChannelState.java b/AlgebraicDataflowArchitectureModel/src/simulator/ChannelState.java new file mode 100644 index 0000000..c571236 --- /dev/null +++ b/AlgebraicDataflowArchitectureModel/src/simulator/ChannelState.java @@ -0,0 +1,37 @@ +package simulator; + +import java.util.Map; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import models.algebra.Constant; +import models.algebra.Expression; +import models.dataConstraintModel.Selector; +import models.dataFlowModel.DataTransferChannel; + +public class ChannelState { + private DataTransferChannel channel; + private Map> childrenMap; + private Map, Map> referenceStructure; + + public ChannelState(DataTransferChannel channel) { + this.channel = channel; + } + + public Map getDependentParams(Map channelParameters) { + Map dependentParams = new HashMap<>(); + if (referenceStructure != null) { + List channelParams = new ArrayList<>(); + for (Selector sel: channel.getAllSelectors()) { + channelParams.add(channelParameters.get(sel)); + } + for (Map.Entry paramEnt: referenceStructure.get(channelParams).entrySet()) { + dependentParams.put(paramEnt.getKey(), paramEnt.getValue()); + } + } + return dependentParams; + } + + +}