- java.lang.Object
-
- org.chocosolver.solver.trace.SearchViz
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,IMonitorContradiction
,IMonitorDownBranch
,IMonitorRestart
,IMonitorSolution
,IMonitorUpBranch
,ISearchMonitor
- Direct Known Subclasses:
CPProfiler
,GephiGenerator
,GraphvizGenerator
public abstract class SearchViz extends Object implements IMonitorDownBranch, IMonitorUpBranch, IMonitorSolution, IMonitorContradiction, IMonitorRestart, Closeable
Created by cprudhom on 22/10/2015. Project: choco.- Since:
- 3.3.2
- Author:
- Charles Prud'homme
-
-
Constructor Summary
Constructors Constructor Description SearchViz(Solver aSolver, boolean sendDomain)
Active connection to cp-profiler.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
afterRestart()
Actions to execute after restarting the searchvoid
beforeDownBranch(boolean left)
Action to perform before going down in the tree searchvoid
beforeUpBranch()
Actions to execute before going up in the tree searchvoid
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)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.chocosolver.solver.search.loop.monitors.IMonitorDownBranch
afterDownBranch
-
Methods inherited from interface org.chocosolver.solver.search.loop.monitors.IMonitorRestart
beforeRestart
-
Methods inherited from interface org.chocosolver.solver.search.loop.monitors.IMonitorUpBranch
afterUpBranch
-
-
-
-
Field Detail
-
mSolver
protected Solver mSolver
Reference to the model
-
connected
protected boolean connected
Is connection alive
-
-
Constructor Detail
-
SearchViz
public SearchViz(Solver aSolver, boolean sendDomain)
Active connection to cp-profiler. This requires cp-profiler to be installed and launched before.- Parameters:
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.
-
-
Method Detail
-
connect
protected abstract boolean connect(String label)
-
disconnect
protected abstract void disconnect()
-
sendNode
protected abstract void sendNode(int nc, int pid, int alt, int kid, int rid, String label, String info)
-
sendSolution
protected abstract void sendSolution(int nc, int pid, int alt, int kid, int rid, String label, String info)
-
sendFailure
protected abstract void sendFailure(int nc, int pid, int alt, int kid, int rid, String label, String info)
-
sendRestart
protected abstract void sendRestart(int rid)
-
close
public final void close() throws IOException
Close connection to cp-profiler.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
beforeDownBranch
public final void beforeDownBranch(boolean left)
Description copied from interface:IMonitorDownBranch
Action to perform before going down in the tree search- Specified by:
beforeDownBranch
in interfaceIMonitorDownBranch
- Parameters:
left
- set to true to specify that this is a left branch
-
beforeUpBranch
public final void beforeUpBranch()
Description copied from interface:IMonitorUpBranch
Actions to execute before going up in the tree search- Specified by:
beforeUpBranch
in interfaceIMonitorUpBranch
-
onSolution
public final void onSolution()
- Specified by:
onSolution
in interfaceIMonitorSolution
-
onContradiction
public final void onContradiction(ContradictionException cex)
- Specified by:
onContradiction
in interfaceIMonitorContradiction
-
afterRestart
public final void afterRestart()
Description copied from interface:IMonitorRestart
Actions to execute after restarting the search- Specified by:
afterRestart
in interfaceIMonitorRestart
-
-