Interface LoadBalance<Balanced_>
- Type Parameters:
Balanced_- type of the item being balanced
- All Known Implementing Classes:
LoadBalanceImpl
public interface LoadBalance<Balanced_>
Calculates the unfairness measure for a particular input.
It is the result
of applying the
load-balancing constraint
collector.-
Method Summary
Modifier and TypeMethodDescriptionloads()Returns the items being balanced, along with their total load.@NonNull BigDecimalThe unfairness measure describes how fairly the load is distributed over the items; the higher the number, the higher the imbalance.
-
Method Details
-
loads
Returns the items being balanced, along with their total load. The iteration order of the map is undefined. For use in justifications, create a defensive copy of the map; the map itself is mutable and will be mutated by the constraint collector. -
unfairness
@NonNull BigDecimal unfairness()The unfairness measure describes how fairly the load is distributed over the items; the higher the number, the higher the imbalance. When zero, the load is perfectly balanced.Unfairness is a dimensionless number which is solution-specific. Comparing unfairness between solutions of different input problems is not helpful. Only compare unfairness measures of solutions which have the same set of balanced items as input.
- Returns:
- never negative, six decimal places
-