Skip to content

Commit

Permalink
Prevent redundant deadline SYNC nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
lsk567 committed Nov 11, 2024
1 parent 8aabe44 commit a145e33
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/main/java/org/lflang/analyses/dag/DagGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,12 @@ public Dag generateDag(StateSpaceDiagram stateSpaceDiagram) {
// Modeling the release deadline as a completion deadline.
// Completion deadline = release time + WCET + deadline value.
TimeValue deadlineTime = associatedSync.timeStep.add(reactionWcet).add(deadlineValue);
// Check if a SYNC node with the same time already exists.
// Skip the node creation steps if a node with the same timestep exists.
if (dag.dagNodes.stream()
.anyMatch(
node -> node.nodeType == dagNodeType.SYNC && node.timeStep.equals(deadlineTime)))
continue;
// Create and add a SYNC node inferred from the deadline.
DagNode syncNode = addSyncNodeToDag(dag, deadlineTime, syncNodesPQueue);
// Add an edge from the reaction node to the SYNC node.
Expand Down

0 comments on commit a145e33

Please sign in to comment.