cobald.composite.weighted module
- class cobald.composite.weighted.WeightedComposite(*children: Pool, weight: typing_extensions.Literal[supply, utilisation, allocation] = 'supply')[source]
Bases:
CompositePool
Composition of pools weighted by their current state
The aggregation of children’s
demand
,utilisation
andallocation
is weighted by each child’sweight
. Children can be weighted by theirsupply
,utilisation
orallocation
. Note that weighting thedemand
only applies to distributing it to children; the composite’sdemand
is always exactly as set by its controller.If the total weight is 0, the following fallback applies:
demand
is applied uniformly, andutilisation
andallocation
are assumed 1 if there are no children, 0 otherwise.
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