public class TimetableModel extends ConstantModel<Lecture,Placement>
sPercentageFormat, sTimeFormat
Constructor and Description |
---|
TimetableModel(DataProperties properties) |
Modifier and Type | Method and Description |
---|---|
void |
addConstraint(Constraint<Lecture,Placement> constraint)
Adds a constraint to the model
|
void |
addCriterion(Criterion<Lecture,Placement> criterion)
Register a new criterion
|
void |
addStudent(Student student) |
void |
addStudentGroup(StudentGroup group) |
Set<Placement> |
conflictValuesSkipWeakeningConstraints(Assignment<Lecture,Placement> assignment,
Placement value)
Returns the set of conflicting variables with this value, if it is
assigned to its variable.
|
protected void |
decJenrl(Assignment<Lecture,Placement> assignment,
Student student,
Lecture l1,
Lecture l2)
Decrement
JenrlConstraint between the given two classes by the given student |
Set<Student> |
getAllStudents() |
Map<String,String> |
getBounds(Assignment<Lecture,Placement> assignment) |
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(Assignment<Lecture,Placement> assignment)
Global info
|
Map<String,String> |
getInfo(Assignment<Lecture,Placement> assignment,
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() |
List<StudentConflict> |
getStudentConflictCriteria()
List of student conflict criteria
|
List<StudentGroup> |
getStudentGroups() |
StudentSectioning |
getStudentSectioning()
Returns interface to the student sectioning functions needed during course timetabling.
|
int |
getStudentWorkDayLimit() |
double |
getTotalValue(Assignment<Lecture,Placement> assignment)
Value of the current solution.
|
double |
getTotalValue(Assignment<Lecture,Placement> assignment,
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() |
protected void |
incJenrl(Assignment<Lecture,Placement> assignment,
Student student,
Lecture l1,
Lecture l2)
Increment
JenrlConstraint between the given two classes by the given student |
boolean |
isAllowBreakHard() |
boolean |
isOnFlySectioningEnabled() |
void |
removeConstraint(Constraint<Lecture,Placement> constraint)
Removes a constraint from the model
|
void |
removeCriterion(Criterion<Lecture,Placement> criterion)
Unregister an existing criterion
|
void |
removeStudent(Student student) |
void |
restoreBest(Assignment<Lecture,Placement> assignment)
Restore the best ever found assignment into the current assignment
|
void |
saveBest(Assignment<Lecture,Placement> assignment)
Save the current assignment as the best ever found assignment
|
void |
setOnFlySectioningEnabled(boolean onFlySectioning) |
void |
setYear(int year) |
void |
switchStudents(Assignment<Lecture,Placement> assignment)
Student final sectioning (switching students between sections of the same
class in order to minimize overall number of student conflicts)
|
void |
switchStudents(Assignment<Lecture,Placement> assignment,
TerminationCondition<Lecture,Placement> termination)
Student final sectioning (switching students between sections of the same
class in order to minimize overall number of student conflicts)
|
addVariable, afterAssigned, afterUnassigned, beforeAssigned, beforeUnassigned, constantVariables, hasConstantVariables, isConstant, removeVariable
addGlobalConstraint, addModelListener, afterAssigned, afterUnassigned, assignedVariables, assignedVariables, beforeAssigned, beforeUnassigned, bestUnassignedVariables, bestUnassignedVariables, clearAssignmentContexts, clearBest, conflictConstraints, conflictValues, conflictValues, constraints, countConstraints, countGlobalConstraints, countVariables, createAssignmentContexts, createInheritedAssignment, createReference, getBestPerturbations, getBestUnassignedVariables, getBestValue, getCriteria, getCriterion, getDefaultAssignment, getEmptyAssignment, getExtendedInfo, getExtendedInfo, getInfo, getInfo, getInfoProviders, getModelListeners, getPerc, getPercRev, getTotalValue, getTotalValue, globalConstraints, inConflict, inConflict, init, invalidateVariablesWithInitialValueCache, modelListenerOfType, nrAssignedVariables, nrAssignedVariables, nrUnassignedVariables, nrUnassignedVariables, perturbVariables, perturbVariables, perturbVariables, perturbVariables, perturbVariables, removeCriterion, removeGlobalConstraint, removeModelListener, removeReference, restoreBest, restoreBest, saveBest, setBestValue, setDefaultAssignment, toString, toString, unassignedHardConstraints, unassignedVariables, unassignedVariables, variables, variablesWithInitialValue, weaken
public TimetableModel(DataProperties properties)
public DistanceMetric getDistanceMetric()
public int getStudentWorkDayLimit()
public StudentSectioning getStudentSectioning()
DefaultStudentSectioning
, can be changed using the StudentSectioning.Class parameter.public DataProperties getProperties()
public void switchStudents(Assignment<Lecture,Placement> assignment, TerminationCondition<Lecture,Placement> termination)
assignment
- current assignmenttermination
- optional termination conditionpublic void switchStudents(Assignment<Lecture,Placement> assignment)
assignment
- current assignmentpublic Map<String,String> getInfo(Assignment<Lecture,Placement> assignment, Collection<Lecture> variables)
Model
public void addConstraint(Constraint<Lecture,Placement> constraint)
Model
addConstraint
in class Model<Lecture,Placement>
constraint
- a constraintpublic void removeConstraint(Constraint<Lecture,Placement> constraint)
Model
removeConstraint
in class Model<Lecture,Placement>
constraint
- a constraintpublic List<InstructorConstraint> getInstructorConstraints()
public List<GroupConstraint> getGroupConstraints()
public List<JenrlConstraint> getJenrlConstraints()
public List<RoomConstraint> getRoomConstraints()
public List<DepartmentSpreadConstraint> getDepartmentSpreadConstraints()
public List<SpreadConstraint> getSpreadConstraints()
public List<ClassLimitConstraint> getClassLimitConstraints()
public List<FlexibleConstraint> getFlexibleConstraints()
public double getTotalValue(Assignment<Lecture,Placement> assignment)
Model
Value.toDouble(Assignment)
.getTotalValue
in class Model<Lecture,Placement>
assignment
- current assignmentpublic double getTotalValue(Assignment<Lecture,Placement> assignment, Collection<Lecture> variables)
Model
Value.toDouble(Assignment)
. Only variables from the given set are
considered.getTotalValue
in class Model<Lecture,Placement>
assignment
- current assignmentvariables
- sub-problempublic int getYear()
public void setYear(int year)
public Set<Student> getAllStudents()
public void addStudent(Student student)
public void removeStudent(Student student)
public static String getMem()
public Set<Placement> conflictValuesSkipWeakeningConstraints(Assignment<Lecture,Placement> assignment, Placement value)
WeakeningConstraint
are ignored.assignment
- current assignmentvalue
- placement that is being consideredpublic List<BitSet> getWeeks()
public List<StudentGroup> getStudentGroups()
public void addStudentGroup(StudentGroup group)
public void saveBest(Assignment<Lecture,Placement> assignment)
Model
protected void incJenrl(Assignment<Lecture,Placement> assignment, Student student, Lecture l1, Lecture l2)
JenrlConstraint
between the given two classes by the given studentprotected void decJenrl(Assignment<Lecture,Placement> assignment, Student student, Lecture l1, Lecture l2)
JenrlConstraint
between the given two classes by the given studentpublic void restoreBest(Assignment<Lecture,Placement> assignment)
Model
restoreBest
in class Model<Lecture,Placement>
assignment
- current assignmentpublic boolean isAllowBreakHard()
public boolean isOnFlySectioningEnabled()
public void setOnFlySectioningEnabled(boolean onFlySectioning)
public void addCriterion(Criterion<Lecture,Placement> criterion)
Model
addCriterion
in class Model<Lecture,Placement>
criterion
- a criterionpublic void removeCriterion(Criterion<Lecture,Placement> criterion)
Model
removeCriterion
in class Model<Lecture,Placement>
criterion
- a criterionpublic List<StudentConflict> getStudentConflictCriteria()