Open modelica-trac-importer opened 6 years ago
Modified by beutlich on 18 Sep 2015 09:07 UTC
Comment by hansolsson on 18 Sep 2015 09:24 UTC To be clear we have three possibilities:
Real volume=0 annotation(HideResult=useNormalizedVolume);
Real volume=0 annotation(HideResult=DynamicSelect(true, useNormalizedVolume));
Real volume=0 annotation(HideResult=true);
The start of "18.3 Annotations for Code Generation"
code_annotation: annotation"(" codeGenerationFlag "=" ( false | true ) ")"
would indicate that option 3 is specified.
Obviously we can decide to extend it to non-literals; assuming there are relevant use cases etc.
(A separate topic is that there are cases where HideResult is overused.)
Comment by beutlich on 18 Sep 2015 09:45 UTC Thanks, Hans. For your convenience I add the origin of this discussion: Physiolibrary#9.
Comment by dietmarw on 2 Oct 2015 20:51 UTC Ticket retargeted after milestone closed
Comment by hansolsson on 1 Apr 2016 12:26 UTC Replying to [comment:3 beutlich]:
Thanks, Hans. For your convenience I add the origin of this discussion: Physiolibrary#9.
Based on that discussion it seems that only literals (as indicated by section 18.3) is an acceptable solution - and that should be clarified.
Note: A contrary view is that there has been a push from customers to allow Evaluate to depend on a parameter, which was implemented in Dymola 2019 I think (as variant 1).
Note: A contrary view is that there has been a push from customers to allow Evaluate to depend on a parameter, which was implemented in Dymola 2019 I think (as variant 1).
So, maybe there should be another discussion and poll then.
I would be interested in a solution as described in the comment by Hans Olsson, especially to use Boolean parameters for Evaluate=true/false, similar to the below:
model evalparam
parameter Boolean beFlexible = true;
final parameter Boolean beFast = not beFlexible annotation (Evaluate=true);
parameter Real myCoefficient = 4.0 annotation (Evaluate=beFast);
Real y;
equation
y = sin(myCoefficient*time);
end evalparam;
This would already cover most of the customer needs I have seen, but the final parameter Boolean beFast
could possibly use a more complex equation, or depend on parameters that are propagated from an extending model.
Reported by beutlich on 4 Mar 2015 11:52 UTC Is it legal to have parameter dependent annotations for code generation, such as HideResults, Evaluate, Inline etc.?
Or should DynamicSelect be used instead
Migrated-From: https://trac.modelica.org/Modelica/ticket/1672