net.sf.cpsolver.exam.criteria
Class ExamCriterion

java.lang.Object
  extended by net.sf.cpsolver.ifs.criteria.AbstractCriterion<Exam,ExamPlacement>
      extended by net.sf.cpsolver.exam.criteria.ExamCriterion
All Implemented Interfaces:
Criterion<Exam,ExamPlacement>, InfoProvider<Exam>, ModelListener<Exam,ExamPlacement>
Direct Known Subclasses:
DistanceToStronglyPreferredRoom, DistributionPenalty, DistributionViolation, ExamRotationPenalty, ExamSplitter, LargeExamsPenalty, PeriodIndexPenalty, PeriodPenalty, PeriodSizePenalty, PeriodViolation, PerturbationPenalty, RoomPenalty, RoomSizePenalty, RoomSplitDistancePenalty, RoomSplitPenalty, RoomViolation, StudentBackToBackConflicts, StudentDirectConflicts, StudentDistanceBackToBackConflicts, StudentMoreThan2ADayConflicts

public abstract class ExamCriterion
extends AbstractCriterion<Exam,ExamPlacement>

Abstract examination criterion. All examination criteria are inherited from this criterion.

Version:
ExamTT 1.2 (Examination Timetabling)
Copyright (C) 2008 - 2012 Tomas Muller
muller@unitime.org
http://muller.unitime.org

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.

Nested Class Summary
 
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
ExamCriterion()
           
 
Method Summary
 double[] getBounds(Collection<Exam> exams)
          Value bounds (minimum and maximum) of the criterion on a part of the problem
 void getInfo(Map<String,String> info)
          Adds some information into the table with information about the solution
 double getPeriodValue(ExamPlacement value)
          Return impact of this criterion on period assignment (if this criterion is based on period assignment).
 double getRoomValue(ExamPlacement value)
          Return impact of this criterion on room assignment (if this criterion is based on room assignment).
 String getWeightName()
          Defines weight name (to be used to get the criterion weight from the configuration).
 void getXmlParameters(Map<String,String> params)
          Put all the parameters of this criterion into a map that is used to write parameters section of the examination XML file.
 String getXmlWeightName()
          Name of the weight parameter in the parameters section of the examination XML file.
 boolean isPeriodCriterion()
          True if this criterion is based on period assignment.
 boolean isRoomCriterion()
          True if this criterion is based on room assignment.
 void setWeight(double weight)
           
 void setXmlParameters(Map<String,String> params)
          Set all the parameters of this criterion from a map that is read from the parameters section the examination XML file.
 
Methods inherited from class net.sf.cpsolver.ifs.criteria.AbstractCriterion
afterAssigned, afterUnassigned, beforeAssigned, beforeUnassigned, bestRestored, bestSaved, clearCache, computeBounds, constraintAdded, constraintRemoved, getBest, getBounds, getInfo, getModel, getName, getPerc, getPercRev, getValue, getValue, getWeight, getWeightDefault, getWeightedBest, getWeightedValue, getWeightedValue, getWeightedValue, inc, init, variableAdded, variableRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.cpsolver.ifs.criteria.Criterion
getValue
 

Constructor Detail

ExamCriterion

public ExamCriterion()
Method Detail

setWeight

public void setWeight(double weight)

getWeightName

public String getWeightName()
Description copied from class: AbstractCriterion
Defines weight name (to be used to get the criterion weight from the configuration).

Overrides:
getWeightName in class AbstractCriterion<Exam,ExamPlacement>

getBounds

public double[] getBounds(Collection<Exam> exams)
Description copied from interface: Criterion
Value bounds (minimum and maximum) of the criterion on a part of the problem

Specified by:
getBounds in interface Criterion<Exam,ExamPlacement>
Overrides:
getBounds in class AbstractCriterion<Exam,ExamPlacement>

getInfo

public void getInfo(Map<String,String> info)
Description copied from interface: InfoProvider
Adds some information into the table with information about the solution

Specified by:
getInfo in interface InfoProvider<Exam>
Overrides:
getInfo in class AbstractCriterion<Exam,ExamPlacement>

isPeriodCriterion

public boolean isPeriodCriterion()
True if this criterion is based on period assignment. Used by ExamPlacement.getTimeCost().


getPeriodValue

public double getPeriodValue(ExamPlacement value)
Return impact of this criterion on period assignment (if this criterion is based on period assignment). Used by ExamPlacement.getTimeCost().


isRoomCriterion

public boolean isRoomCriterion()
True if this criterion is based on room assignment. Used by ExamPlacement.getRoomCost().


getRoomValue

public double getRoomValue(ExamPlacement value)
Return impact of this criterion on room assignment (if this criterion is based on room assignment). Used by ExamPlacement.getRoomCost().


getXmlWeightName

public String getXmlWeightName()
Name of the weight parameter in the parameters section of the examination XML file.


getXmlParameters

public void getXmlParameters(Map<String,String> params)
Put all the parameters of this criterion into a map that is used to write parameters section of the examination XML file.


setXmlParameters

public void setXmlParameters(Map<String,String> params)
Set all the parameters of this criterion from a map that is read from the parameters section the examination XML file.



Copyright © 2014 UniTime LLC. All Rights Reserved.