Skip to main content

group_dispatch_equivalent_assets

Function group_dispatch_equivalent_assets 

Source
fn group_dispatch_equivalent_assets<'a, I>(assets: I) -> Vec<Vec<&'a AssetRef>>
where I: Iterator<Item = &'a AssetRef>,
Expand description

Groups assets that have equivalent dispatch properties.

Assets are first bucketed by dispatch_equivalence_hash() to avoid unnecessary pairwise comparisons. Within each hash bucket, assets are compared using is_dispatch_equivalent(), which is the authoritative check for equivalence. This also handles hash collisions correctly.

The caller must ensure that assets contains only assets eligible for equal-utilisation constraints (i.e. flexible-capacity assets have already been filtered out).