public class SpreadConstraint.SpreadConstraintContext extends Object implements AssignmentConstraintContext<Lecture,Placement>
Constructor and Description |
---|
SpreadConstraintContext(Assignment<Lecture,Placement> assignment) |
Modifier and Type | Method and Description |
---|---|
void |
assigned(Assignment<Lecture,Placement> assignment,
Placement placement)
Called when
ConstraintWithContext.assigned(Assignment, long, Value) is called to update
the content of the context. |
Set<Placement> |
getCourses(int time,
int day) |
int |
getCurrentPenalty() |
int |
getMaxAllowedPenalty() |
int[][] |
getMaxCourses() |
int |
getMaxCourses(int time,
int day) |
int |
getNrCourses(int time,
int day,
Placement placement) |
int |
getUnassignmentsToWeaken() |
void |
unassigned(Assignment<Lecture,Placement> assignment,
Placement placement)
Called when
ConstraintWithContext.unassigned(Assignment, long, Value) is called to update
the content of the context. |
void |
weaken() |
void |
weaken(int penalty) |
public SpreadConstraintContext(Assignment<Lecture,Placement> assignment)
public void assigned(Assignment<Lecture,Placement> assignment, Placement placement)
AssignmentConstraintContext
ConstraintWithContext.assigned(Assignment, long, Value)
is called to update
the content of the context.assigned
in interface AssignmentConstraintContext<Lecture,Placement>
assignment
- current assignment (with which this context is associated)placement
- assigned valuepublic void unassigned(Assignment<Lecture,Placement> assignment, Placement placement)
AssignmentConstraintContext
ConstraintWithContext.unassigned(Assignment, long, Value)
is called to update
the content of the context.unassigned
in interface AssignmentConstraintContext<Lecture,Placement>
assignment
- current assignment (with which this context is associated)placement
- unassigned valuepublic int[][] getMaxCourses()
public int getMaxCourses(int time, int day)
public int getNrCourses(int time, int day, Placement placement)
public Set<Placement> getCourses(int time, int day)
public int getUnassignmentsToWeaken()
public int getCurrentPenalty()
public int getMaxAllowedPenalty()
public void weaken()
public void weaken(int penalty)