Replacement of deprecated function cardinality(c) in Modelica
问题 In the documentation it is indicated, that cardinality() function is deprecated and should no longer be used. However, it is still used in the libraries such as ThermoSysPro. e.g. if (cardinality(C) == 0) then some code end if; where C is FluidInlet or FluidOutlet Could anyone give a simple example of how it could be replaced? 回答1: The usual solution is to make the connector conditional, and if enabled you require that it is connected. For physical connectors you can see how heatports and