|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.cpsolver.exam.neighbours.ExamPeriodSwapMove
public class ExamPeriodSwapMove
Try to swap a period between two exams.
Two examinations are randomly selected. A new placement is generated by swapping periods of the two exams.
For each exam, the best possible room placement is found. If the two exams are in the same period, it just tries
to change the room assignments by looking for the best available room placement ignoring the existing room assignments
of the two exams. If no conflict results from the swap the assignment is returned.
The following exams of the second exam in the pair are tried for an exam swap otherwise.
Constructor Summary | |
---|---|
ExamPeriodSwapMove(DataProperties properties)
Constructor |
Method Summary | |
---|---|
boolean |
checkDistributionConstraints(Exam exam,
ExamPeriodPlacement period,
Map<Exam,ExamPlacement> placements)
|
boolean |
checkDistributionConstraints(Exam exam,
ExamRoomPlacement room,
Set<ExamPlacement> conflictsToIgnore,
Map<Exam,ExamPlacement> placements)
|
Set<ExamRoomPlacement> |
findBestAvailableRooms(Exam exam,
ExamPeriodPlacement period,
Set<ExamPlacement> conflictsToIgnore,
Map<Exam,ExamPlacement> placements)
|
int |
getDistributionConstraintPenalty(Exam exam,
ExamRoomPlacement room,
Set<ExamPlacement> conflictsToIgnore,
Map<Exam,ExamPlacement> placements)
|
void |
init(Solver<Exam,ExamPlacement> solver)
Initialization |
Neighbour<Exam,ExamPlacement> |
selectNeighbour(Solution<Exam,ExamPlacement> solution)
Select an exam randomly, select an available period randomly (if it is not assigned), use rooms if possible, select rooms using Exam.findBestAvailableRooms(ExamPeriodPlacement) if not (exam is unassigned, a room is not available or used). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExamPeriodSwapMove(DataProperties properties)
properties
- problem propertiesMethod Detail |
---|
public void init(Solver<Exam,ExamPlacement> solver)
init
in interface NeighbourSelection<Exam,ExamPlacement>
public Neighbour<Exam,ExamPlacement> selectNeighbour(Solution<Exam,ExamPlacement> solution)
Exam.findBestAvailableRooms(ExamPeriodPlacement)
if not (exam is unassigned, a room is not available or used).
selectNeighbour
in interface NeighbourSelection<Exam,ExamPlacement>
solution
- given solution
public boolean checkDistributionConstraints(Exam exam, ExamPeriodPlacement period, Map<Exam,ExamPlacement> placements)
public boolean checkDistributionConstraints(Exam exam, ExamRoomPlacement room, Set<ExamPlacement> conflictsToIgnore, Map<Exam,ExamPlacement> placements)
public int getDistributionConstraintPenalty(Exam exam, ExamRoomPlacement room, Set<ExamPlacement> conflictsToIgnore, Map<Exam,ExamPlacement> placements)
public Set<ExamRoomPlacement> findBestAvailableRooms(Exam exam, ExamPeriodPlacement period, Set<ExamPlacement> conflictsToIgnore, Map<Exam,ExamPlacement> placements)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |