Research Article

Model-Based Dependability Analysis of Physical Systems with Modelica

Algorithm 1

Pseudo-code for generating Bayesian Networks from Modelica-based models.
(#1) Check if fulfill relationships exist;
(#2) If list of fulfill relationships is empty then
   (a) Bayesian Network List (BNL) is empty;
   (b) Return null;
(#3) else if list of fulfill relationships is not empty then
   (a) Generate all (a list) the Head elements;
   (b) Generate all (a list) the Body elements;
   (c) Extract all the root elements from the Head elements;
(#4) For each root element
   (a) Initialize a Bayesian Network (BN);
   (b) Generate a list of its node-children by exploring them according to a breadth-first visit;
   (c) Compute the Probability Model pm;
   (d) Map the Probability Model pm to the element;
   (e) Extract the set of Physical Components from the list of Children ;
      (i)  For each
      (ii) Build the leaf elements of the BN ();
      (iii) Compute the Probability Model () ;
      (iv) Map/Integrate the Probability Model to the element;
   (f) Extract the set di Requirements/Children from the list of Children ;
      (i)  For each
      (ii)  Generate a list of its node-children
      (iii)  Build the non-leaf elements of the BN ();
      (iv)  Compute the Probability Model () ;
      (v)  Map/Integrate the Probability Model to the element;
   (g) Build BN ();
   (h) Add the BN to the Bayesian Network List (BNL);
(#5) Return BNL;