org.cpsolver.studentsct.heuristics

## Class EnrollmentSelection

- java.lang.Object
- - org.cpsolver.studentsct.heuristics.EnrollmentSelection

- All Implemented Interfaces:
    ValueSelection<Request,Enrollment>

      public class EnrollmentSelection
      extends Object
      implements ValueSelection<Request,Enrollment>

  Enrollment selection criterion. It is similar to `GeneralValueSelection`, however, it is not allowed to assign a enrollment to a dummy student `Student.isDummy()` that is conflicting with an enrollment of a real student.
  Version:
    StudentSct 1.3 (Student Sectioning)
    Copyright (C) 2007 - 2014 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/.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected List<Enrollment>` | `iTabu`
    `protected int` | `iTabuPos`
    `protected int` | `iTabuSize`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `init(Solver<Request,Enrollment> solver)` Initialization
    `boolean` | `isAllowed(Assignment<Request,Enrollment> assignment, Enrollment value)` true, if it is allowed to assign given value
    `boolean` | `isAllowed(Assignment<Request,Enrollment> assignment, Enrollment value, Set<Enrollment> conflicts)` true, if it is allowed to assign given value
    `Enrollment` | `selectValue(Solution<Request,Enrollment> solution, Request selectedVariable)` Value selection

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

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

- - ### Field Detail

    - #### iTabuSize

          protected int iTabuSize

    - #### iTabu

          protected List<Enrollment> iTabu

    - #### iTabuPos

          protected int iTabuPos

  - ### Constructor Detail

    - #### EnrollmentSelection

          public EnrollmentSelection()

    - #### EnrollmentSelection

          public EnrollmentSelection(DataProperties properties)

      Constructor
      Parameters:
        `properties` - input configuration

  - ### Method Detail

    - #### init

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

      Initialization
      Specified by:
        `init` in interface `ValueSelection<Request,Enrollment>`
      Parameters:
        `solver` - current solver

    - #### isAllowed

          public boolean isAllowed(Assignment<Request,Enrollment> assignment,
                                   Enrollment value)

      true, if it is allowed to assign given value
      Parameters:
        `assignment` - current assignment
        `value` - given value
      Returns:
        true if it is allowed

    - #### isAllowed

          public boolean isAllowed(Assignment<Request,Enrollment> assignment,
                                   Enrollment value,
                                   Set<Enrollment> conflicts)

      true, if it is allowed to assign given value
      Parameters:
        `assignment` - current assignment
        `value` - given value
        `conflicts` - conflicting assignments
      Returns:
        true if it is allowed

    - #### selectValue

          public Enrollment selectValue(Solution<Request,Enrollment> solution,
                                        Request selectedVariable)

      Value selection
      Specified by:
        `selectValue` in interface `ValueSelection<Request,Enrollment>`
      Parameters:
        `solution` - current solution
        `selectedVariable` - selected variable
      Returns:
        selected value (of the given variable)