Following the `straight_average_intermediate -- TEST1` in the snippet (XXX) we divide the calculation up into 3 sub-groups: 1,3,4 and 2,5,6 at the bottom level followed by 0,1,2 at the top level.
For sub-group 1,3,4 the opinion and components are defined according to the diagram, noting that Node 1 trusts itself fully (trust_factor = 1) and that `intermediate_results` is empty because we are at the bottom level.
At this point we have intermediate results for the output of the sub-group which can be passed on as input to subsequent calculations. Since comp1 will be in those calculations, we set its `intermediate_results` as follows:
Now we are ready to move a level up and do the 0,1,2 sub-group. Since we haven't defined `comp0` yet we do so as follows, noting that it starts with no `intermediate_results`:
We also reset the `trust_factor` for `comp1` and `comp2` because now we are representing the trust Node 0 has for them, rather than the trust they have for themselves (as we did previously):
```python
comp1.trust_factor=0.9
comp2.trust_factor=0.9
```
Next is to define the AlgorithmInput and do the calculation: