|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.cpsolver.ifs.criteria.AbstractCriterion<Lecture,Placement>
net.sf.cpsolver.coursett.criteria.additional.InstructorLunchBreak
public class InstructorLunchBreak
The class represents various criteria concerning compact timetables of
instructors. The criteria are checked and updated when a variable is
(un)assigned.
implemented criterion: lunch break
Nested Class Summary | |
---|---|
static class |
InstructorLunchBreak.CompactInfo
The class is used as a container of information concerning lunch break of instructors. |
Nested classes/interfaces inherited from class net.sf.cpsolver.ifs.criteria.AbstractCriterion |
---|
AbstractCriterion.ValueUpdateType |
Field Summary |
---|
Fields inherited from class net.sf.cpsolver.ifs.criteria.AbstractCriterion |
---|
iBest, iDebug, iValue, iValueUpdateType, iWeight, sDoubleFormat, sPercentFormat |
Constructor Summary | |
---|---|
InstructorLunchBreak()
|
Method Summary | |
---|---|
void |
afterAssigned(long iteration,
Placement value)
Update criterion after an assignment. |
void |
afterUnassigned(long iteration,
Placement value)
Update criterion after an unassignment |
protected InstructorLunchBreak.CompactInfo |
getCompactInfo(InstructorConstraint constraint)
Get compact info that is associated with an instructor constraint. |
void |
getInfo(Map<String,String> info)
Adds some information into the table with information about the solution |
void |
getInfo(Map<String,String> info,
Collection<Lecture> variables)
Adds some information into the table with information about the solution, only consider variables from the given set |
double |
getValue(Collection<Lecture> variables)
Value of a part of the problem (given by the collection of variables) |
double |
getValue(Placement value,
Set<Placement> conflicts)
Value of a proposed assignment (including hard conflicts) |
protected List<BitSet> |
getWeeks()
The method creates date patterns (bitsets) which represent the weeks of a semester. |
double |
getWeightedValue(Placement value,
Set<Placement> conflicts)
Weighted value of a proposed assignment (including hard conflicts) |
boolean |
init(Solver<Lecture,Placement> solver)
Notification that the model was initialized by the solver. |
void |
updateCriterion(InstructorConstraint instructorConstraint,
Placement placement)
Method checks or sets the CompactInfo of an InstructorConstraint. |
void |
updateLunchPenalty(InstructorConstraint constraint,
Placement p)
Method updates number of violations in days (Mo, Tue, Wed,..) considering each week in the semester separately. |
Methods inherited from class net.sf.cpsolver.ifs.criteria.AbstractCriterion |
---|
beforeAssigned, beforeUnassigned, bestRestored, bestSaved, clearCache, computeBounds, constraintAdded, constraintRemoved, getBest, getBounds, getBounds, getModel, getName, getPerc, getPercRev, getValue, getWeight, getWeightDefault, getWeightedBest, getWeightedValue, getWeightedValue, getWeightName, inc, variableAdded, variableRemoved |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InstructorLunchBreak()
Method Detail |
---|
public boolean init(Solver<Lecture,Placement> solver)
ModelListener
init
in interface ModelListener<Lecture,Placement>
init
in class AbstractCriterion<Lecture,Placement>
solver
- IFS solverprotected InstructorLunchBreak.CompactInfo getCompactInfo(InstructorConstraint constraint)
public void afterAssigned(long iteration, Placement value)
afterAssigned
in interface ModelListener<Lecture,Placement>
afterAssigned
in class AbstractCriterion<Lecture,Placement>
iteration
- current iterationvalue
- value to be assignedpublic void afterUnassigned(long iteration, Placement value)
afterUnassigned
in interface ModelListener<Lecture,Placement>
afterUnassigned
in class AbstractCriterion<Lecture,Placement>
iteration
- current iterationvalue
- value to be unassignedprotected List<BitSet> getWeeks()
public void updateLunchPenalty(InstructorConstraint constraint, Placement p)
constraint
- the Instructor constraint of an instructor checked for a lunch
breakp
- placement of a lecture currently (un)assignedpublic void updateCriterion(InstructorConstraint instructorConstraint, Placement placement)
instructorConstraint
- the Instructor constraint of an instructor checked for
criteriaplacement
- placement of a lecture currently (un)assignedpublic double getValue(Placement value, Set<Placement> conflicts)
Criterion
public double getWeightedValue(Placement value, Set<Placement> conflicts)
Criterion
getWeightedValue
in interface Criterion<Lecture,Placement>
getWeightedValue
in class AbstractCriterion<Lecture,Placement>
public double getValue(Collection<Lecture> variables)
Criterion
getValue
in interface Criterion<Lecture,Placement>
getValue
in class AbstractCriterion<Lecture,Placement>
public void getInfo(Map<String,String> info)
InfoProvider
getInfo
in interface InfoProvider<Lecture>
getInfo
in class AbstractCriterion<Lecture,Placement>
public void getInfo(Map<String,String> info, Collection<Lecture> variables)
InfoProvider
getInfo
in interface InfoProvider<Lecture>
getInfo
in class AbstractCriterion<Lecture,Placement>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |