Skip to content

Uses ChocoSolver to run single-objective optimization on a Clafer file and produce results in ClaferMoo format.

License

Notifications You must be signed in to change notification settings

gsdlab/ClaferChocoSoo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ClaferChocoSoo

v0.3.5.20-01-2014

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.

Contributors

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.

Running

Prerequisites

  • 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.

Building

Prerequisites

  • 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.

Procedures

  • 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?

About

Uses ChocoSolver to run single-objective optimization on a Clafer file and produce results in ClaferMoo format.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •