public class BranchBoundSelection extends Object implements NeighbourSelection<Request,Enrollment>, InfoProvider<Request,Enrollment>, SolverListener<Request,Enrollment>
Parameter | Type | Comment |
---|---|---|
Neighbour.BranchAndBoundTimeout | Integer |
Timeout for each neighbour selection (in milliseconds). |
Neighbour.BranchAndBoundMinimizePenalty | Boolean |
If true, section penalties (instead of section values) are minimized: overall penalty is minimized together with the maximization of the number of assigned requests and minimization of distance conflicts -- this variant is to better mimic the case when students can choose their sections (section times). |
Modifier and Type | Class and Description |
---|---|
static class |
BranchBoundSelection.BranchBoundNeighbour
Branch & bound neighbour -- a schedule of a student
|
class |
BranchBoundSelection.Selection
Branch & bound selection for a student
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
iBranchWhenSelectedHasNoConflict |
protected DistanceConflict |
iDistanceConflict |
protected double |
iDistConfWeight |
protected StudentFilter |
iFilter |
protected boolean |
iMinimizePenalty |
protected StudentSectioningModel |
iModel |
protected long |
iNbrIterations |
protected long |
iNbrNoSolution |
protected long |
iNbrTimeoutReached |
protected StudentOrder |
iOrder |
protected StudentQuality |
iStudentQuality |
protected LinkedList<Student> |
iStudents |
protected int |
iTimeout |
protected TimeOverlapsCounter |
iTimeOverlaps |
protected boolean |
iTimesToAvoidHeuristics |
protected long |
iTotalTime |
static boolean |
sDebug |
Constructor and Description |
---|
BranchBoundSelection(DataProperties properties)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addStudent(Student student) |
StudentFilter |
getFilter()
Only consider students meeting the given filter.
|
void |
getInfo(Assignment<Request,Enrollment> assignment,
Map<String,String> info)
Adds some information into the table with information about the solution
|
void |
getInfo(Assignment<Request,Enrollment> assignment,
Map<String,String> info,
Collection<Request> variables)
Adds some information into the table with information about the solution,
only consider variables from the given set
|
BranchBoundSelection.Selection |
getSelection(Assignment<Request,Enrollment> assignment,
Student student)
Branch & bound selection for a student
|
void |
init(Solver<Request,Enrollment> solver)
Criterion initialization
|
void |
init(Solver<Request,Enrollment> solver,
String name)
Initialize
|
void |
neighbourFailed(Assignment<Request,Enrollment> assignment,
long iteration,
Neighbour<Request,Enrollment> neighbour)
Called when
ParallelSolver failed to assign the given neighbour |
boolean |
neighbourSelected(Assignment<Request,Enrollment> assignment,
long iteration,
Neighbour<Request,Enrollment> neighbour)
A neighbour was selected
|
protected Student |
nextStudent() |
Neighbour<Request,Enrollment> |
selectNeighbour(Solution<Request,Enrollment> solution)
Select neighbour.
|
void |
setModel(StudentSectioningModel model) |
boolean |
valueSelected(Assignment<Request,Enrollment> assignment,
long iteration,
Request variable,
Enrollment value)
A value was selected
|
boolean |
variableSelected(Assignment<Request,Enrollment> assignment,
long iteration,
Request variable)
A variable was selected
|
BranchBoundSelection |
withFilter(StudentFilter filter)
Only consider students meeting the given filter.
|
protected int iTimeout
protected DistanceConflict iDistanceConflict
protected TimeOverlapsCounter iTimeOverlaps
protected StudentQuality iStudentQuality
protected StudentSectioningModel iModel
public static boolean sDebug
protected LinkedList<Student> iStudents
protected boolean iMinimizePenalty
protected StudentOrder iOrder
protected double iDistConfWeight
protected boolean iBranchWhenSelectedHasNoConflict
protected boolean iTimesToAvoidHeuristics
protected StudentFilter iFilter
protected long iNbrIterations
protected long iTotalTime
protected long iNbrTimeoutReached
protected long iNbrNoSolution
public BranchBoundSelection(DataProperties properties)
properties
- configurationpublic void init(Solver<Request,Enrollment> solver, String name)
solver
- current solvername
- phase namepublic void setModel(StudentSectioningModel model)
public void init(Solver<Request,Enrollment> solver)
NeighbourSelection
init
in interface NeighbourSelection<Request,Enrollment>
solver
- current solverprotected Student nextStudent()
public void addStudent(Student student)
public Neighbour<Request,Enrollment> selectNeighbour(Solution<Request,Enrollment> solution)
selectNeighbour
in interface NeighbourSelection<Request,Enrollment>
solution
- given solutionpublic BranchBoundSelection.Selection getSelection(Assignment<Request,Enrollment> assignment, Student student)
assignment
- current assignmentstudent
- selected studentpublic void getInfo(Assignment<Request,Enrollment> assignment, Map<String,String> info)
InfoProvider
getInfo
in interface InfoProvider<Request,Enrollment>
assignment
- current assignmentinfo
- info tablepublic void getInfo(Assignment<Request,Enrollment> assignment, Map<String,String> info, Collection<Request> variables)
InfoProvider
getInfo
in interface InfoProvider<Request,Enrollment>
assignment
- current assignmentinfo
- info tablevariables
- sub-problempublic StudentFilter getFilter()
public BranchBoundSelection withFilter(StudentFilter filter)
public boolean variableSelected(Assignment<Request,Enrollment> assignment, long iteration, Request variable)
SolverListener
variableSelected
in interface SolverListener<Request,Enrollment>
assignment
- current assignmentiteration
- current iterationvariable
- selected variablepublic boolean valueSelected(Assignment<Request,Enrollment> assignment, long iteration, Request variable, Enrollment value)
SolverListener
valueSelected
in interface SolverListener<Request,Enrollment>
assignment
- current assignmentiteration
- current iterationvariable
- selected variablevalue
- selected variablepublic boolean neighbourSelected(Assignment<Request,Enrollment> assignment, long iteration, Neighbour<Request,Enrollment> neighbour)
SolverListener
neighbourSelected
in interface SolverListener<Request,Enrollment>
assignment
- current assignmentiteration
- current iterationneighbour
- neighbourpublic void neighbourFailed(Assignment<Request,Enrollment> assignment, long iteration, Neighbour<Request,Enrollment> neighbour)
SolverListener
ParallelSolver
failed to assign the given neighbourneighbourFailed
in interface SolverListener<Request,Enrollment>
assignment
- current assignmentiteration
- current iterationneighbour
- neighbour