Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

chocoteam/choco-parsers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

choco-parsers

choco-parsers is an extension library for choco-solver.

It aims at importing models to various format. It provides a parser for the FlatZinc language, a low-level solver input language that is the target language for MiniZinc, a parser for XCSP3, an intermediate integrated XML-based format and a parser for MPS a file format for presenting and archiving linear programming (LP) and mixed integer programming problems.

It also provides utilities to export a model written with Choco to a JSON format and to import a JSON format file into a Model.

Parsing a file

By default, the extension of a file helps choosing the accurate parser. Thus, any supported file (FlatZinc, XCSP3, MPS or JSON) can be parsed and solved using the following command:

java -jar .:/path/to/choco-parsers-4.0.5-with-dependencies.jar [options] <file>

Only the file name is mandatory. Alternatively, if the file has no explicit extension, the option -pa followed a digit between 1 and 4 can be declared to specify the parser to use; 1: FlatZinc, 2: XCSP3, 3: MPS and 4: JSON.

A Bash file named parse.sh can also be found in ./src/main/bash/ that handles basic options.

Finally, if one can to use a specific parser directly, in that case, click on the right link above.