net.sf.cpsolver.coursett.model
Class OnFlySectioning

java.lang.Object
  extended by net.sf.cpsolver.coursett.model.OnFlySectioning
All Implemented Interfaces:
ModelListener

public class OnFlySectioning
extends Object
implements ModelListener

On fly student sectioning.

In this mode, students are resectioned after each iteration, but only between classes that are affected by the iteration. This slows down the solver, but it can dramatically improve results in the case when there is more stress put on student conflicts (e.g., Woebegon College example).

Parameters:

ParameterTypeComment
OnFlySectioning.EnabledBooleanEnable on fly sectioning (if enabled, students will be resectioned after each iteration)
OnFlySectioning.RecursiveBooleanRecursively resection lectures affected by a student swap
OnFlySectioning.ConfigAsWellBooleanResection students between configurations as well

Version:
CourseTT 1.1 (University Course Timetabling)
Copyright (C) 2006 Tomáš Müller
muller@unitime.org
Lazenska 391, 76314 Zlin, Czech Republic

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 2.1 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Constructor Summary
OnFlySectioning(TimetableModel model)
          Constructor
 
Method Summary
 void afterAssigned(long iteration, Value value)
          FinalSectioning.resection(Lecture, boolean, boolean) is called when given iteration number is greater than zero.
 void afterUnassigned(long iteration, Value value)
          Called after a value is unassigned from its variable (Value.variable()).
 void beforeAssigned(long iteration, Value value)
          Called before a value is assigned to its variable (Value.variable()).
 void beforeUnassigned(long iteration, Value value)
          Called before a value is unassigned from its variable (Value.variable()).
 void constraintAdded(Constraint constraint)
          Constraint is added to the model
 void constraintRemoved(Constraint constraint)
          Constraint is removed from the model
 boolean init(Solver solver)
          Initialization
 void variableAdded(Variable variable)
          Variable is added to the model
 void variableRemoved(Variable variable)
          Variable is removed from the model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnFlySectioning

public OnFlySectioning(TimetableModel model)
Constructor

Parameters:
model - timetabling model
Method Detail

variableAdded

public void variableAdded(Variable variable)
Description copied from interface: ModelListener
Variable is added to the model

Specified by:
variableAdded in interface ModelListener
Parameters:
variable - added variable

variableRemoved

public void variableRemoved(Variable variable)
Description copied from interface: ModelListener
Variable is removed from the model

Specified by:
variableRemoved in interface ModelListener
Parameters:
variable - removed variable

constraintAdded

public void constraintAdded(Constraint constraint)
Description copied from interface: ModelListener
Constraint is added to the model

Specified by:
constraintAdded in interface ModelListener
Parameters:
constraint - added constraint

constraintRemoved

public void constraintRemoved(Constraint constraint)
Description copied from interface: ModelListener
Constraint is removed from the model

Specified by:
constraintRemoved in interface ModelListener
Parameters:
constraint - removed constraint

beforeAssigned

public void beforeAssigned(long iteration,
                           Value value)
Description copied from interface: ModelListener
Called before a value is assigned to its variable (Value.variable()).

Specified by:
beforeAssigned in interface ModelListener
Parameters:
iteration - current iteration
value - value to be assigned

beforeUnassigned

public void beforeUnassigned(long iteration,
                             Value value)
Description copied from interface: ModelListener
Called before a value is unassigned from its variable (Value.variable()).

Specified by:
beforeUnassigned in interface ModelListener
Parameters:
iteration - current iteration
value - value to be unassigned

afterAssigned

public void afterAssigned(long iteration,
                          Value value)
FinalSectioning.resection(Lecture, boolean, boolean) is called when given iteration number is greater than zero.

Specified by:
afterAssigned in interface ModelListener
Parameters:
iteration - current iteration
value - value to be assigned

afterUnassigned

public void afterUnassigned(long iteration,
                            Value value)
Description copied from interface: ModelListener
Called after a value is unassigned from its variable (Value.variable()).

Specified by:
afterUnassigned in interface ModelListener
Parameters:
iteration - current iteration
value - value to be unassigned

init

public boolean init(Solver solver)
Initialization

Specified by:
init in interface ModelListener
Parameters:
solver - IFS solver