Using PIMixin disables ModelicaMixin's initial_state

  • ModelicaMixin implements initial_state() without calling super.initial_state()
  • CSVMixin implements initial_state(), and calls super().initial_state()
  • PIMixin implements history(), without calling super().history().

Important: OptimizationProblem has a history() implementation that defers to initial_state(), and an initial_state() implementation that defers to `history().

Using PIMixin will result in ModelicaMixin's initial_state() never being called. If we change PIMixin by doing super().history() there, we get stuck in an infinite recursion, because PIMixin also implements initial_state(). If we remove that one, it's fine. However, if we also let ModelicaMixin's initial_state() call super().initial_state(), it's back to infinite recursion.

Basically it would be prettier if all classes (other than OptimizationProblem) could just call their respective super() methods, whether they implement initial_state or history. Implementing both makes little sense in my opinion.