public class DistributionPenalty extends ExamCriterion
ExamDistributionConstraint) can be set by problem property
Exams.RoomDistributionWeight, or in the input xml file, property
roomDistributionWeight.
AbstractCriterion.ValueContext, AbstractCriterion.ValueUpdateType| Modifier and Type | Field and Description |
|---|---|
protected Integer |
iSoftDistributions |
iBest, iDebug, iWeight, sDoubleFormat, sPercentFormatsMaxSize| Constructor and Description |
|---|
DistributionPenalty() |
| Modifier and Type | Method and Description |
|---|---|
protected double[] |
computeBounds(Assignment<Exam,ExamPlacement> assignment)
Compute bounds (bounds are being cached by default).
|
double |
getPeriodValue(Assignment<Exam,ExamPlacement> assignment,
ExamPlacement value)
Period related distribution penalty, i.e., sum weights of violated
distribution constraints
|
double |
getRoomValue(Assignment<Exam,ExamPlacement> assignment,
ExamPlacement value)
Room related distribution penalty, i.e., sum weights of violated
distribution constraints
|
double |
getValue(Assignment<Exam,ExamPlacement> assignment,
Collection<Exam> variables)
Value of a part of the problem (given by the collection of variables)
|
double |
getValue(Assignment<Exam,ExamPlacement> assignment,
ExamPlacement value,
Set<ExamPlacement> conflicts)
Value of a proposed assignment (including hard conflicts)
|
double |
getWeightDefault(DataProperties config)
Defines default weight (when
AbstractCriterion.getWeightName() parameter is not present in the criterion). |
String |
getWeightName()
Defines weight name (to be used to get the criterion weight from the configuration).
|
String |
getXmlWeightName()
Name of the weight parameter in the parameters section of the examination XML file.
|
void |
inc(Assignment<Exam,ExamPlacement> assignment,
double value,
ExamDistributionConstraint dc) |
boolean |
isPeriodCriterion()
True if this criterion is based on period assignment.
|
boolean |
isRoomCriterion()
True if this criterion is based on room assignment.
|
void |
setModel(Model<Exam,ExamPlacement> model)
called when the criterion is added to a model
|
String |
toString(Assignment<Exam,ExamPlacement> assignment)
Simple text representation of the criterion and its value.
|
getBounds, getInfo, getXmlParameters, setWeight, setXmlParametersafterAssigned, afterUnassigned, beforeAssigned, beforeUnassigned, bestRestored, bestSaved, clearCache, configure, constraintAdded, constraintRemoved, createAssignmentContext, getAbbreviation, getAssignmentContextReference, getBest, getBounds, getBounds, getBounds, getContext, getContext, getExtendedInfo, getInfo, getModel, getName, getPerc, getPercentage, getPercRev, getValue, getValue, getValue, getValueUpdateType, getWeight, getWeightedBest, getWeightedValue, getWeightedValue, getWeightedValue, getWeightedValue, getWeightedValue, getWeightedValue, inc, inc, init, setAssignmentContextReference, setValueUpdateType, variableAdded, variableRemovedprotected Integer iSoftDistributions
public DistributionPenalty()
public void setModel(Model<Exam,ExamPlacement> model)
CriterionsetModel in interface Criterion<Exam,ExamPlacement>setModel in class AbstractCriterion<Exam,ExamPlacement>model - problem modelpublic String getWeightName()
AbstractCriteriongetWeightName in class ExamCriterionpublic String getXmlWeightName()
ExamCriteriongetXmlWeightName in class ExamCriterionpublic double getWeightDefault(DataProperties config)
AbstractCriterionAbstractCriterion.getWeightName() parameter is not present in the criterion).getWeightDefault in class AbstractCriterion<Exam,ExamPlacement>config - solver configurationpublic double getValue(Assignment<Exam,ExamPlacement> assignment, ExamPlacement value, Set<ExamPlacement> conflicts)
Criterionassignment - current assignmentvalue - given valueconflicts - values conflicting with the given valuepublic boolean isRoomCriterion()
ExamCriterionExamPlacement.getRoomCost(Assignment).isRoomCriterion in class ExamCriterionpublic double getRoomValue(Assignment<Exam,ExamPlacement> assignment, ExamPlacement value)
getRoomValue in class ExamCriterionassignment - current assignmentvalue - new assignment in questionpublic double getValue(Assignment<Exam,ExamPlacement> assignment, Collection<Exam> variables)
CriteriongetValue in interface Criterion<Exam,ExamPlacement>getValue in class AbstractCriterion<Exam,ExamPlacement>assignment - current assignmentvariables - list of problem variablespublic boolean isPeriodCriterion()
ExamCriterionExamPlacement.getTimeCost(Assignment).isPeriodCriterion in class ExamCriterionpublic void inc(Assignment<Exam,ExamPlacement> assignment, double value, ExamDistributionConstraint dc)
public double getPeriodValue(Assignment<Exam,ExamPlacement> assignment, ExamPlacement value)
getPeriodValue in class ExamCriterionassignment - current assignmentvalue - new assignment in questionprotected double[] computeBounds(Assignment<Exam,ExamPlacement> assignment)
AbstractCriterioncomputeBounds in class AbstractCriterion<Exam,ExamPlacement>assignment - current assignmentpublic String toString(Assignment<Exam,ExamPlacement> assignment)
AbstractCriterionAbstractCriterion.getAbbreviation()
and x is the current value AbstractCriterion.getValue(Assignment).toString in interface Criterion<Exam,ExamPlacement>toString in class AbstractCriterion<Exam,ExamPlacement>assignment - current assignment