public abstract class SearchViz extends Object implements IMonitorDownBranch, IMonitorUpBranch, IMonitorSolution, IMonitorContradiction, IMonitorRestart, Closeable
Modifier and Type | Field and Description |
---|---|
protected boolean |
connected
Is connection alive
|
protected Solver |
mSolver
Reference to the model
|
Constructor and Description |
---|
SearchViz(Solver aSolver,
boolean sendDomain)
Active connection to cp-profiler.
|
Modifier and Type | Method and Description |
---|---|
void |
afterRestart()
Actions to execute after restarting the search
|
void |
beforeDownBranch(boolean left)
Action to perform before going down in the tree search
|
void |
beforeUpBranch()
Actions to execute before going up in the tree search
|
void |
close()
Close connection to cp-profiler.
|
protected abstract boolean |
connect(String label) |
protected abstract void |
disconnect() |
void |
onContradiction(ContradictionException cex) |
void |
onSolution() |
protected abstract void |
sendFailure(int nc,
int pid,
int alt,
int kid,
int rid,
String label,
String info) |
protected abstract void |
sendNode(int nc,
int pid,
int alt,
int kid,
int rid,
String label,
String info) |
protected abstract void |
sendRestart(int rid) |
protected abstract void |
sendSolution(int nc,
int pid,
int alt,
int kid,
int rid,
String label,
String info) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterDownBranch
afterUpBranch
beforeRestart
protected Solver mSolver
protected boolean connected
public SearchViz(Solver aSolver, boolean sendDomain)
aSolver
- solver to observe resolutionsendDomain
- set to true to send domain into 'info' field (beware, it can increase the memory consumption
and slow down the overall execution), set to false otherwise.protected abstract boolean connect(String label)
protected abstract void disconnect()
protected abstract void sendNode(int nc, int pid, int alt, int kid, int rid, String label, String info)
protected abstract void sendSolution(int nc, int pid, int alt, int kid, int rid, String label, String info)
protected abstract void sendFailure(int nc, int pid, int alt, int kid, int rid, String label, String info)
protected abstract void sendRestart(int rid)
public final void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public final void beforeDownBranch(boolean left)
IMonitorDownBranch
beforeDownBranch
in interface IMonitorDownBranch
left
- set to true to specify that this is a left branchpublic final void beforeUpBranch()
IMonitorUpBranch
beforeUpBranch
in interface IMonitorUpBranch
public final void onSolution()
onSolution
in interface IMonitorSolution
public final void onContradiction(ContradictionException cex)
onContradiction
in interface IMonitorContradiction
public final void afterRestart()
IMonitorRestart
afterRestart
in interface IMonitorRestart
Copyright © 2018. All rights reserved.