## 3 Dynamic Reliability Framework
### Stochastic Hybrid Fault Tree Automaton  
In a recent paper, a new mathematical framework named Stochastic Hybrid Fault Tree Automaton (SHyFTA) [45], specifically designed for dynamic reliability problems, was conceived. This framework builds on the separation of concern paradigm, which aims at undertaking the modelling of a dynamic reliability problem by breaking down the hybrid process of a system into two separate subprocesses, the stochastic and the deterministic, which are first modelled independently and then joined by means of state variables. Therefore, in such a type of modelling the first step consists of the analysis and synthesis of the two abovementioned mathematical models, separately. In particular, the stochastic process is designed using the Dynamic Fault Tree modelling formalism, whereas the deterministic one can be modelled with any mathematical or logic formalism. A Stochastic Hybrid Fault Tree Automaton can be implemented by means of its characteristic set of variables constituted by 13 elements:  
\[\rm\{S,\ e,\ X,\ Y,\delta,\ H,G,\ F,\ P,\ GA,\ BE,\ T,\ C\} \tag{5}\]  
For instance, the matlab.mixin.heterogenous has been used as superclass (of the BasicElement) in order to support the implementation of heterogeneous arrays, whereas the class handle has been used to support the reference of a variable (of the library) by address. The object-oriented paradigm allows to extension of parents' class, the implementation of the BasicElement class as superclass of BasicEvent and Gate classes. In fact, these latter are characterized by a set of identical properties (e.g., Index, Name, Status, FailureTime, etc.) which are inherited from the BasicElement class and by other properties which are defined in their specialized classes. Thanks to this formalism, the Fault Tree model can be defined as a collection of objects of the type BasicElement (no matter if they are Basic Events or Gates):  
1. A one-to-one relationship between the class StatusTime and the class BasicElement. The shared variable which links these two classes is the attribute Status (datatype StatusTime) of the BasicElement instance; in the simulation of the Fault Tree, this property provides the current status of the component and the last firing time (the point-time H);
2. A n-to-n relationship between the classes BasicElement, Gate and BasicEvent: any generic instance of type BasicElement can be the input of one or more other BasicElement instances. For instance, a repeated Basic Event for two or more Gates, or when a Gate or a Basic Event can be the input of multiple Spare gates. Clearly, the SHyFTOO library consists of several other SW components. The SHyFTOO package is downloaded with some components that, according to the model to simulate, need to be edited. Among the relevant files to modify, it is worth mentioning the following:  
Figure 1: SHyFTOO library: UML Class diagram (developed in Matlab®). * SHyFTmain.m: this is the main file of a SHyFTA model; it contains the main parameters characterizing the simulation (e.g., Time of Simulation, Iterations, and so on);
* initFaultTree.m: in this file, it is possible to specify the structure of the fault tree model;
* shyftaMetrics.m: in this file it is possible to code ad hoc variables used to define metrics which are out of the scope of the native SHyFTA analysis (e.g., reliability, availability of each component are built-in metrics). For instance, it can be used to implement Importance Measure Analysis, sensitivity, or other metrics. For further information, interested readers can refer to [23], which explains the main properties of each class and how to construct a SHyFTA model. The structure of the generic initFaultTree.m is shown in Figure 2. The main information to include in this script are the mission time T\({}_{\text{m}}\) and the events and gates constituting the fault tree. In [24], the SHyFTOO library has been extended to support the integration with Simulink.