JaCoP can generate trace in a format accepted by CPviz, an open-source visualization toolkit for finite domain constraint programming (http://sourceforge.net/projects/cpviz/). This functionality is provided by class JaCoP.search.TraceGenerator.java and it is added to search. The simplest method to do it is to simply add the following line in your program.
where search is the search method for your problem, varSelect is the variable and value selection method of your search and vars is an array of variables to be traced.
The program that extends search with TraceGenerator will generate two files (by default named tree.xml and vis.xml) that register all search decisions and variables and their domains or values. CPviz program can use these files and generate visualization for the search.
The next steps requires installation of CPviz software.
The generation of visual information is done by issuing the following commands.
File config.xml defines the configuration. An example file is presented below.
For more details refer to CPviz documentation.
In the case of this configuration, the files will be generated in directory viz.out. Please, note that this directory must exist for CPviz to work correctly.
The visualization is provided by issuing the following command.
where batik.jar and jhall.jar are separate software packages that must be installed separately.
Once the visualization tool is started one has to open file viz.out/aaa.idx.
An example of a screen dump for sudoku puzzle model is depicted in Figure C.1.