public class ExamTabuSearch extends NeighbourSelectionWithContext<Exam,ExamPlacement,ExamTabuSearch.TabuList> implements ValueSelection<Exam,ExamPlacement>
NeighbourSelection
, the most improving (re)assignment of a
value to a variable is returned (all variables and all their values are
enumerated). If there are more than one of such assignments, one is selected
randomly. A returned assignment can cause unassignment of other existing
assignments. The search is stopped (
selectNeighbour(Solution)
returns null) after
TabuSearch.MaxIdle idle (not improving) iterations. ValueSelection
, the most improving (re)assignment of a
value to a given variable is returned (all values of the given variable are
enumerated). If there are more than one of such assignments, one is selected
randomly. A returned assignment can cause unassignment of other existing
assignments. ConflictStatistics
(CBS) can be used
instead of (or together with) tabu list, when CBS is used as a solver
extension.Modifier and Type | Class and Description |
---|---|
static class |
ExamTabuSearch.TabuList
Tabu-list
|
iContextOverride
sMaxSize
Constructor and Description |
---|
ExamTabuSearch(DataProperties properties)
TabuSearch.MaxIdle ... maximum number of idle iterations (default is
10000)
TabuSearch.MinSize ... minimum size of the tabu list
TabuSearch.MaxSize ... maximum size of the tabu list
Value.ValueWeight ... weight of a value (i.e.,
Value.toDouble(Assignment) )
Value.ConflictWeight ... weight of a conflicting value (see
Model.conflictValues(Assignment, Value) ), it is also weighted by the past
occurrences when conflict-based statistics is used
|
Modifier and Type | Method and Description |
---|---|
ExamTabuSearch.TabuList |
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)
Neighbor selection
|
ExamPlacement |
selectValue(Solution<Exam,ExamPlacement> solution,
Exam exam)
Value selection
|
getAssignmentContextReference, getContext, getContext, hasContextOverride, isSingleContextSolver, setAssignmentContextReference
public ExamTabuSearch(DataProperties properties) throws Exception
Value.toDouble(Assignment)
)
Model.conflictValues(Assignment, Value)
), it is also weighted by the past
occurrences when conflict-based statistics is used
properties
- solver configurationException
- thrown when the initialization failspublic void init(Solver<Exam,ExamPlacement> solver)
init
in interface NeighbourSelection<Exam,ExamPlacement>
init
in interface ValueSelection<Exam,ExamPlacement>
init
in class NeighbourSelectionWithContext<Exam,ExamPlacement,ExamTabuSearch.TabuList>
solver
- current solverpublic Neighbour<Exam,ExamPlacement> selectNeighbour(Solution<Exam,ExamPlacement> solution)
selectNeighbour
in interface NeighbourSelection<Exam,ExamPlacement>
solution
- given solutionpublic ExamPlacement selectValue(Solution<Exam,ExamPlacement> solution, Exam exam)
selectValue
in interface ValueSelection<Exam,ExamPlacement>
solution
- current solutionexam
- selected variablepublic ExamTabuSearch.TabuList createAssignmentContext(Assignment<Exam,ExamPlacement> assignment)
HasAssignmentContext
createAssignmentContext
in interface HasAssignmentContext<Exam,ExamPlacement,ExamTabuSearch.TabuList>
assignment
- an assignment for which there needs to be an assignment context