title: Testing the inheritance structure of a package in Modelica
body: <p>I would like to test the inheritance structure of a media package in a set of models so that I can define the correct set of variables for a model, and am at a loss for how to do this.</p>
  <p>For example, I am trying to write a generic model that can take a few different media as input, such as DryAirNasa and R134a.  Since DryAirNasa does not model the two-phase region and as a result the state records liq and vap will not be valid, I would like some way of creating a conditional set of variable declarations so that these state records are only defined for R134a.  It seems to me that one natural way to do this is to test the inheritance structure of the medium package.  If the medium used inherits from PartialTwoPhaseMedium, then I can define the two-phase variables; otherwise, I will not define them.</p>
  <p>However, it's not clear to me how to write such a test in Modelica.  Ideally, I would like the code to be something like:</p>
  <blockquote>
  <p>if isEqual(classOfMedium(Medium), Modelica.Media.Interfaces.PartialTwoPhaseMedium) then</p>
  <p>variable definitions</p>
  <p>end if;</p>
  </blockquote>
  <p>Any ideas?</p>