public class ExamPlacement extends Value<Exam,ExamPlacement>
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). Constructor and Description |
---|
ExamPlacement(Exam exam,
ExamPeriodPlacement periodPlacement,
Set<ExamRoomPlacement> roomPlacements)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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.
|
String |
getName()
Assignment name (period / room(s))
|
ExamPeriod |
getPeriod()
Assigned period
|
ExamPeriodPlacement |
getPeriodPlacement()
Assigned period placement
|
double |
getRoomCost(Assignment<Exam,ExamPlacement> assignment)
Overall cost of using this set or rooms.
|
String |
getRoomName(String delim)
Room names separated with the given delimiter
|
Set<ExamRoomPlacement> |
getRoomPlacements()
Assigned rooms (it is empty when
Exam.getMaxRooms() is zero) |
double |
getTimeCost(Assignment<Exam,ExamPlacement> assignment)
Overall cost of using this period.
|
int |
hashCode()
Hash code
|
double |
toDouble(Assignment<Exam,ExamPlacement> assignment)
Overall cost of using this placement.
|
String |
toString()
String representation -- returns a list of assignment costs
|
String |
toString(Assignment<Exam,ExamPlacement> assignment)
String representation -- returns a list of assignment costs
|
compareTo, compareTo, conflicts, conflicts, getDescription, getExtra, getId, isConsistent, setExtra, setVariable, toDouble, valueEquals, valueEquals, variable
public ExamPlacement(Exam exam, ExamPeriodPlacement periodPlacement, Set<ExamRoomPlacement> roomPlacements)
exam
- an examperiodPlacement
- period placementroomPlacements
- a set of room placements ExamRoomPlacement
public ExamPeriod getPeriod()
public ExamPeriodPlacement getPeriodPlacement()
public Set<ExamRoomPlacement> getRoomPlacements()
Exam.getMaxRooms()
is zero)ExamRoomPlacement
public double getDistanceInMeters(ExamPlacement other)
ExamRoom.getDistanceInMeters(ExamRoom)
is used to get a distance between
two rooms.other
- other placementpublic double toDouble(Assignment<Exam,ExamPlacement> assignment)
toDouble
in class Value<Exam,ExamPlacement>
assignment
- current assignmentpublic double getTimeCost(Assignment<Exam,ExamPlacement> assignment)
assignment
- current assignmentCriterion.getWeight()
period values ExamCriterion.getPeriodValue(Assignment, ExamPlacement)
public double getRoomCost(Assignment<Exam,ExamPlacement> assignment)
assignment
- current assignmentCriterion.getWeight()
room values ExamCriterion.getRoomValue(Assignment, ExamPlacement)
public String getRoomName(String delim)
delim
- delimiterpublic String getName()
getName
in class Value<Exam,ExamPlacement>
public String toString(Assignment<Exam,ExamPlacement> assignment)
assignment
- current assignmentpublic 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()
room
- a room