Maximum Layer Breadth
Metric ID
slcomp.MaxLayerBreadth
Description
Use this metric to determine the maximum number of child model components that a single model layer in the unit or component contains.
This metric analyzes these model components:
Simulink® Block Diagrams
Simulink Subsystems
Stateflow® Charts
MATLAB® Functions
Supported Artifacts
You can collect this metric for:
To control what the dashboard classifies as a unit or component, see Categorize Models in Hierarchy as Components or Units.
Computation Details
The metric:
Includes model references as child model components.
Does not count relationships to data dictionaries. For example, suppose that you have a block diagram that contains a subsystem and requires a Simulink Data Dictionary (SLDD) file. The layer breadth for the model component is one, not two.
Does not count relationships to other units. For example, if you have a component with a required relationship to another model that is a unit, that relationship is not included in the metric count. The metric only analyzes the relationship if the other model is not a unit.
Collection
To collect data for this metric:
In the Model Maintainability Dashboard, in the Component Structure section, point to the Breadth widget and click the Run metrics for widget icon. The Breadth widget shows the maximum breadth found in the current unit or component. If you click on the Breadth widget, you can view a table that shows the breadth for each artifact.
Use
getMetrics
with the metric identifierslcomp.MaxLayerBreadth
.
Results
For this metric, instances of metric.Result
return
Value
as the maximum number of child model
components for a unit or component.
Examples
Suppose you have a unit, u3
, that contains three subsystems:
e1
, e2
, and e3
.
e1
has a layer breadth of 2, e2
has a layer
breadth of three, and e3
has a layer breadth of four. The maximum
layer breadth for the unit is four because that is the maximum of the layer breadth
values associated with the child model components for the unit. You can view the layer
breadth associated with each child model component in the Metric
Details table by clicking on the Breadth
widget.