public class ExamSplitter extends ExamCriterion
AbstractCriterion.getWeight()
.
AbstractCriterion.ValueUpdateType
iBest, iDebug, iValue, iValueUpdateType, iWeight, sDoubleFormat, sPercentFormat
Constructor and Description |
---|
ExamSplitter()
Examination splitter criterion.
|
Modifier and Type | Method and Description |
---|---|
void |
bestRestored()
Best solution was restored, change the splits back to what it was in the best solution
|
void |
bestSaved()
Best solution was saved, remember the current splits
|
boolean |
canMerge(Exam exam)
True, if the given exam can be merged (it has been split)
|
boolean |
canSplit(Exam exam)
True, if an exam can be split
|
List<Exam> |
children(Exam parent)
Children exams of an exam that has been split.
|
double |
delta(ExamStudent student,
ExamPlacement oldPlacement,
ExamPlacement newPlacement)
Difference in the total weighted student conflicts (including
StudentDirectConflicts ,
StudentMoreThan2ADayConflicts , and StudentBackToBackConflicts ) if a student
is moved from an exam with one placement into an exam with another placement. |
double[] |
getBounds(Collection<Exam> exams)
Not used
|
void |
getInfo(Map<String,String> info)
Lists the split
|
double |
getValue(ExamPlacement value,
Set<ExamPlacement> conflicts)
Not used
|
double |
getWeightDefault(DataProperties config)
Returns half of a student direct conflict weight
|
String |
getWeightName()
Returns Exams.ExamSplitWeight
|
String |
getXmlWeightName()
Returns examSplitWeight
|
boolean |
init(Solver<Exam,ExamPlacement> solver)
Initialization
|
Exam |
merge(Exam child,
long iteration)
Merge an exam
|
Exam |
parent(Exam exam)
Parent of an exam that has been split.
|
void |
shuffle(Exam exam,
long iteration)
Shuffle students between the given exam and all the other exams in the split (if there are any).
|
Exam |
split(Exam parent,
long iteration,
ExamPlacement placement)
Split an exam
|
String |
toString() |
getPeriodValue, getRoomValue, getXmlParameters, isPeriodCriterion, isRoomCriterion, setWeight, setXmlParameters
afterAssigned, afterUnassigned, beforeAssigned, beforeUnassigned, clearCache, computeBounds, constraintAdded, constraintRemoved, getBest, getBounds, getInfo, getModel, getName, getPerc, getPercRev, getValue, getValue, getWeight, getWeightedBest, getWeightedValue, getWeightedValue, getWeightedValue, inc, variableAdded, variableRemoved
public ExamSplitter()
public boolean init(Solver<Exam,ExamPlacement> solver)
init
in interface ModelListener<Exam,ExamPlacement>
init
in class AbstractCriterion<Exam,ExamPlacement>
solver
- IFS solverpublic String getWeightName()
getWeightName
in class ExamCriterion
public String getXmlWeightName()
getXmlWeightName
in class ExamCriterion
public double getWeightDefault(DataProperties config)
getWeightDefault
in class AbstractCriterion<Exam,ExamPlacement>
public Exam parent(Exam exam)
exam
- an exam in questionpublic List<Exam> children(Exam parent)
parent
- an exam in questionpublic Exam split(Exam parent, long iteration, ExamPlacement placement)
parent
- an exam to be splititeration
- solver iterationplacement
- placement of the new exampublic boolean canMerge(Exam exam)
public Exam merge(Exam child, long iteration)
child
- an exam to be mergediteration
- solver iterationpublic double delta(ExamStudent student, ExamPlacement oldPlacement, ExamPlacement newPlacement)
StudentDirectConflicts
,
StudentMoreThan2ADayConflicts
, and StudentBackToBackConflicts
) if a student
is moved from an exam with one placement into an exam with another placement.student
- a student in questionoldPlacement
- placement of the exam in which the student is nownewPlacement
- placement of the exam into which the student would be movedpublic void shuffle(Exam exam, long iteration)
delta(ExamStudent, ExamPlacement, ExamPlacement)
are
considered.exam
- an exam in questioniteration
- solver iterationpublic double getValue(ExamPlacement value, Set<ExamPlacement> conflicts)
public double[] getBounds(Collection<Exam> exams)
getBounds
in interface Criterion<Exam,ExamPlacement>
getBounds
in class ExamCriterion
public void getInfo(Map<String,String> info)
getInfo
in interface InfoProvider<Exam>
getInfo
in class ExamCriterion
public void bestSaved()
bestSaved
in interface Criterion<Exam,ExamPlacement>
bestSaved
in class AbstractCriterion<Exam,ExamPlacement>
public void bestRestored()
bestRestored
in interface Criterion<Exam,ExamPlacement>
bestRestored
in class AbstractCriterion<Exam,ExamPlacement>