public class ExamConstruction extends NeighbourSelectionWithContext<Exam,ExamPlacement,ExamConstruction.Context>
Exam.compareTo(Exam)
)
Exam.findBestAvailableRooms(Assignment, ExamPeriodPlacement)
).
ExamPlacement.getTimeCost(Assignment)
), but no hard
constraint is violated. The problem is considered locally optimal if there is
no such move. Modifier and Type | Class and Description |
---|---|
class |
ExamConstruction.Context |
iContextOverride
sMaxSize
Constructor and Description |
---|
ExamConstruction(DataProperties properties)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Neighbour<Exam,ExamPlacement> |
checkLocalOptimality(Assignment<Exam,ExamPlacement> assignment,
ExamModel model)
Find a new assignment of one of the assigned exams that improves the time
cost
ExamPlacement.getTimeCost(Assignment) and for which there is a set of
available rooms Exam.findBestAvailableRooms(Assignment, ExamPeriodPlacement) . |
ExamConstruction.Context |
createAssignmentContext(Assignment<Exam,ExamPlacement> assignment)
Create a new assignment context for the given assignment.
|
void |
init(Solver<Exam,ExamPlacement> solver)
Initialization
|
Neighbour<Exam,ExamPlacement> |
selectNeighbour(Solution<Exam,ExamPlacement> solution)
Select a neighbour.
|
getAssignmentContextReference, getContext, getContext, hasContextOverride, isSingleContextSolver, setAssignmentContextReference
public ExamConstruction(DataProperties properties)
properties
- problem propertiespublic void init(Solver<Exam,ExamPlacement> solver)
init
in interface NeighbourSelection<Exam,ExamPlacement>
init
in class NeighbourSelectionWithContext<Exam,ExamPlacement,ExamConstruction.Context>
solver
- current solverpublic Neighbour<Exam,ExamPlacement> checkLocalOptimality(Assignment<Exam,ExamPlacement> assignment, ExamModel model)
ExamPlacement.getTimeCost(Assignment)
and for which there is a set of
available rooms Exam.findBestAvailableRooms(Assignment, ExamPeriodPlacement)
.
Return null, if there is no such assignment (the problem is considered
locally optimal).assignment
- current assignmentmodel
- problem modelpublic Neighbour<Exam,ExamPlacement> selectNeighbour(Solution<Exam,ExamPlacement> solution)
Exam.compareTo(Exam)
)
Exam.findBestAvailableRooms(Assignment, ExamPeriodPlacement)
).
solution
- given solutionpublic ExamConstruction.Context createAssignmentContext(Assignment<Exam,ExamPlacement> assignment)
HasAssignmentContext
assignment
- an assignment for which there needs to be an assignment context