net.sf.cpsolver.coursett.model
Class FinalSectioning

java.lang.Object
  extended by net.sf.cpsolver.coursett.model.FinalSectioning
All Implemented Interfaces:
Runnable

public class FinalSectioning
extends Object
implements Runnable

Student sectioning (after a solution is found).

In the current implementation, students are not re-sectioned during the search, but a student re-sectioning algorithm is called after the solver is finished or upon the user’s request. The re-sectioning is based on a local search algorithm where the neighboring assignment is obtained from the current assignment by applying one of the following moves:

The solver maintains a queue, initially containing all courses with multiple classes. During each iteration, an improving move (i.e., a move decreasing the overall number of student conflicts) is applied once discovered. Re-sectioning is complete once no more improving moves are possible. Only consistent moves (i.e., moves that respect class limits and other constraints) are considered. Any additional courses having student conflicts after a move is accepted are added to the queue.
Since students are not re-sectioned during the timetabling search, the computed number of student conflicts is really an upper bound on the actual number that may exist afterward. To compensate for this during the search, student conflicts between subparts with multiple classes are weighted lower than conflicts between classes that meet at a single time (i.e., having student conflicts that cannot be avoided by re-sectioning).

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

Nested Class Summary
 class FinalSectioning.Move
           
 class FinalSectioning.MoveBetweenCfgs
           
 
Field Summary
static double sEps
           
 
Constructor Summary
FinalSectioning(TimetableModel model)
           
 
Method Summary
 FinalSectioning.MoveBetweenCfgs createMove(Configuration firstConfig, Student firstStudent, Configuration secondConfig, Student secondStudent)
           
 FinalSectioning.Move createMove(Lecture firstLecture, Student firstStudent, Lecture secondLecture, Student secondStudent)
           
 void findAndPerformMoves(Configuration configuration, HashSet lecturesToRecompute)
           
 void findAndPerformMoves(Lecture lecture, HashSet lecturesToRecompute)
          Swap students between this and the same lectures (lectures which differ only in the section)
 FinalSectioning.Move findAwayMove(Lecture lecture)
           
 FinalSectioning.MoveBetweenCfgs findMove(Configuration config, Student student)
           
 FinalSectioning.Move findMove(Lecture lecture, Student student)
           
 void resection(Lecture lecture, boolean recursive, boolean configAsWell)
          Perform sectioning on the given lecture
 void run()
           
 int test(Student student, Lecture lecture)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sEps

public static double sEps
Constructor Detail

FinalSectioning

public FinalSectioning(TimetableModel model)
Method Detail

run

public void run()
Specified by:
run in interface Runnable

resection

public void resection(Lecture lecture,
                      boolean recursive,
                      boolean configAsWell)
Perform sectioning on the given lecture

Parameters:
lecture - given lecture
recursive - recursively resection lectures affected by a student swap
configAsWell - resection students between configurations as well

findAndPerformMoves

public void findAndPerformMoves(Lecture lecture,
                                HashSet lecturesToRecompute)
Swap students between this and the same lectures (lectures which differ only in the section)


findAndPerformMoves

public void findAndPerformMoves(Configuration configuration,
                                HashSet lecturesToRecompute)

findAwayMove

public FinalSectioning.Move findAwayMove(Lecture lecture)

findMove

public FinalSectioning.Move findMove(Lecture lecture,
                                     Student student)

findMove

public FinalSectioning.MoveBetweenCfgs findMove(Configuration config,
                                                Student student)

createMove

public FinalSectioning.Move createMove(Lecture firstLecture,
                                       Student firstStudent,
                                       Lecture secondLecture,
                                       Student secondStudent)

createMove

public FinalSectioning.MoveBetweenCfgs createMove(Configuration firstConfig,
                                                  Student firstStudent,
                                                  Configuration secondConfig,
                                                  Student secondStudent)

test

public int test(Student student,
                Lecture lecture)