Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cycle detection reports unrelated elements #1213

Open
a-sr opened this issue Jun 3, 2022 · 2 comments
Open

Cycle detection reports unrelated elements #1213

a-sr opened this issue Jun 3, 2022 · 2 comments
Assignees
Labels
bug Something isn't working compiler good first issue Good for newcomers

Comments

@a-sr
Copy link
Collaborator

a-sr commented Jun 3, 2022

The cycle detection reports elements that are not included in the actual cycle.
In this example, a cycle is formed only by sim.theta -> con.theta -> con.control -> sim.control. Yet, all ports and reactions are reported as part of the cycle.

cycle_unrelated

I already tested if the issue is caused by the visualization but ReactorInstance.getCycles() reports the following list as causality loop.

[
reaction_0 of main.sim, 
reaction_0 of main.con, 
reaction_0 of main.sou, 
reaction_0 of main.out, 
PortInstance main.con.theta, 
PortInstance main.sim.theta, 
PortInstance main.sou.angle, 
PortInstance main.out.theta, 
PortInstance main.sim.control, 
PortInstance main.con.control, 
PortInstance main.out.control, 
PortInstance main.out.led, 
PortInstance main.con.led, 
PortInstance main.out.speaker, 
PortInstance main.sou.sound
]

Hence, the problem seems to be in the cycle detection itself.

@edwardalee
Copy link
Collaborator

This is addressed by PR #1270.

@a-sr
Copy link
Collaborator Author

a-sr commented Aug 12, 2022

While PR #1270 solves most of the cases, the cycle detection still reports ports as part of a cycle if they are downstream of a reaction on the cycle, even if they do not contribute to the cycle.
CycleDetectionErrorPort
In this example the game_over port is incorrectly reported.

@a-sr a-sr reopened this Aug 12, 2022
@lhstrh lhstrh added the good first issue Good for newcomers label Sep 16, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working compiler good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants