【发布时间】:2016-08-02 01:31:17
【问题描述】:
我正在研究一个包含多个子系统和大量变量/方程的大型模型。我一直在子系统上使用 protected 属性,因此只有系统级结果在模拟结果中可见。这使得在 Dymola 模拟选项卡或 FMU 输入/输出中查找系统级结果变得更加容易。但在某些情况下,如果还能够看到子系统的完整详细信息,那就太好了。
是否可以根据布尔参数或其他方式有条件地应用 protected 属性?
例如,是否可以像下面的伪代码一样做一些事情?
// Parameter that sets whether or not to use the protected attribute on subsystems.
parameter Boolean useProtected = true;
// Conditionally define the subsystem with or without protected attribute
if (useProtected) then
protected subsystem subsystem1 = ...
else
subsystem subsystem1 = ...
end if;
谢谢, 贾斯汀
【问题讨论】: