Class WeightProfiles

java.lang.Object
com.eqixiac.equinix.design.solve.WeightProfiles

public final class WeightProfiles extends Object
Named starting points for objective weights. A profile is data, not code: it is only a map from objective id to relative weight, and a spec can override any entry or weight a plug-in objective that no profile mentions.
  • Field Details

    • DEFAULT

      public static final String DEFAULT
      The profile used when a spec names none and gives no weights.
      See Also:
  • Method Details

    • names

      public static Set<String> names()
      Returns:
      the names of the built-in profiles
    • of

      public static Map<String,Double> of(String name)
      Parameters:
      name - a profile name, case-insensitive
      Returns:
      its weights by objective id
      Throws:
      IllegalArgumentException - when no profile has that name; the message lists the names
    • resolve

      public static Map<String,Double> resolve(DesignObjectives objectives)
      Turns a spec's objectives into weights that sum to 1: the named profile (or "balanced" when the spec names none and lists no weights), overlaid with the spec's explicit weights. When the spec lists weights but names no profile, only the listed objectives are weighted.
      Parameters:
      objectives - the spec's objectives; null means the default profile
      Returns:
      weight per objective id, summing to 1, in a stable order; entries may be 0
      Throws:
      IllegalArgumentException - for an unknown profile, a negative or non-finite weight, or weights that are all zero