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()
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()
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
|
assigned, compareTo, conflicts, countAssignments, getDescription, getExtra, getId, isConsistent, lastAssignmentIteration, lastUnassignmentIteration, setExtra, setVariable, unassigned, 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.public double toDouble()
toDouble
in class Value<Exam,ExamPlacement>
public double getTimeCost()
public double getRoomCost()
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()