net.sf.cpsolver.studentsct.heuristics.selection

## Class BranchBoundSelection

- java.lang.Object
- - net.sf.cpsolver.studentsct.heuristics.selection.BranchBoundSelection

- All Implemented Interfaces:
    NeighbourSelection<Request,Enrollment>
  Direct Known Subclasses:
    OnlineSelection, ResectionIncompleteStudentsSelection, ResectionUnassignedStudentsSelection

      public class BranchBoundSelection
      extends Object
      implements NeighbourSelection<Request,Enrollment>

  Section all students using incremental branch & bound (no unassignments). All students are taken in a random order, for each student a branch & bound algorithm is used to find his/her best schedule on top of all other existing student schedules (no enrollment of a different student is unassigned).
  Parameters:

  Parameter | Type | Comment
  --- | --- | ---
  Neighbour.BranchAndBoundTimeout | `Integer` | Timeout for each neighbour selection (in milliseconds).
  Neighbour.BranchAndBoundMinimizePenalty | `Boolean` | If true, section penalties (instead of section values) are minimized: overall penalty is minimized together with the maximization of the number of assigned requests and minimization of distance conflicts -- this variant is to better mimic the case when students can choose their sections (section times).

  Version:
    StudentSct 1.2 (Student Sectioning)
    Copyright (C) 2007 - 2010 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `BranchBoundSelection.BranchBoundNeighbour` Branch & bound neighbour -- a schedule of a student
    `class` | `BranchBoundSelection.Selection` Branch & bound selection for a student

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DistanceConflict` | `iDistanceConflict`
    `protected double` | `iDistConfWeight`
    `protected boolean` | `iMinimizePenalty`
    `protected StudentSectioningModel` | `iModel`
    `protected StudentOrder` | `iOrder`
    `protected Iterator<Student>` | `iStudentsEnumeration`
    `protected int` | `iTimeout`
    `protected TimeOverlapsCounter` | `iTimeOverlaps`
    `static boolean` | `sDebug`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BranchBoundSelection(DataProperties properties)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BranchBoundSelection.Selection` | `getSelection(Student student)` Branch & bound selection for a student
    `void` | `init(Solver<Request,Enrollment> solver)` Criterion initialization
    `void` | `init(Solver<Request,Enrollment> solver, String name)` Initialize
    `Neighbour<Request,Enrollment>` | `selectNeighbour(Solution<Request,Enrollment> solution)` Select neighbour.
    `void` | `setModel(StudentSectioningModel model)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### iTimeout

          protected int iTimeout

    - #### iDistanceConflict

          protected DistanceConflict iDistanceConflict

    - #### iTimeOverlaps

          protected TimeOverlapsCounter iTimeOverlaps

    - #### iModel

          protected StudentSectioningModel iModel

    - #### sDebug

          public static boolean sDebug

    - #### iStudentsEnumeration

          protected Iterator<Student> iStudentsEnumeration

    - #### iMinimizePenalty

          protected boolean iMinimizePenalty

    - #### iOrder

          protected StudentOrder iOrder

    - #### iDistConfWeight

          protected double iDistConfWeight

  - ### Constructor Detail

    - #### BranchBoundSelection

          public BranchBoundSelection(DataProperties properties)

      Constructor
      Parameters:
        `properties` - configuration

  - ### Method Detail

    - #### init

          public void init(Solver<Request,Enrollment> solver,
                           String name)

      Initialize

    - #### setModel

          public void setModel(StudentSectioningModel model)

    - #### init

          public void init(Solver<Request,Enrollment> solver)

      Description copied from interface: `NeighbourSelection`
      Criterion initialization
      Specified by:
        `init` in interface `NeighbourSelection<Request,Enrollment>`

    - #### selectNeighbour

          public Neighbour<Request,Enrollment> selectNeighbour(Solution<Request,Enrollment> solution)

      Select neighbour. All students are taken, one by one in a random order. For each student a branch & bound search is employed.
      Specified by:
        `selectNeighbour` in interface `NeighbourSelection<Request,Enrollment>`
      Parameters:
        `solution` - given solution
      Returns:
        a neighbour assignment

    - #### getSelection

          public BranchBoundSelection.Selection getSelection(Student student)

      Branch & bound selection for a student