## 2 Materials and Methods
### Metrics for the Evaluation of PROforma Models
#### 2.2.6 Aggregation Metrics  
PROforma is a hierarchical task network language, therefore a CIG is represented in PROforma as a hierarchy of plans. Accordingly, for each metric we have defined an aggregation to better characterize the full model, except in the case of metrics which already consider all the graphs of the model (i.e., model depth and the metrics related to the size of plans). Hereinafter, these metrics will be referred as _full-model metrics_, while the ones computed for a single graph will be referred as _single-graph metrics_.  
We have used different aggregation formula depending on the metric as shown in Table 1. For those metrics that count a particular element of the graph or of the PROforma language, namely, nodes, arcs, plans, decisions, and preconditions, the aggregation metric has been defined as the sum of the values. In the case of the diameter metric within the size category, the aggregation metric has been calculated as weighted average with respect to the number of nodes of each graph.  
For some of the metrics that refer to densities, their aggregation has been defined as the average of the values. This is the case of the metrics coefficient of connectivity, density of plans, and decision density. However, in most cases, the aggregation of the metric has been computed as a weighted average. For example, in the case of the average connector degree metric, the aggregation has been calculated as a weighted average with respect to the number of connector nodes in each graph. Or, in the case of the depth metric, the weights are the number of nodes of every graph. However, the maximum connector degree has been obtained as the maximum over all maximum values.  
The aggregation of the metrics in the partitionability category has been computed as a weighted average with respect to the number of nodes, except for the sequentiality metric where we have used as weight the sum of the number of nodes and the number of arcs. Finally, the aggregation of the metrics connector mismatch and control flow complexity in the connector interplay category and the metric in the concurrency category have been computed as weighted averages with respect to the number of split connector nodes in each graph.  
Table 2 presents the values of the metrics for a PROforma CIG for the assessment and treatment of asthma. The second column displays the values for the top-level plan shown in Figure 1, i.e., single-graph metrics. The third column presents the values of the full-model metrics.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Metric** & **Aggregation Calculated as** \\ \hline Size \(S_{N}\) & Sum of values \\ Number of arcs \(S_{A}\) & Sum of values \\ Diameter _diam_ & Weighted average of values \\ Number of plans \(S_{P}\) & Sum of values \\ Density \(\Delta\) & Weighted average of values \\ Coefficient of connectivity \(CNC\) & Average of values \\ Average connector degree \(\overline{d_{C}}\) & Weighted average of values \\ Maximum connector degree \(\overline{d(c)}\) & Maximum of values \\ Density of plans \(\overline{p}\) & Average of values \\ Decision density \(\delta_{D}\) & Average of values \\ Separability \(\Pi\) & Weighted average of values \\ Sequentiality \(\Xi\) & Weighted average of values \\ Structuredness \(\phi\) & Weighted average of values \\ Depth \(\Lambda\) & Weighted average of values \\ Connector mismatch \(MM\) & Weighted average of values \\ Control flow complexity \(CFC\) & Weighted average of values \\ Number of decisions \(S_{D}\) & Sum of values \\ Number of preconditions \(S_{Precond}\) & Sum of values \\ Token split \(TS\) & Weighted average of values \\ \hline \hline \end{tabular}
\end{table}
Table 1: Aggregation formula for the different graph metrics.