Uses ChocoSolver to run single-objective optimization on a Clafer file and produce results in ClaferMoo format.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



A backend for ClaferMooViz that uses ChocoSolver to solve single-objective optimization problems. This project is a wrapper that invokes ChocoSolver in a proper way and produces the output in the same format as ClaferMoo does.


Getting Binaries

Binary distributions of the release 0.3.5 of Clafer Tools for Windows, Mac, and Linux, can be downloaded from Clafer Tools - Binary Distributions.

The binary for this project is called claferchocosoo-0.3.5-jar-with-dependencies.jar.

In case this binary does not work on your particular machine configuration, it can be built from source code, as described further.



  • Java 6+.
  • Clafer Compiler. Required for compiling Clafer files (.cfr) into the Clafer Choco Javascript format (.js), so that they can be run using the tool.

Running Standalone

First, use Clafer Compiler:

clafer --mode=choco <file-name.cfr>

This will convert the Clafer file (.cfr) into the Clafer Choco Javascript file (.js).

Next, run the optimization:

java -jar claferchocosoo-0.3.5-jar-with-dependencies.jar <file-name.js>

This will run the solver and produce optimal instances in a textual form. Only Clafer files with single objective can be processed at this time.

To get the tool version:

java -jar claferchocosoo-0.3.5-jar-with-dependencies.jar --version

Running as a Backend

  • Install ClaferMooVisualizer.
  • Copy the binary claferchocosoo-0.3.5-jar-with-dependencies.jar to the Backends folder. If you built the project from the source code, the binary can be found in the target subfolder.
  • Put (if exists, just make sure all paths match) the following configuration in the Server/Backends/backends.json :
    "backends": [
            "id": "choco_single", 
            "label": "Choco (single objective only)",
            "tooltip": "A new Choco solver, for single objective optimization only",
            "accepted_format": "choco",               
            "tool": "java",
            "tool_args": ["-jar", "$dirname$/claferchocosoo-0.3.5-jar-with-dependencies.jar", "$filepath$"],
            "tool_version_args": ["-jar", "$dirname$/claferchocosoo-0.3.5-jar-with-dependencies.jar", "--version"]             },

$dirname$ means the full path to the Server/Backends folder, $filepath$ is the full path to the input JS file being processed.

  • If you made any changes to the backends.json, then restart ClaferMooVisualizer.
  • Now the backend should be accessible in ClaferMooVisualizer and listed in the Backends dropdown list.



  • Maven 2+. Required for building the projects and linking all dependencies
  • ChocoSolver. This is a Maven dependency for the project, so it should be installed (mvn install) as well.


  • Using Maven, run: mvn install over the project.
  • Two binaries will appear in the target subfolder: claferchocosoo-0.3.5-jar-with-dependencies.jar that is standalone and contains all the required dependencies, and claferchocosoo-0.3.5.jar that is not.

Important: Branches must correspond

All related projects are following the simultaneous release model. The branch master contains releases, whereas the branch develop contains code under development. When building the tools, the branches should match. Releases from branches master are guaranteed to work well together. Development versions from branches develop should work well together but this might not always be the case.

Need help?