cobald.composite.weighted module

class cobald.composite.weighted.WeightedComposite(*children: Pool, weight: Literal['supply', 'utilisation', 'allocation'] = 'supply')[source]

Bases: CompositePool

Composition of pools weighted by their current state

The aggregation of children’s demand, utilisation and allocation is weighted by each child’s weight. Children can be weighted by their supply, utilisation or allocation. Note that weighting the demand only applies to distributing it to children; the composite’s demand is always exactly as set by its controller.

If the total weight is 0, the following fallback applies:

The latter rule expresses that the total fitness of a Pool is 0 either if the fitness of all its children is 0, or there are no children.

property allocation

Fraction of the provided resources which are assigned for usage

children = []
property demand

The volume of resources to be provided by this pool

property supply

The volume of resources that is provided by this pool

property utilisation

Fraction of the provided resources which are actively used