public class Lecture extends VariableWithContext<Lecture,Placement,Lecture.LectureContext> implements ConstantVariable<Placement>
Modifier and Type | Class and Description |
---|---|
class |
Lecture.LectureContext |
Modifier and Type | Field and Description |
---|---|
boolean |
iCommitted |
static boolean |
sSaveMemory |
sMaxSize
Constructor and Description |
---|
Lecture(Long id,
Long solverGroupId,
Long schedulingSubpartId,
String name,
Collection<TimeLocation> timeLocations,
Collection<RoomLocation> roomLocations,
int nrRooms,
Placement initialPlacement,
int minClassLimit,
int maxClassLimit,
double room2limitRatio)
Constructor
|
Lecture(Long id,
Long solverGroupId,
String name) |
Modifier and Type | Method and Description |
---|---|
Set<JenrlConstraint> |
activeJenrls(Assignment<Lecture,Placement> assignment)
Active jenrl constraints (active mean that there is at least one student
between its classes)
|
void |
addActiveJenrl(Assignment<Lecture,Placement> assignment,
JenrlConstraint constr)
Add active jenrl constraint (active mean that there is at least one
student between its classes)
|
void |
addContstraint(Constraint<Lecture,Placement> constraint)
Adds a constraint.
|
void |
addStudent(Assignment<Lecture,Placement> assignment,
Student student)
Add an enrolled student
|
boolean |
allowBreakHard() |
boolean |
areStudentConflictsHard(Lecture other) |
boolean |
canShareRoom() |
boolean |
canShareRoom(Lecture other) |
Set<GroupConstraint> |
canShareRoomConstraints() |
int |
classLimit(Assignment<Lecture,Placement> assignment) |
int |
classLimit(Assignment<Lecture,Placement> assignment,
Placement value,
Set<Placement> conflicts) |
void |
clearIgnoreStudentConflictsWithCache() |
void |
clearValueCache() |
int |
compareTo(Lecture o) |
List<Placement> |
computeValues(Assignment<Lecture,Placement> assignment,
boolean allowBreakHard)
Domain -- all combinations of room and time locations
|
List<Lecture> |
conflictLectures(Assignment<Lecture,Placement> assignment,
Student student)
Lectures different from this one, where it is student conflict of the
given student between this and the lecture
|
Set<Student> |
conflictStudents(Assignment<Lecture,Placement> assignment)
List of students of this class which are in conflict with any other
assignment
|
Set<Student> |
conflictStudents(Assignment<Lecture,Placement> assignment,
Placement value)
List of students of this class in conflict with the given assignment
|
int |
countCommittedStudentConflicts(Assignment<Lecture,Placement> assignment,
Placement value) |
int |
countCommittedStudentConflictsOfTheSameProblem(Assignment<Lecture,Placement> assignment,
Placement value) |
int |
countDistanceStudentConflicts(Assignment<Lecture,Placement> assignment,
Placement value) |
int |
countDistanceStudentConflictsOfTheSameProblem(Assignment<Lecture,Placement> assignment,
Placement value) |
int |
countHardStudentConflicts(Assignment<Lecture,Placement> assignment,
Placement value) |
int |
countHardStudentConflictsOfTheSameProblem(Assignment<Lecture,Placement> assignment,
Placement value) |
int |
countInitialStudentConflicts()
Number of student conflicts caused by the initial assignment of this
lecture
|
int |
countStudentConflicts(Assignment<Lecture,Placement> assignment,
Placement value)
Number of student conflicts caused by the given assignment of this
lecture
|
int |
countStudentConflictsOfTheSameProblem(Assignment<Lecture,Placement> assignment,
Placement value) |
Lecture.LectureContext |
createAssignmentContext(Assignment<Lecture,Placement> assignment)
Create a new assignment context for the given assignment.
|
boolean |
equals(Object o) |
int |
getBestRoomPreference()
Best room preference of this lecture
|
double |
getBestTimePreference() |
Lecture |
getChild(Student student,
Long subpartId) |
Map<Long,List<Lecture>> |
getChildren() |
List<Lecture> |
getChildren(Long subpartId) |
Set<Long> |
getChildrenSubpartIds() |
Long |
getClassId()
Class id
|
ClassLimitConstraint |
getClassLimitConstraint() |
int |
getCommitedConflicts(Placement placement) |
Configuration |
getConfiguration() |
Placement |
getConstantValue()
Return assignment if constant
|
Long |
getDepartment()
Controlling Course Offering Department
|
DepartmentSpreadConstraint |
getDeptSpreadConstraint()
Departmental spreading constraint
|
Set<FlexibleConstraint> |
getFlexibleGroupConstraints() |
long |
getId()
Class id
|
Map<Lecture,Long> |
getInitialStudentConflicts()
Table of student conflicts caused by the initial assignment of this
lecture in format (another lecture, number)
|
List<InstructorConstraint> |
getInstructorConstraints()
Instructor constraint
|
String |
getInstructorName() |
List<String> |
getInstructorNames()
Instructor name
|
int |
getMaxRoomCombinations() |
int[] |
getMinMaxRoomPreference() |
double[] |
getMinMaxTimePreference() |
int |
getMinWeeks() |
String |
getName()
Class name
|
String |
getNote() |
String |
getNotValidReason(Assignment<Lecture,Placement> assignment,
Placement placement)
Deprecated.
|
String |
getNotValidReason(Assignment<Lecture,Placement> assignment,
Placement placement,
boolean useAmPm) |
int |
getNrRooms() |
int |
getOrd() |
Lecture |
getParent() |
Long |
getScheduler()
Scheduler (Managing Department)
|
Long |
getSchedulingSubpartId()
Scheduling subpart id
|
Long |
getSolverGroupId() |
Set<SpreadConstraint> |
getSpreadConstraints() |
int |
getSpreadPenalty(Assignment<Lecture,Placement> assignment) |
Set<Constraint<Lecture,Placement>> |
getWeakeningConstraints() |
double |
getWeight()
Get class weight.
|
Set<GroupConstraint> |
groupConstraints() |
Set<GroupConstraint> |
hardGroupSoftConstraints() |
boolean |
hasAnyChildren() |
boolean |
hasChildren(Long subpartId) |
int |
hashCode() |
boolean |
hasParent() |
boolean |
hasStudent(Student student)
Returns true if the given student is enrolled
|
Set<Student> |
initialStudentConflicts()
List of student conflicts caused by the initial assignment of this
lecture
|
boolean |
isCommitted() |
boolean |
isConstant()
True, if the variable is constant.
|
int |
isInConflict(Assignment<Lecture,Placement> assignment,
Student student)
True if this lecture is in a student conflict with the given student
|
boolean |
isSingleSection() |
boolean |
isSingleton() |
boolean |
isSplitAttendance()
When using multiple rooms, split attendance means that the class is split among the given rooms.
|
boolean |
isToIgnoreStudentConflictsWith(Lecture other)
Returns true if there is
IgnoreStudentConflictsConstraint between the two lectures. |
boolean |
isValid(Placement placement) |
JenrlConstraint |
jenrlConstraint(Lecture another)
All JENRL constraints of this lecture
|
List<JenrlConstraint> |
jenrlConstraints()
All JENRL constraints of this lecture
|
int |
maxAchievableClassLimit() |
int |
maxClassLimit() |
int |
maxRoomSize() |
int |
maxRoomUse() |
int |
minClassLimit() |
int |
minRoomSize() |
int |
minRoomUse() |
int |
nrRoomLocations() |
int |
nrTimeLocations() |
long |
nrValues() |
int |
nrValues(List<RoomLocation> rooms) |
int |
nrValues(RoomLocation room) |
int |
nrValues(TimeLocation time) |
double |
nrWeightedStudents()
Total weight of all enrolled students
|
void |
purgeInvalidValues(boolean interactiveMode) |
void |
removeActiveJenrl(Assignment<Lecture,Placement> assignment,
JenrlConstraint constr)
Remove active jenrl constraint (active mean that there is at least one
student between its classes)
|
void |
removeContstraint(Constraint<Lecture,Placement> constraint)
Removes a constraint.
|
void |
removeStudent(Assignment<Lecture,Placement> assignment,
Student student)
Remove an enrolled student
|
List<RoomLocation> |
roomLocations()
All room locations
|
double |
roomToLimitRatio() |
Set<Student> |
sameStudents(Lecture lecture)
List of students enrolled in this class as well as in the given class
|
List<Lecture> |
sameStudentsLectures() |
List<Lecture> |
sameSubpartLectures()
Set of lectures of the same class (only section is different)
|
void |
setCommitted(boolean committed) |
void |
setConfiguration(Configuration configuration) |
void |
setConstantValue(Placement value) |
void |
setDepartment(Long dept)
Controlling Course Offering Department
|
void |
setMaxRoomCombinations(int maxRoomCombinations) |
void |
setNote(String note) |
void |
setOrd(int ord) |
void |
setParent(Lecture parent) |
void |
setSameSubpartLectures(List<Lecture> sameSubpartLectures)
Set of lectures of the same class (only section is different)
|
void |
setScheduler(Long scheduler)
Scheduler (Managing Department)
|
void |
setSplitAttendance(boolean splitAttendance)
When using multiple rooms, split attendance means that the class is split among the given rooms.
|
void |
setWeight(double weight)
Set class weight.
|
Set<Student> |
students()
List of enrolled students
|
List<TimeLocation> |
timeLocations()
All time locations
|
String |
toString() |
List<Placement> |
values(Assignment<Lecture,Placement> assignment)
All values
|
getAssignmentContextReference, getContext, getContext, setAssignmentContextReference, setModel
addVariableListener, assign, constraints, constraintVariables, getAssignment, getAssignment, getAssignments, getBestAssignment, getBestAssignmentIteration, getDescription, getExtra, getIndex, getInitialAssignment, getLastIteration, getModel, getVariableListeners, hardConstraints, hasAssignment, hasAssignment, hasInitialAssignment, hasValues, removeInitialValue, removeValue, removeVariableListener, setAssignment, setBestAssignment, setExtra, setIndex, setInitialAssignment, setLastIteration, setValues, softConstraints, unassign, values, variableAssigned, variableUnassigned
public boolean iCommitted
public static boolean sSaveMemory
public Lecture(Long id, Long solverGroupId, Long schedulingSubpartId, String name, Collection<TimeLocation> timeLocations, Collection<RoomLocation> roomLocations, int nrRooms, Placement initialPlacement, int minClassLimit, int maxClassLimit, double room2limitRatio)
id
- class unique idsolverGroupId
- solver group unique idschedulingSubpartId
- scheduling subpart unique idname
- class nametimeLocations
- set of time locationsroomLocations
- set of room locationnrRooms
- number of rooms into which the class is to be assignedinitialPlacement
- initial placementminClassLimit
- minimum class limitmaxClassLimit
- maximum class limitroom2limitRatio
- room ratiopublic Long getSolverGroupId()
public void addActiveJenrl(Assignment<Lecture,Placement> assignment, JenrlConstraint constr)
assignment
- current assignmentconstr
- an active jenrl constraintpublic Set<JenrlConstraint> activeJenrls(Assignment<Lecture,Placement> assignment)
assignment
- current assignmentpublic void removeActiveJenrl(Assignment<Lecture,Placement> assignment, JenrlConstraint constr)
assignment
- current assignmentconstr
- an active jenrl constraintpublic Long getClassId()
public Long getSchedulingSubpartId()
public long getId()
public List<String> getInstructorNames()
public String getInstructorName()
public Set<Student> students()
public double nrWeightedStudents()
Student.getOfferingWeight(Configuration)
of each enrolled studentpublic void addStudent(Assignment<Lecture,Placement> assignment, Student student)
assignment
- current assignmentstudent
- a student to addpublic void removeStudent(Assignment<Lecture,Placement> assignment, Student student)
assignment
- current assignmentstudent
- a student to removepublic boolean hasStudent(Student student)
student
- a studentpublic void setSameSubpartLectures(List<Lecture> sameSubpartLectures)
sameSubpartLectures
- list of lectures of the same scheduling subpartpublic List<Lecture> sameSubpartLectures()
public Set<Student> sameStudents(Lecture lecture)
lecture
- a lecturepublic Set<Student> conflictStudents(Assignment<Lecture,Placement> assignment, Placement value)
assignment
- current assignmentvalue
- given placementpublic Set<Student> conflictStudents(Assignment<Lecture,Placement> assignment)
assignment
- current assignmentpublic List<Lecture> conflictLectures(Assignment<Lecture,Placement> assignment, Student student)
assignment
- current assignmentstudent
- a studentpublic int isInConflict(Assignment<Lecture,Placement> assignment, Student student)
assignment
- current assignmentstudent
- a studentpublic List<Placement> computeValues(Assignment<Lecture,Placement> assignment, boolean allowBreakHard)
assignment
- current assignmentallowBreakHard
- breaking of hard constraints is allowedpublic void clearValueCache()
public double getBestTimePreference()
public int getBestRoomPreference()
public int countStudentConflicts(Assignment<Lecture,Placement> assignment, Placement value)
assignment
- current assignmentvalue
- a placementpublic int countStudentConflictsOfTheSameProblem(Assignment<Lecture,Placement> assignment, Placement value)
public int countHardStudentConflicts(Assignment<Lecture,Placement> assignment, Placement value)
public int countCommittedStudentConflictsOfTheSameProblem(Assignment<Lecture,Placement> assignment, Placement value)
public int countCommittedStudentConflicts(Assignment<Lecture,Placement> assignment, Placement value)
public int countHardStudentConflictsOfTheSameProblem(Assignment<Lecture,Placement> assignment, Placement value)
public int countDistanceStudentConflicts(Assignment<Lecture,Placement> assignment, Placement value)
public int countDistanceStudentConflictsOfTheSameProblem(Assignment<Lecture,Placement> assignment, Placement value)
public int countInitialStudentConflicts()
public Map<Lecture,Long> getInitialStudentConflicts()
public Set<Student> initialStudentConflicts()
public void addContstraint(Constraint<Lecture,Placement> constraint)
Variable
Model.addConstraint(Constraint)
is called.addContstraint
in class Variable<Lecture,Placement>
constraint
- added constraintpublic void removeContstraint(Constraint<Lecture,Placement> constraint)
Variable
Model.removeConstraint(Constraint)
is
called.removeContstraint
in class Variable<Lecture,Placement>
constraint
- added constraintpublic JenrlConstraint jenrlConstraint(Lecture another)
another
- another classpublic List<JenrlConstraint> jenrlConstraints()
public int minClassLimit()
public int maxClassLimit()
public int maxAchievableClassLimit()
public int classLimit(Assignment<Lecture,Placement> assignment)
public int classLimit(Assignment<Lecture,Placement> assignment, Placement value, Set<Placement> conflicts)
public double roomToLimitRatio()
public int minRoomUse()
public int maxRoomUse()
public Long getDepartment()
public void setDepartment(Long dept)
dept
- department unique idpublic Long getScheduler()
public void setScheduler(Long scheduler)
scheduler
- solver group unique idpublic DepartmentSpreadConstraint getDeptSpreadConstraint()
public List<InstructorConstraint> getInstructorConstraints()
public ClassLimitConstraint getClassLimitConstraint()
public Set<SpreadConstraint> getSpreadConstraints()
public Set<FlexibleConstraint> getFlexibleGroupConstraints()
public Set<Constraint<Lecture,Placement>> getWeakeningConstraints()
public List<RoomLocation> roomLocations()
public List<TimeLocation> timeLocations()
public int nrTimeLocations()
public int nrRoomLocations()
public long nrValues()
public int nrValues(TimeLocation time)
public int nrValues(RoomLocation room)
public int nrValues(List<RoomLocation> rooms)
public boolean allowBreakHard()
public int getNrRooms()
public boolean hasParent()
public boolean hasChildren(Long subpartId)
public boolean hasAnyChildren()
public List<Lecture> getChildren(Long subpartId)
public Set<Long> getChildrenSubpartIds()
public Map<Long,List<Lecture>> getChildren()
public boolean isSingleSection()
public List<Lecture> sameStudentsLectures()
public int getCommitedConflicts(Placement placement)
public Set<GroupConstraint> hardGroupSoftConstraints()
public Set<GroupConstraint> groupConstraints()
public int minRoomSize()
public int maxRoomSize()
public boolean canShareRoom()
public boolean canShareRoom(Lecture other)
public Set<GroupConstraint> canShareRoomConstraints()
public boolean isSingleton()
public String getNotValidReason(Assignment<Lecture,Placement> assignment, Placement placement, boolean useAmPm)
@Deprecated public String getNotValidReason(Assignment<Lecture,Placement> assignment, Placement placement)
public void purgeInvalidValues(boolean interactiveMode)
public void setCommitted(boolean committed)
public boolean isCommitted()
public boolean isConstant()
ConstantVariable
isConstant
in interface ConstantVariable<Placement>
public Placement getConstantValue()
ConstantVariable
getConstantValue
in interface ConstantVariable<Placement>
ConstantVariable.isConstant()
is true)public void setConstantValue(Placement value)
public int getSpreadPenalty(Assignment<Lecture,Placement> assignment)
public Configuration getConfiguration()
public void setConfiguration(Configuration configuration)
public int[] getMinMaxRoomPreference()
public double[] getMinMaxTimePreference()
public void setOrd(int ord)
public int getOrd()
public boolean areStudentConflictsHard(Lecture other)
public void clearIgnoreStudentConflictsWithCache()
public boolean isToIgnoreStudentConflictsWith(Lecture other)
IgnoreStudentConflictsConstraint
between the two lectures.other
- another classpublic double getWeight()
public void setWeight(double weight)
weight
- class weightpublic Lecture.LectureContext createAssignmentContext(Assignment<Lecture,Placement> assignment)
HasAssignmentContext
createAssignmentContext
in interface HasAssignmentContext<Lecture,Placement,Lecture.LectureContext>
assignment
- an assignment for which there needs to be an assignment contextpublic int getMaxRoomCombinations()
public void setMaxRoomCombinations(int maxRoomCombinations)
public int getMinWeeks()
public boolean isSplitAttendance()
public void setSplitAttendance(boolean splitAttendance)
splitAttendance
- true means class is split among rooms, false means each room must be big enough for the class