public class TimeOverlapsCounter.TimeOverlapsCounterContext extends Object implements AssignmentConstraintContext<Request,Enrollment>
Constructor and Description |
---|
TimeOverlapsCounterContext(Assignment<Request,Enrollment> assignment) |
TimeOverlapsCounterContext(TimeOverlapsCounter.TimeOverlapsCounterContext parent) |
Modifier and Type | Method and Description |
---|---|
void |
afterAssigned(Assignment<Request,Enrollment> assignment,
long iteration,
Enrollment value)
Called after a value is assigned to a variable.
|
void |
afterUnassigned(Assignment<Request,Enrollment> assignment,
long iteration,
Enrollment value)
Called after a value is unassigned from a variable.
|
Set<TimeOverlapsCounter.Conflict> |
allConflicts(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
The set of all conflicts (
TimeOverlapsCounter.Conflict objects) of the given
enrollment and other enrollments that are assigned to the same student. |
void |
assigned(Assignment<Request,Enrollment> assignment,
Enrollment value)
Called when a value is assigned to a variable.
|
void |
beforeAssigned(Assignment<Request,Enrollment> assignment,
long iteration,
Enrollment value)
Called before a value is assigned to a variable.
|
Set<TimeOverlapsCounter.Conflict> |
computeAllConflicts(Assignment<Request,Enrollment> assignment)
Compute a set of all time overlapping conflicts (
TimeOverlapsCounter.Conflict objects). |
int |
countTotalNrConflicts(Assignment<Request,Enrollment> assignment)
Compute the actual number of all time overlapping conflicts.
|
Set<TimeOverlapsCounter.Conflict> |
getAllConflicts()
Return a set of all time overlapping conflicts (
TimeOverlapsCounter.Conflict objects). |
int |
getTotalNrConflicts()
Actual number of all time overlapping conflicts
|
void |
checkTotalNrConflicts(Assignment<Request,Enrollment> assignment) |
int |
nrAllConflicts(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
Total sum of all conflict of the given enrollment and other enrollments
that are assigned to the same student.
|
void |
unassigned(Assignment<Request,Enrollment> assignment,
Enrollment value)
Called when a value is unassigned from a variable.
|
public TimeOverlapsCounterContext(Assignment<Request,Enrollment> assignment)
public TimeOverlapsCounterContext(TimeOverlapsCounter.TimeOverlapsCounterContext parent)
public void assigned(Assignment<Request,Enrollment> assignment, Enrollment value)
TimeOverlapsCounter.getTotalNrConflicts(Assignment)
.assigned
in interface AssignmentConstraintContext<Request,Enrollment>
assignment
- current assignment (with which this context is associated)value
- assigned valuepublic void unassigned(Assignment<Request,Enrollment> assignment, Enrollment value)
TimeOverlapsCounter.getTotalNrConflicts(Assignment)
.unassigned
in interface AssignmentConstraintContext<Request,Enrollment>
assignment
- current assignment (with which this context is associated)value
- unassigned valuepublic void beforeAssigned(Assignment<Request,Enrollment> assignment, long iteration, Enrollment value)
assignment
- current assignmentiteration
- current iterationvalue
- value to be assignedpublic void afterAssigned(Assignment<Request,Enrollment> assignment, long iteration, Enrollment value)
assignment
- current assignmentiteration
- current iterationvalue
- value that was assignedpublic void afterUnassigned(Assignment<Request,Enrollment> assignment, long iteration, Enrollment value)
assignment
- current assignmentiteration
- current iterationvalue
- value that was unassignedpublic Set<TimeOverlapsCounter.Conflict> getAllConflicts()
TimeOverlapsCounter.Conflict
objects).public int getTotalNrConflicts()
public void checkTotalNrConflicts(Assignment<Request,Enrollment> assignment)
public int countTotalNrConflicts(Assignment<Request,Enrollment> assignment)
TimeOverlapsCounter.getTotalNrConflicts(Assignment)
.assignment
- current assignmentpublic Set<TimeOverlapsCounter.Conflict> computeAllConflicts(Assignment<Request,Enrollment> assignment)
TimeOverlapsCounter.Conflict
objects).assignment
- current assignmentpublic Set<TimeOverlapsCounter.Conflict> allConflicts(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
TimeOverlapsCounter.Conflict
objects) of the given
enrollment and other enrollments that are assigned to the same student.assignment
- current assignmentenrollment
- given enrollmentpublic int nrAllConflicts(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
assignment
- current assignmentenrollment
- given enrollment