net.sf.cpsolver.coursett.model
Class TimetableModel

java.lang.Object
  extended by net.sf.cpsolver.ifs.model.Model<V,T>
      extended by net.sf.cpsolver.ifs.constant.ConstantModel<Lecture,Placement>
          extended by net.sf.cpsolver.coursett.model.TimetableModel

public class TimetableModel
extends ConstantModel<Lecture,Placement>

Timetable model.

Version:
CourseTT 1.2 (University Course Timetabling)
Copyright (C) 2006 - 2010 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 inherited from class net.sf.cpsolver.ifs.model.Model
iAssignedVariables, iPerturbVariables, iUnassignedVariables, sPercentageFormat, sTimeFormat
 
Constructor Summary
TimetableModel(DataProperties properties)
           
 
Method Summary
 void addConstraint(Constraint<Lecture,Placement> constraint)
          Adds a constraint to the model
 void addStudent(Student student)
           
 Set<Placement> conflictValuesSkipWeakeningConstraints(Placement value)
          Returns the set of conflicting variables with this value, if it is assigned to its variable.
 Set<Student> getAllStudents()
           
 Map<String,String> getBounds()
           
 List<ClassLimitConstraint> getClassLimitConstraints()
           
 List<DepartmentSpreadConstraint> getDepartmentSpreadConstraints()
          The list of all departmental spread constraints
 DistanceMetric getDistanceMetric()
           
 List<FlexibleConstraint> getFlexibleConstraints()
           
 List<GroupConstraint> getGroupConstraints()
          The list of all group constraints
 Map<String,String> getInfo()
          Global info
 Map<String,String> getInfo(Collection<Lecture> variables)
          Returns information about the current solution.
 List<InstructorConstraint> getInstructorConstraints()
          The list of all instructor constraints
 List<JenrlConstraint> getJenrlConstraints()
          The list of all jenrl constraints
static String getMem()
          Returns amount of allocated memory.
 DataProperties getProperties()
           
 List<RoomConstraint> getRoomConstraints()
          The list of all room constraints
 List<SpreadConstraint> getSpreadConstraints()
           
 double getTotalValue()
          Value of the current solution.
 double getTotalValue(Collection<Lecture> variables)
          Value of the current solution.
 List<BitSet> getWeeks()
          The method creates date patterns (bitsets) which represent the weeks of a semester.
 int getYear()
           
 void removeConstraint(Constraint<Lecture,Placement> constraint)
          Removes a constraint from the model
 void removeStudent(Student student)
           
 void setYear(int year)
           
 void switchStudents()
          Student final sectioning (switching students between sections of the same class in order to minimize overall number of student conflicts)
 String toString()
           
 
Methods inherited from class net.sf.cpsolver.ifs.constant.ConstantModel
addVariable, afterAssigned, afterUnassigned, beforeAssigned, beforeUnassigned, constantVariables, hasConstantVariables, isConstant, removeVariable
 
Methods inherited from class net.sf.cpsolver.ifs.model.Model
addCriterion, addGlobalConstraint, addModelListener, assignedVariables, bestUnassignedVariables, clearBest, conflictConstraints, conflictValues, constraints, countConstraints, countGlobalConstraints, countVariables, getBestPerturbations, getBestUnassignedVariables, getCriteria, getCriterion, getExtendedInfo, getInfoProviders, getModelListeners, getPerc, getPercRev, globalConstraints, inConflict, init, invalidateVariablesWithInitialValueCache, modelListenerOfType, nrAssignedVariables, nrUnassignedVariables, perturbVariables, perturbVariables, removeCriterion, removeCriterion, removeGlobalConstraint, removeModelListener, restoreBest, restoreBest, saveBest, unassignedHardConstraints, unassignedVariables, variables, variablesWithInitialValue, weaken
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimetableModel

public TimetableModel(DataProperties properties)
Method Detail

getDistanceMetric

public DistanceMetric getDistanceMetric()

getProperties

public DataProperties getProperties()

switchStudents

public void switchStudents()
Student final sectioning (switching students between sections of the same class in order to minimize overall number of student conflicts)


toString

public String toString()
Overrides:
toString in class Model<Lecture,Placement>

getBounds

public Map<String,String> getBounds()

getInfo

public Map<String,String> getInfo()
Global info

Overrides:
getInfo in class Model<Lecture,Placement>

getInfo

public Map<String,String> getInfo(Collection<Lecture> variables)
Description copied from class: Model
Returns information about the current solution. Information from all model listeners and constraints is also included. Only variables from the given set are considered.

Overrides:
getInfo in class Model<Lecture,Placement>

addConstraint

public void addConstraint(Constraint<Lecture,Placement> constraint)
Description copied from class: Model
Adds a constraint to the model

Overrides:
addConstraint in class Model<Lecture,Placement>

removeConstraint

public void removeConstraint(Constraint<Lecture,Placement> constraint)
Description copied from class: Model
Removes a constraint from the model

Overrides:
removeConstraint in class Model<Lecture,Placement>

getInstructorConstraints

public List<InstructorConstraint> getInstructorConstraints()
The list of all instructor constraints


getGroupConstraints

public List<GroupConstraint> getGroupConstraints()
The list of all group constraints


getJenrlConstraints

public List<JenrlConstraint> getJenrlConstraints()
The list of all jenrl constraints


getRoomConstraints

public List<RoomConstraint> getRoomConstraints()
The list of all room constraints


getDepartmentSpreadConstraints

public List<DepartmentSpreadConstraint> getDepartmentSpreadConstraints()
The list of all departmental spread constraints


getSpreadConstraints

public List<SpreadConstraint> getSpreadConstraints()

getClassLimitConstraints

public List<ClassLimitConstraint> getClassLimitConstraints()

getFlexibleConstraints

public List<FlexibleConstraint> getFlexibleConstraints()

getTotalValue

public double getTotalValue()
Description copied from class: Model
Value of the current solution. It is the sum of all assigned values, i.e., Value.toDouble().

Overrides:
getTotalValue in class Model<Lecture,Placement>

getTotalValue

public double getTotalValue(Collection<Lecture> variables)
Description copied from class: Model
Value of the current solution. It is the sum of all assigned values, i.e., Value.toDouble(). Only variables from the given set are considered.

Overrides:
getTotalValue in class Model<Lecture,Placement>

getYear

public int getYear()

setYear

public void setYear(int year)

getAllStudents

public Set<Student> getAllStudents()

addStudent

public void addStudent(Student student)

removeStudent

public void removeStudent(Student student)

getMem

public static String getMem()
Returns amount of allocated memory.

Returns:
amount of allocated memory to be written in the log

conflictValuesSkipWeakeningConstraints

public Set<Placement> conflictValuesSkipWeakeningConstraints(Placement value)
Returns the set of conflicting variables with this value, if it is assigned to its variable. Conflicts with constraints that implement WeakeningConstraint are ignored.


getWeeks

public List<BitSet> getWeeks()
The method creates date patterns (bitsets) which represent the weeks of a semester.

Returns:
a list of BitSets which represents the weeks of a semester.