-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support connections between (causal) variables connect(var1, var2)
#3287
Comments
It seems reasonable. I'm not sure how much the connection code will like this, but it's worth trying. |
It can be made to like it 😊 |
@baggepinnen are you then implying that the following JSML code:
should generate code that looks like this:
...after this issue is resolved? A key point here is that connect statements (at least in JSML) are unordered. I don't know about MTK, but if I understand you correctly, these are semantically different in MTK (or at least should be):
So during JSML code generation, I would follow the ordering in the |
They are semantically different in MTK right now, but we would most of the time have the required information to enforce that an output is connected to one or several inputs, so we could also decide that the order is unimportant, I.e., the two connect statements are semantically identical and error if the user passes anything that isn't an IO connection. |
How will this handle multi-connections?
|
It is already handled by the analysis-point code, as long as at most one connector is an output and the other ones are inputs. The semantics then are connect(output, input1, input2, input3) expands to output ~ input1
output ~ input2
output ~ input3 |
In modelica and JSML one can
connect
two variables that are marked asoutput
andinput
. In MTK, we can currently onlyconnect
systems that are@connector
, and we thus have theRealInput
,RealOutput
in MTKstdlib. This is awkward, and makes the translation from JSML to MTK difficult.This request is to allow
connect
between two variablesand these connect statement should normally expand to
u ~ y
, unless an analysis is requested.The text was updated successfully, but these errors were encountered: