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()
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.
|
void |
onContradiction(ContradictionException cex) |
void |
onSolution() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterDownBranch
afterUpBranch
beforeRestart
public 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 Closeable
close
in interface AutoCloseable
IOException
public void beforeDownBranch(boolean left)
IMonitorDownBranch
beforeDownBranch
in interface IMonitorDownBranch
left
- set to true to specify that this is a left branchpublic void beforeUpBranch()
IMonitorUpBranch
beforeUpBranch
in interface IMonitorUpBranch
public void onSolution()
onSolution
in interface IMonitorSolution
public void onContradiction(ContradictionException cex)
onContradiction
in interface IMonitorContradiction
public void afterRestart()
IMonitorRestart
afterRestart
in interface IMonitorRestart
Copyright © 2018. All rights reserved.