org.cpsolver.studentsct.online.selection

## Interface MultiCriteriaBranchAndBoundSelection.SelectionCriterion

- All Superinterfaces:
    MultiCriteriaBranchAndBoundSelection.SelectionComparator
  All Known Implementing Classes:
    BestPenaltyCriterion, EqualWeightCriterion, OnlineSectioningCriterion
  Enclosing class:
    MultiCriteriaBranchAndBoundSelection

      public static interface MultiCriteriaBranchAndBoundSelection.SelectionCriterion
      extends MultiCriteriaBranchAndBoundSelection.SelectionComparator

  Multi-criteria selection interface.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canImprove(Assignment<Request,Enrollment> assignment, int idx, Enrollment[] current, Enrollment[] best)` Bound
    `int` | `compare(Assignment<Request,Enrollment> assignment, Enrollment[] current, Enrollment[] best)` Compare two solutions
    `double` | `getTotalWeight(Assignment<Request,Enrollment> assignment, Enrollment[] enrollments)` For backward compatibility, return a weighted sum

    - ### Methods inherited from interface org.cpsolver.studentsct.online.selection.MultiCriteriaBranchAndBoundSelection.SelectionComparator

      `compare`

- - ### Method Detail

    - #### compare

          int compare(Assignment<Request,Enrollment> assignment,
                      Enrollment[] current,
                      Enrollment[] best)

      Compare two solutions
      Parameters:
        `assignment` - current assignment
        `current` - current solution
        `best` - best known solution
      Returns:
        true if current solution is better than the best one

    - #### canImprove

          boolean canImprove(Assignment<Request,Enrollment> assignment,
                             int idx,
                             Enrollment[] current,
                             Enrollment[] best)

      Bound
      Parameters:
        `assignment` - current assignment
        `idx` - current request index
        `current` - current solution
        `best` - best known solution
      Returns:
        if the current solution can be extended and possibly improve upon the best known solution

    - #### getTotalWeight

          double getTotalWeight(Assignment<Request,Enrollment> assignment,
                                Enrollment[] enrollments)

      For backward compatibility, return a weighted sum
      Parameters:
        `assignment` - current assignment
        `enrollments` - current solution
      Returns:
        solution weight (weighted sum)