# Anticipatory Troubleshooting
## 6 Evaluation
### Long-Term Experiments
#### 6.3.1 Experimental Setup  
Algorithm 2 describes how we realistically simulated the faults for the long-term experiment, based on the survival curves. First, we sampled for every component a failure time according to its survival curve. Then, a troubleshooting problem was created for the component \(C_{current}\) with the earliest failure time (line 5), and we invoked an AT algorithm to choose whether C needs to be fixed or replaced (line 7). The age and survival curve of \(C\) were then updated according to the chosen repair action. Next, we sampled new failure time for the component that had been repaired. Then, we invoked again an AT algorithm to choose whether there is a healthy component that should be replaced (line 12). If there were such components, their ages and failure times were updated accordingly. This process continued until the failure time of that component exceeded \(T_{limit}\). Then, we returned all costs incurred throughout the experiment. \(T_{limit}\) affects the depth of the MDP; therefore, in our experiments we set \(T_{limit}\) to 28, to enable the MDP algorithms to run in a reasonable time. Figure 5: Diagnosis experiments’ results, for \(S1\) (**left**) and \(S2\) (**right**). Troubleshooting cost for revealed sensors. ```
1\(TotalCosts\gets 0\);
2 foreach Component \(C\)do
3\(C_{fail}\leftarrow\) sample a failure time according to the survival curve of \(C\)
4\(T_{current}\leftarrow\min\limits_{C\in COMPS}C_{fail}\)
5\(C_{current}\leftarrow\underset{C\in COMPS}{\operatorname*{arg\,min}}C_{fail}\)
6 while\(T_{current}\leq T_{limit}\)do
7\(RepairAction\gets FixOrReplace(C_{current})\)
8\(TotalCosts\gets TotalCosts+cost(overhead)+cost(RepairAction)\)
9 Update survival curve of \(C_{current}\) according to \(RepairAction\)
10\(C_{fail}\leftarrow\) sample a new failure time for \(C_{current}\)
11 foreach Component \(C^{\prime}\
eq C_{current}\)do
12 if\(RepalecHealthy(C^{\prime})\)then
13\(TotalCosts\gets TotalCosts+cost(Repalec)\)
14 Update survival curve of \(C^{\prime}\) accordingly
15\(C^{\prime}_{fail}\leftarrow\) sample a new failure time for \(C^{\prime}\)
16
17\(T_{current}\leftarrow\underset{C\in COMPS}{\operatorname*{arg\,min}}C_{fail}\)
18\(C_{current}\leftarrow\underset{C\in COMPS}{\operatorname*{arg\,min}}C_{fail}\)
```  
**Algorithm 2**Long-term simulation algorithm. Note that we did not consider in these experiments the costs incurred due to sensing action. This is because in the long-term experiments we focus on how the evaluated algorithms solve the fix-replace and replace-healthy dilemmas. Thus, we measure only the cost incurred by repair actions (\(cost(Fix(C)\)) and \(cost(Replace(C))\)) and the overhead cost (\(cost(overhead)\)). Evaluated Algorithms: In the experiments we compared the following algorithms to solve the fix-replace and replace-healthy dilemmas:  
* Always fix (AF), in which all faulty components are repaired using the Fix action. * Always replace (AR), in which all faulty components are repaired using the Replace action. * DR1, in which \(DR1\) (Section 5.1) is used to choose the appropriate repair action. * N-\(MDP_{FixRep}\), our MDP-based solver for solving only the fix-replace dilemma. It uses the \(MDP_{FixReplace}\), as described in Section 5.2.1, where \(N\) stands for the level of granularity in the MDP. * N-\(MDP_{RepHead}\), our MDP-based solver that considers both dilemmas, as described in Algorithm 1 in Section 5.2.3, where \(N\) stands for the levels of granularity in the MDPs. Independent variables: We examined the effects of the following three independent variables on the performance of the different AT algorithms:  
* Punish factor. The punish factor parameter \(p\) controls the difference between the _AfterFix_ curve and the regular survival curve. We did this by computing the _AfterFix_ as follows:  
\[S_{C}(t,Age_{C})=e^{-(\lambda\cdot p\cdot t)^{p}} \tag{7}\]  
This _AfterFix_ curve holds the intuitive requirement that a replaced component is expected to survive longer than a fixed component.