Description Usage Arguments Value Examples
Returns the depth of a component in a composite algorithm.
Definition
The depth of a component is equal to:
1 if the component is a constant (ie it has no predecessors),
2 if the component is only directly linked to its parent composite,
the maximal depth of its predecessors + 1 otherwise.
Formula
depth(x)=\begin{cases} 1, & \text{if}\ |N^{-}(x)| = 0 \\ 2, & \text{if}\ \forall y \in N^{-}(x), y = composite(x) \\ max(depth(N^{-}(x)))+1, & \text{otherwise} \end{cases}
Note
In the haricot package, when we plot a composite algorithm,
we plot the input bits and output bits as vertices.
This representation is interesting because it shows the bit-level
interfaces between components.
But the depth concept does not consider input bits and output bits,
and only consider components as single units (the algorithm and its surrounding bits).
The reason for this is to account for the algorithmic complexity or size, rather than the detailed bit mechanics.
1 | get_component_depth(composite, component, ...)
|
composite |
The composite within which we want to measure the depth of a component (R6 class algo_composite). |
component |
The component algorithm that must be part of the composite and whose depth we would like to know (R6 class algo_base | character vector of the component ID). |
The depth of the component (integer).
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.