org.cpsolver.coursett.heuristics

## Class FixCompleteSolutionNeighbourSelection

- java.lang.Object
- - org.cpsolver.ifs.assignment.context.NeighbourSelectionWithContext<Lecture,Placement,FixCompleteSolutionNeighbourSelection.FixCompleteSolutionNeighbourContext>
  - - org.cpsolver.coursett.heuristics.FixCompleteSolutionNeighbourSelection

- All Implemented Interfaces:
    CanHoldContext, HasAssignmentContext<Lecture,Placement,FixCompleteSolutionNeighbourSelection.FixCompleteSolutionNeighbourContext>, NeighbourSelection<Lecture,Placement>

      public class FixCompleteSolutionNeighbourSelection
      extends NeighbourSelectionWithContext<Lecture,Placement,FixCompleteSolutionNeighbourSelection.FixCompleteSolutionNeighbourContext>

  University course timetabling neighbour selection.
  When a complete solution is found, it is improved by limited depth backtracking search. This way it is ensured that the fund solution is at least locally optimal.
  Version:
    CourseTT 1.3 (University Course Timetabling)
    Copyright (C) 2006 - 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/.
  Author:
    Tomáš Müller

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `FixCompleteSolutionNeighbourSelection.FixCompleteSolutionNeighbourContext`

  - ### Field Summary

    - ### Fields inherited from class org.cpsolver.ifs.assignment.context.NeighbourSelectionWithContext

      `iContextOverride`

    - ### Fields inherited from interface org.cpsolver.ifs.assignment.context.CanHoldContext

      `sMaxSize`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FixCompleteSolutionNeighbourSelection(DataProperties config)`
    `FixCompleteSolutionNeighbourSelection(DataProperties config, NeighbourSelection<Lecture,Placement> parent)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `FixCompleteSolutionNeighbourSelection.FixCompleteSolutionNeighbourContext` | `createAssignmentContext(Assignment<Lecture,Placement> assignment)` Create a new assignment context for the given assignment.
    `void` | `init(Solver<Lecture,Placement> solver)` Criterion initialization
    `Neighbour<Lecture,Placement>` | `selectNeighbour(Solution<Lecture,Placement> solution)` Try to improve existing solution by backtracking search of very limited depth.

    - ### Methods inherited from class org.cpsolver.ifs.assignment.context.NeighbourSelectionWithContext

      `getAssignmentContextReference, getContext, getContext, hasContextOverride, isSingleContextSolver, setAssignmentContextReference`

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

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

- - ### Constructor Detail

    - #### FixCompleteSolutionNeighbourSelection

          public FixCompleteSolutionNeighbourSelection(DataProperties config,
                                                       NeighbourSelection<Lecture,Placement> parent)
                                                throws Exception

      Throws:
        `Exception`

    - #### FixCompleteSolutionNeighbourSelection

          public FixCompleteSolutionNeighbourSelection(DataProperties config)
                                                throws Exception

      Throws:
        `Exception`

  - ### Method Detail

    - #### init

          public void init(Solver<Lecture,Placement> solver)

      Description copied from interface: `NeighbourSelection`
      Criterion initialization
      Specified by:
        `init` in interface `NeighbourSelection<Lecture,Placement>`
      Overrides:
        `init` in class `NeighbourSelectionWithContext<Lecture,Placement,FixCompleteSolutionNeighbourSelection.FixCompleteSolutionNeighbourContext>`
      Parameters:
        `solver` - current solver

    - #### selectNeighbour

          public Neighbour<Lecture,Placement> selectNeighbour(Solution<Lecture,Placement> solution)

      Try to improve existing solution by backtracking search of very limited depth. See `NeighbourSelectionWithSuggestions` for more details.
      Parameters:
        `solution` - given solution
      Returns:
        a neighbour assignment

    - #### createAssignmentContext

          public FixCompleteSolutionNeighbourSelection.FixCompleteSolutionNeighbourContext createAssignmentContext(Assignment<Lecture,Placement> assignment)

      Description copied from interface: `HasAssignmentContext`
      Create a new assignment context for the given assignment. If there are already some variables assigned in the value, the method should make sure that the context is appropriately initialized.
      Parameters:
        `assignment` - an assignment for which there needs to be an assignment context
      Returns:
        a new instance of the assignment context, filled according to the given assignment