public class ExplainingCut extends ANeighbor implements IMonitorUpBranch
This neighborhood is specific in the sense that it needs to compute explanation after a new solution has been found.
Furthermore, the fixSomeVariables method creates and applies decisions, so that the explanation recorder can infer.
It works as follow:
- on a solution: force the application of the cut together with the decision path which leads to the solution, explain the failure
- then, on a call to fixSomeVariables, it selects randomly K decisions explaining the cut, and relax them from the decision path.
Unrelated decisions are never relaxed, the idea here is to work only on the decisions which lead to a failure.
Modifier and Type | Field and Description |
---|---|
protected ExplanationEngine |
mExplanationEngine |
protected Random |
random |
Constructor and Description |
---|
ExplainingCut(Solver aSolver,
int level,
long seed) |
Modifier and Type | Method and Description |
---|---|
protected void |
_fixVar() |
void |
afterUpBranch() |
void |
beforeUpBranch() |
protected void |
explain()
Force the failure, apply decisions to the last solution + cut => failure!
|
void |
fixSomeVariables(ICause cause)
Freezes some variables in order to have a fast computation
|
boolean |
isSearchComplete() |
void |
recordSolution()
Record values of decision variables to freeze some ones during the next LNS run
|
void |
restrictLess()
Use less restriction at the beginning of a LNS run
in order to get better solutions
Called when no solution was found during a LNS run (trapped into a local optimum)
|
activeFastRestart, fastRestart
protected ExplanationEngine mExplanationEngine
protected final Random random
public ExplainingCut(Solver aSolver, int level, long seed)
public void recordSolution()
INeighbor
recordSolution
in interface INeighbor
public void fixSomeVariables(ICause cause) throws ContradictionException
INeighbor
fixSomeVariables
in interface INeighbor
cause
- the LNSContradictionException
- if variables have been fixed to inconsistent values
this can happen if fixed variables cannot yield to a better solution than the last one
a contradiction is raised because a cut has been posted on the objective function
Notice that it could be used to generate a no-goodprotected void _fixVar()
public void restrictLess()
INeighbor
restrictLess
in interface INeighbor
public boolean isSearchComplete()
isSearchComplete
in interface INeighbor
public void beforeUpBranch()
beforeUpBranch
in interface IMonitorUpBranch
public void afterUpBranch()
afterUpBranch
in interface IMonitorUpBranch
protected void explain()
Copyright © 2015. All rights reserved.