public class CPProfiler extends Object implements IMonitorDownBranch, IMonitorUpBranch, IMonitorSolution, IMonitorContradiction, IMonitorRestart, Closeable
Note that CPProfiler is Closeable and can be used as follow:
Model model = ProblemMaker.makeCostasArrays(7);
try (CPProfiler profiler = new CPProfiler(model)) {
while (model.getSolver().solve()) ;
out.println(model.getSolver().getSolutionCount());
}
Created by cprudhom on 22/10/2015. Project: choco.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG
Set to true to activate trace for debugging
|
| Constructor and Description |
|---|
CPProfiler(Model aModel,
boolean sendDomain)
Active connection to cp-profiler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterRestart() |
void |
beforeDownBranch(boolean left)
Action to perform before going down in the tree search
|
void |
beforeUpBranch() |
void |
close()
Close connection to cp-profiler.
|
void |
onContradiction(ContradictionException cex) |
void |
onSolution() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterDownBranchafterUpBranchbeforeRestartpublic CPProfiler(Model aModel, boolean sendDomain)
aModel - model 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.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void beforeDownBranch(boolean left)
IMonitorDownBranchbeforeDownBranch in interface IMonitorDownBranchleft - set to true to specify that this is a left branchpublic void beforeUpBranch()
beforeUpBranch in interface IMonitorUpBranchpublic void onSolution()
onSolution in interface IMonitorSolutionpublic void onContradiction(ContradictionException cex)
onContradiction in interface IMonitorContradictionpublic void afterRestart()
afterRestart in interface IMonitorRestartCopyright © 2017. All rights reserved.