|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.ifs.heuristics.StandardNeighbourSelection net.sf.cpsolver.ifs.heuristics.BacktrackNeighbourSelection
public class BacktrackNeighbourSelection
Backtracking-based neighbour selection. A best neighbour that is found by
a backtracking-based algorithm within a limited depth from a selected variable
is returned.
Parameters:
Parameter | Type | Comment |
---|---|---|
Neighbour.BackTrackTimeout | Integer | Timeout for each neighbour selection (in milliseconds). |
Neighbour.BackTrackDepth | Integer | Limit of search depth. |
Nested Class Summary | |
---|---|
class |
BacktrackNeighbourSelection.BackTrackNeighbour
Backtracking neighbour |
Field Summary | |
---|---|
protected BacktrackNeighbourSelection.BackTrackNeighbour |
iBackTrackNeighbour
|
protected Solution |
iSolution
|
protected double |
iValue
|
Fields inherited from class net.sf.cpsolver.ifs.heuristics.StandardNeighbourSelection |
---|
sLogger |
Constructor Summary | |
---|---|
BacktrackNeighbourSelection(DataProperties properties)
Constructor |
Method Summary | |
---|---|
protected void |
backtrack(Vector variables2resolve,
int idx,
int depth)
Backtracking |
protected boolean |
canContinue(Vector variables2resolve,
int idx,
int depth)
Check whether backtrack can continue |
protected boolean |
canContinueEvaluation()
|
protected boolean |
checkBound(Vector variables2resolve,
int idx,
int depth,
Value value,
Set conflicts)
Check bound |
int |
getDepth()
Return maximal depth |
int |
getMaxIters()
Return maximal number of iterations |
long |
getTime()
Time needed to find a neighbour (last call of selectNeighbour method) |
int |
getTimeout()
Return time limit |
void |
init(Solver solver)
Solver initialization |
boolean |
isMaxItersReached()
True, if the maximum number of iterations was reached by the last call of selectNeighbour method |
boolean |
isTimeoutReached()
True, if timeout was reached during the last call of selectNeighbour method |
Neighbour |
selectNeighbour(Solution solution)
Select neighbour. |
Neighbour |
selectNeighbour(Solution solution,
Variable variable)
Select neighbour -- starts from the provided variable. |
void |
setDepth(int depth)
Set maximal depth |
void |
setMaxIters(int maxIters)
Set maximal number of iterations |
void |
setTimeout(int timeout)
Set time limit |
protected Enumeration |
values(Variable variable)
List of values of the given variable that will be considered |
Methods inherited from class net.sf.cpsolver.ifs.heuristics.StandardNeighbourSelection |
---|
getValueSelection, getVariableSelection, selectValue, selectVariable, setValueSelection, setVariableSelection |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Solution iSolution
protected BacktrackNeighbourSelection.BackTrackNeighbour iBackTrackNeighbour
protected double iValue
Constructor Detail |
---|
public BacktrackNeighbourSelection(DataProperties properties) throws Exception
properties
- configuration
Exception
Method Detail |
---|
public void init(Solver solver)
init
in interface NeighbourSelection
init
in class StandardNeighbourSelection
public Neighbour selectNeighbour(Solution solution)
StandardNeighbourSelection.getVariableSelection()
) is used to select
a variable. A backtracking of a limited depth is than employed from this variable.
The best assignment found is returned (see BacktrackNeighbourSelection.BackTrackNeighbour
).
selectNeighbour
in interface NeighbourSelection
selectNeighbour
in class StandardNeighbourSelection
solution
- given solution
public Neighbour selectNeighbour(Solution solution, Variable variable)
BacktrackNeighbourSelection.BackTrackNeighbour
).
public long getTime()
public boolean isTimeoutReached()
public boolean isMaxItersReached()
protected Enumeration values(Variable variable)
protected boolean checkBound(Vector variables2resolve, int idx, int depth, Value value, Set conflicts)
protected boolean canContinue(Vector variables2resolve, int idx, int depth)
protected boolean canContinueEvaluation()
protected void backtrack(Vector variables2resolve, int idx, int depth)
public int getDepth()
public void setDepth(int depth)
public int getTimeout()
public void setTimeout(int timeout)
public int getMaxIters()
public void setMaxIters(int maxIters)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |