net.sf.cpsolver.studentsct.heuristics.selection
Class StandardSelection

java.lang.Object
  extended by net.sf.cpsolver.studentsct.heuristics.selection.StandardSelection
All Implemented Interfaces:
NeighbourSelection<Request,Enrollment>

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

Use the provided variable and value selection for some time. The provided variable and value selection is used for the number of iterations equal to the number of all variables in the problem. If a complete solution is found, the neighbour selection is stopped (it returns null).

Parameters:

Parameter Type Comment
Neighbour.StandardIterations Long Number of iterations to perform. If -1, number of iterations is set to the number of unassigned variables.


Version:
StudentSct 1.2 (Student Sectioning)
Copyright (C) 2007 - 2010 Tomas Muller
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
protected  long iNrIterations
           
 
Constructor Summary
StandardSelection(DataProperties properties, VariableSelection<Request,Enrollment> variableSelection, ValueSelection<Request,Enrollment> valueSelection)
          Constructor (variable and value selection are expected to be already initialized).
 
Method Summary
 void init(Solver<Request,Enrollment> solver)
          Initialization
 Neighbour<Request,Enrollment> selectNeighbour(Solution<Request,Enrollment> solution)
          Employ the provided VariableSelection and ValueSelection and return the selected value as SimpleNeighbour.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iNrIterations

protected long iNrIterations
Constructor Detail

StandardSelection

public StandardSelection(DataProperties properties,
                         VariableSelection<Request,Enrollment> variableSelection,
                         ValueSelection<Request,Enrollment> valueSelection)
Constructor (variable and value selection are expected to be already initialized).

Parameters:
properties - configuration
variableSelection - variable selection
valueSelection - value selection
Method Detail

init

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

Specified by:
init in interface NeighbourSelection<Request,Enrollment>

selectNeighbour

public Neighbour<Request,Enrollment> selectNeighbour(Solution<Request,Enrollment> solution)
Employ the provided VariableSelection and ValueSelection and return the selected value as SimpleNeighbour. The selection is stopped (null is returned) after the number of iterations equal to the number of variables in the problem or when a complete solution is found.

Specified by:
selectNeighbour in interface NeighbourSelection<Request,Enrollment>
Parameters:
solution - given solution
Returns:
a neighbour assignment


Copyright © 2014 UniTime LLC. All Rights Reserved.