cobald.composite.weighted module
- class cobald.composite.weighted.WeightedComposite(*children: Pool, weight: Literal['supply', 'utilisation', 'allocation'] = 'supply')[source]
Bases:
CompositePoolComposition of pools weighted by their current state
The aggregation of children’s
demand,utilisationandallocationis weighted by each child’sweight. Children can be weighted by theirsupply,utilisationorallocation. Note that weighting thedemandonly applies to distributing it to children; the composite’sdemandis always exactly as set by its controller.If the total weight is 0, the following fallback applies:
demandis applied uniformly, andutilisationandallocationare 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