|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.cpsolver.ifs.model.Value<Exam,ExamPlacement>
net.sf.cpsolver.exam.model.ExamPlacement
public class ExamPlacement
Representation of an exam placement (problem value), i.e., assignment of an
exam to period and room(s). Each placement has defined a period and a set of
rooms. The exam as well as the rooms have to be available during the given
period (see Exam.getPeriodPlacements()
and
Exam.getRoomPlacements()
). The total size of rooms have to be equal
or greater than the number of students enrolled in the exam
Exam.getSize()
, using either ExamRoom.getSize()
or
ExamRoom.getAltSize()
, depending on Exam.hasAltSeating()
.
Also, the number of rooms has to be smaller or equal to
Exam.getMaxRooms()
. If Exam.getMaxRooms()
is zero, the exam
is only to be assigned to period (the set of rooms is empty).
The cost of an assignment consists of the following criteria:
getNrDirectConflicts()
,
weighted by ExamModel.getDirectConflictWeight()
getNrMoreThanTwoADayConflicts()
, weighted by
ExamModel.getMoreThanTwoADayWeight()
getNrBackToBackConflicts()
, weighted by
ExamModel.getBackToBackConflictWeight()
getNrDistanceBackToBackConflicts()
, weighted by
ExamModel.getDistanceBackToBackConflictWeight()
getPeriodPenalty()
, weighted by
ExamModel.getPeriodWeight()
getRoomSizePenalty()
, weighted by
ExamModel.getRoomSizeWeight()
getRoomSplitPenalty()
, weighted
by ExamModel.getRoomSplitWeight()
getRoomPenalty()
, weighted by
ExamModel.getRoomWeight()
getRotationPenalty()
,
weighted by ExamModel.getExamRotationWeight()
getNrInstructorDirectConflicts()
, weighted by
ExamModel.getInstructorDirectConflictWeight()
getNrInstructorMoreThanTwoADayConflicts()
, weighted by
ExamModel.getInstructorMoreThanTwoADayWeight()
getNrInstructorBackToBackConflicts()
, weighted by
ExamModel.getInstructorBackToBackConflictWeight()
getNrInstructorDistanceBackToBackConflicts()
, weighted
by ExamModel.getInstructorDistanceBackToBackConflictWeight()
Field Summary |
---|
Fields inherited from class net.sf.cpsolver.ifs.model.Value |
---|
iValue |
Constructor Summary | |
---|---|
ExamPlacement(Exam exam,
ExamPeriodPlacement periodPlacement,
Set<ExamRoomPlacement> roomPlacements)
Constructor |
Method Summary | |
---|---|
boolean |
contains(ExamRoom room)
True if given room is between getRoomPlacements() |
boolean |
equals(Object o)
Compare two assignments for equality |
double |
getDistanceInMeters(ExamPlacement other)
Distance between two placements, i.e., maximal distance between a room of this placement and a room of the given placement. |
double |
getDistributionPenalty()
Distribution penalty, i.e., sum weights of violated distribution constraints |
int |
getLargePenalty()
Front load penalty (large exam is discouraged to be placed on or after a certain period) |
String |
getName()
Assignment name (period / room(s)) |
int |
getNrBackToBackConflicts()
Number of back-to-back student conflicts, i.e., number of cases when this exam is attended by a student that attends some other exam at the previous ExamPeriod.prev() or following ExamPeriod.next()
period. |
int |
getNrDirectConflicts()
Number of direct student conflicts, i.e., number of cases when this exam is attended by a student that attends some other exam at the same period |
int |
getNrDistanceBackToBackConflicts()
Number of back-to-back distance student conflicts, i.e., number of cases when this exam is attended by a student that attends some other exam at the previous ExamPeriod.prev() or following
ExamPeriod.next() period and the distance
getDistanceInMeters(ExamPlacement) between these two exams
is greater than ExamModel.getBackToBackDistance() . |
int |
getNrInstructorBackToBackConflicts()
Number of back-to-back instructor conflicts, i.e., number of cases when this exam is attended by an instructor that attends some other exam at the previous ExamPeriod.prev() or following
ExamPeriod.next() period. |
int |
getNrInstructorDirectConflicts()
Number of direct instructor conflicts, i.e., number of cases when this exam is attended by an instructor that attends some other exam at the same period |
int |
getNrInstructorDistanceBackToBackConflicts()
Number of back-to-back distance instructor conflicts, i.e., number of cases when this exam is attended by an instructor that attends some other exam at the previous ExamPeriod.prev() or following
ExamPeriod.next() period and the distance
getDistanceInMeters(ExamPlacement) between these two exams
is greater than ExamModel.getBackToBackDistance() . |
int |
getNrInstructorMoreThanTwoADayConflicts()
Number of more than two exams a day instructor conflicts, i.e., when this exam is attended by an instructor student that attends two or more other exams at the same day. |
int |
getNrInstructorNotAvailableConflicts()
Number of direct instructor conflicts caused by the fact that a student is not available |
int |
getNrMoreThanTwoADayConflicts()
Number of more than two exams a day student conflicts, i.e., when this exam is attended by a student that attends two or more other exams at the same day. |
int |
getNrNotAvailableConflicts()
Number of direct student conflicts caused by the fact that a student is not available |
ExamPeriod |
getPeriod()
Assigned period |
double |
getPeriodDistributionPenalty()
Period related distribution penalty, i.e., sum weights of violated distribution constraints |
int |
getPeriodPenalty()
Cost for using a period, i.e., ExamPeriodPlacement.getPenalty() |
ExamPeriodPlacement |
getPeriodPlacement()
Assigned period placement |
int |
getPerturbationPenalty()
Perturbation penalty, i.e., penalty for using a different assignment than initial. |
double |
getRoomCost()
Overall cost of using this set or rooms. |
double |
getRoomDistributionPenalty()
Room related distribution penalty, i.e., sum weights of violated distribution constraints |
String |
getRoomName(String delim)
Room names separated with the given delimiter |
int |
getRoomPenalty()
Room penalty (penalty for using given rooms), i.e., sum of ExamRoomPlacement.getPenalty(ExamPeriod) of assigned rooms |
int |
getRoomPerturbationPenalty()
Room perturbation penalty, i.e., number of assigned rooms different from initial. |
Set<ExamRoomPlacement> |
getRoomPlacements()
Assigned rooms (it is empty when Exam.getMaxRooms() is zero) |
int |
getRoomSizePenalty()
Cost for using room(s) that are too big |
double |
getRoomSplitDistancePenalty()
Room split distance penalty, i.e., average distance between two rooms of this placement |
int |
getRoomSplitPenalty()
Cost for using more than one room (nrSplits^2). |
int |
getRotationPenalty()
Rotation penalty (an exam that has been in later period last times tries to be in an earlier period) |
int |
getSize()
Overall size of assigned rooms |
double |
getTimeCost()
Overall cost of using this period. |
int |
hashCode()
Hash code |
double |
toDouble()
Overall cost of using this placement. |
String |
toString()
String representation -- returns a list of assignment costs |
Methods inherited from class net.sf.cpsolver.ifs.model.Value |
---|
assigned, compareTo, conflicts, countAssignments, getDescription, getExtra, getId, isConsistent, lastAssignmentIteration, lastUnassignmentIteration, setExtra, setVariable, unassigned, valueEquals, variable |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ExamPlacement(Exam exam, ExamPeriodPlacement periodPlacement, Set<ExamRoomPlacement> roomPlacements)
exam
- an examperiodPlacement
- period placementroomPlacements
- a set of room placements ExamRoomPlacement
Method Detail |
---|
public ExamPeriod getPeriod()
public ExamPeriodPlacement getPeriodPlacement()
public Set<ExamRoomPlacement> getRoomPlacements()
Exam.getMaxRooms()
is zero)
ExamRoomPlacement
public int getSize()
public int getNrDirectConflicts()
public int getNrNotAvailableConflicts()
public int getNrBackToBackConflicts()
ExamPeriod.prev()
or following ExamPeriod.next()
period. If ExamModel.isDayBreakBackToBack()
is false,
back-to-back conflicts are only considered between consecutive periods
that are of the same day.
public double getDistanceInMeters(ExamPlacement other)
ExamRoom.getDistanceInMeters(ExamRoom)
is used to get a distance between
two rooms.
public int getNrDistanceBackToBackConflicts()
ExamPeriod.prev()
or following
ExamPeriod.next()
period and the distance
getDistanceInMeters(ExamPlacement)
between these two exams
is greater than ExamModel.getBackToBackDistance()
. Distance
back-to-back conflicts are only considered between consecutive periods
that are of the same day.
public int getNrMoreThanTwoADayConflicts()
public int getNrInstructorDirectConflicts()
public int getNrInstructorNotAvailableConflicts()
public int getNrInstructorBackToBackConflicts()
ExamPeriod.prev()
or following
ExamPeriod.next()
period. If
ExamModel.isDayBreakBackToBack()
is false, back-to-back conflicts
are only considered between consecutive periods that are of the same day.
public int getNrInstructorDistanceBackToBackConflicts()
ExamPeriod.prev()
or following
ExamPeriod.next()
period and the distance
getDistanceInMeters(ExamPlacement)
between these two exams
is greater than ExamModel.getBackToBackDistance()
. Distance
back-to-back conflicts are only considered between consecutive periods
that are of the same day.
public int getNrInstructorMoreThanTwoADayConflicts()
public int getRoomSizePenalty()
ExamRoom.getSize()
or ExamRoom.getAltSize()
based
on Exam.hasAltSeating()
) and the number of students
Exam.getSize()
public int getRoomSplitPenalty()
public int getPeriodPenalty()
ExamPeriodPlacement.getPenalty()
public int getRotationPenalty()
public int getLargePenalty()
ExamModel.getLargePeriod()
, one otherwisepublic int getRoomPenalty()
ExamRoomPlacement.getPenalty(ExamPeriod)
of assigned rooms
public int getPerturbationPenalty()
ExamModel.isMPP()
is true (minimal
perturbation problem).
public int getRoomPerturbationPenalty()
ExamModel.isMPP()
is true (minimal
perturbation problem).
public double getRoomSplitDistancePenalty()
public double getDistributionPenalty()
public double getRoomDistributionPenalty()
public double getPeriodDistributionPenalty()
public double toDouble()
getNrDirectConflicts()
, weighted by ExamModel.getDirectConflictWeight()
getNrMoreThanTwoADayConflicts()
, weighted by
ExamModel.getMoreThanTwoADayWeight()
getNrBackToBackConflicts()
, weighted by
ExamModel.getBackToBackConflictWeight()
getNrDistanceBackToBackConflicts()
, weighted by
ExamModel.getDistanceBackToBackConflictWeight()
getPeriodPenalty()
, weighted by
ExamModel.getPeriodWeight()
getRoomSizePenalty()
,
weighted by ExamModel.getRoomSizeWeight()
getRoomSplitPenalty()
,
weighted by ExamModel.getRoomSplitWeight()
getRoomSplitDistancePenalty()
, weighted by
ExamModel.getRoomSplitDistanceWeight()
getRoomPenalty()
, weighted by
ExamModel.getRoomWeight()
getRotationPenalty()
,
weighted by ExamModel.getExamRotationWeight()
getNrInstructorDirectConflicts()
, weighted by
ExamModel.getInstructorDirectConflictWeight()
getNrInstructorMoreThanTwoADayConflicts()
, weighted
by ExamModel.getInstructorMoreThanTwoADayWeight()
getNrInstructorBackToBackConflicts()
, weighted by
ExamModel.getInstructorBackToBackConflictWeight()
getNrInstructorDistanceBackToBackConflicts()
,
weighted by
ExamModel.getInstructorDistanceBackToBackConflictWeight()
getLargePenalty()
, weighted
by ExamModel.getLargeWeight()
toDouble
in class Value<Exam,ExamPlacement>
public double getTimeCost()
getNrDirectConflicts()
, weighted by ExamModel.getDirectConflictWeight()
getNrMoreThanTwoADayConflicts()
, weighted by
ExamModel.getMoreThanTwoADayWeight()
getNrBackToBackConflicts()
, weighted by
ExamModel.getBackToBackConflictWeight()
getPeriodPenalty()
, weighted by
ExamModel.getPeriodWeight()
getRotationPenalty()
,
weighted by ExamModel.getExamRotationWeight()
getNrInstructorDirectConflicts()
, weighted by
ExamModel.getInstructorDirectConflictWeight()
getNrInstructorMoreThanTwoADayConflicts()
, weighted
by ExamModel.getInstructorMoreThanTwoADayWeight()
getNrInstructorBackToBackConflicts()
, weighted by
ExamModel.getInstructorBackToBackConflictWeight()
getNrInstructorDistanceBackToBackConflicts()
,
weighted by
ExamModel.getInstructorDistanceBackToBackConflictWeight()
getLargePenalty()
, weighted
by ExamModel.getLargeWeight()
public double getRoomCost()
getNrDistanceBackToBackConflicts()
, weighted by
ExamModel.getDistanceBackToBackConflictWeight()
getNrInstructorDistanceBackToBackConflicts()
,
weighted by
ExamModel.getInstructorDistanceBackToBackConflictWeight()
getRoomSizePenalty()
,
weighted by ExamModel.getRoomSizeWeight()
getRoomSplitPenalty()
,
weighted by ExamModel.getRoomSplitWeight()
getRoomSplitDistancePenalty()
, weighted by
ExamModel.getRoomSplitDistanceWeight()
getRoomPenalty()
, weighted by
ExamModel.getRoomWeight()
public String getRoomName(String delim)
public String getName()
getName
in class Value<Exam,ExamPlacement>
public String toString()
toString
in class Value<Exam,ExamPlacement>
public boolean equals(Object o)
equals
in class Value<Exam,ExamPlacement>
public int hashCode()
hashCode
in class Value<Exam,ExamPlacement>
public boolean contains(ExamRoom room)
getRoomPlacements()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |