Local Classes

1 General Description

In Modelica it is possible to define local classes nested inside a class, like Lpin in C1 below.



2 Simulation of C1




3 Classes That Contain Local Classes

Local classes are considered as elements of the type of the class within which they are declared. The "field name" of such a local class is the class name, and the type is the type representation of the local class as a set of pairs according to our general type representation.



4 Simulation of Main




5 Alternative to Local Classes

The local classes LocalClass1 and LocalClass2 could be moved outside the class Main with some changes of names.





6 Simulation of Main2