Modelica.StateGraph.Examples.Utilities.CompositeStep is sometimes locally unbalanced.
In Modelica.StateGraph.Examples.ShowCompositeStep, there are no connection to compositeStep.resume and compositeStep.suspend.
Both these connectors contain an input variable, which are counted as variables in the context of Modelica.StateGraph.Examples.ShowCompositeStep, but the equations that set the value to these connectors is in Modelica.StateGraph.PartialCompositeStep.
In other words, when resume and/or suspend are not connected Modelica.StateGraph.Examples.Utilities.CompositeStep is locally unbalanced.
To me the underlying issue is that the model uses cardinality:
- To add these equations.
- To check that it is only connected once.
I believe the correct solution would be:
- Have zero size as default for both of them
- Use connectorSizing
- The assertion for cardinality<=1 shouldn't be needed as it contains inputs. (
mayOnlyConnectOnceis for non-causal connectors)
But it may break strange models that rely on having gaps in those arrays. The cardinality is so fundamental for the current model that I don't see how we can fix it in a completely backwards compatible way.
I think the safest approach at the moment would be to add some exception for local balance when using cardinality.
Even if we cannot make it fully correct without breaking compatibility we could add a variant corrected as above, and use it in the Example.