Documentation |
Overview
1. Getting Started: The Graphical User InterfaceThe graphical user interface(GUI) can be used to model problems, tailor them to solver format, and also to solve problems directly by calling a solver externally.The GUI is started by either double-clicking the file 'tailor.jar' or executing the command 'java -jar tailor.jar' in the command line. The image below shows Tailor's GUI of version 0.3.2. It is devided into an input part (left) and an output part (right). The drop-down menus and buttons in the middle enable you to select your target solver and select between solving and tailoring.
The input part to the left has two fields for modelling: the top field is used to model the problem; the bottom field to specify parameter values (data). The parameter field can be left empty. There is a series of Essence' examples in the /examples directory of your Tailor distribution (like the Golomb Ruler model in the image) to get familiar with modelling in Essence'. The output part on the right summarises the results from Tailor: the top right field is a collection of tabs, each showing the translation output at a different stage: normalised Essence', flattened Essence', solver input and the Essence' solution. The content of each tab can be saved using the 'Save Tab' button. In between the input and output part, there are drop-down menus to select a translation mode: solve or tailor. If solve is selected, Tailor will translate your problem into the corresponding solver format, save it in a file, execute the solver on the file (in a separate process), and return the solver output on the right side. More information about how to set up the solver for Tailor is given below. If tailor is selected, Tailor will translate your problem into the selected output format (Minion input, Gecode input(C++), FlatZinc or flat Essence') and show it on the right hand top text field. The text field on the bottom right shows system and error messages. There are several different translation options that can be selected in the 'Translation' menu on the top left side of the window. Interesting options are:
2.Running Solvers from TailorTailor's GUI allows users to execute solvers in a separate process without having to deal with the solver input language. Below we first describe how to set up Tailor to run Minion and Gecode. Then we discuss what solving settings are used when calling the solvers.Note that all solvers/tools are open source software and that Tailor is mainly tested on Linux and Macs. Using Minion in TailorIn order to execute Minion from Tailor, you need to first install a Minion executable on your machine, which you can get from Minion's download page. Then you will need to specify the path to your Minion executable: click on 'Settings' in the GUI top menu and chose 'Set path to Minion'. Done!Using Gecode in TailorTailor runs Gecode through the Flatzinc/Gecode interpreter. Therefore, in order to solve problems in Gecode from Tailor you need two things: first, you will need to install the Gecode library - there is an extensive documentation how to do this on Gecode's docu page. Second, you will need Flatzinc/Gecode which interprets Flatzinc files with Gecode. Make sure that FlatZinc/Gecode is properly set up for Gecode (see its homepage for more details). Tailor will call the Flatzinc/Gecode executable 'fz' in its working directory, so either add 'fz' to your PATH or copy 'fz' into to the same directory as Tailor. You can set the PATH on Linux and Macs by modifying your .bash.rc or .profile file in your home-directory or by the command
bash> export PATH=$PATH:/path/to/fz
for bash shells. Done!
Default Solving SettingsBy default, Tailor will ask for one solution from the solver (except for optimisation problems), but this can be changed in the top menu of the GUI in 'Solving'. Tailor will print solving statistics with the solution (typically in a comment) and will show the exact solving command in the System Messages field.Note that Tailor does not put any effort into chosing search heuristics. Variables are ordered according to their order in the Essence'/XCSP problem model. Auxiliary variables are not branched on (by default). Values are ordered using the default method (ascending in Minion). If you (are an expert and) wish to adapt the search heuristics to your problem, then chose 'tailor' instead of 'solve' in the GUI and modify the generated solver input. 3. Tailoring Essence'Essence' is a solver-independent modelling language, which is extensively documented in this pdf file. An introduction into modelling with Essence' is given here. We also provide tools for syntax highlighting of Essence'.4. Tailoring XCSP FORMATTailor supports XCSP Format 2.1 which is the input format of the XCSP solver competitions. There is a large set of benchmarks, including a wide range of problem families. Note that Tailor's graphical interface is restricted to Essence' input only, so XCSP instances can only be translated with the command line version. As an example, the following command (in a shell) would translate the xml file `queens-10.xml' to Minion:shell> java -jar tailor.jar -xcsp queens-10.xmlXCSP files can be very big, so Tailor also supports .bz2 files as input. As an example, the following command would translate the compressed file `queens-10.xml.bz2' to Gecode. shell> java -jar tailor.jar -g -xcsp queens-10.xml.bz2Note, that on some XCSP instances TAILOR runs out of memory. This can be averted by increasing the memory of the Java virtual machine by the extended command shell> java -Xms128m -Xmx512m -jar tailor.jar -xcsp queens-50.xmlwhere the flag `-Xms128m' sets the initial size, `-Xmx512m' sets the maximum size of the memory allocation pool to 128MB/512MB. This setting should be sufficient to tailor large instances. 5. Tailoring to MinionTailor supports solver Minion, a fast constraint solver that takes a simple text file as input. Minion is a black-box solver, hence it is difficult to extend or alter, but easy to use. Minion takes problem instances as input, and does not supported parameterised problems, i.e. problem classes. Hence all parameter values need to be specified in order to produce a valid Minion input file. Tailor can generate Minion files in the command line version and the graphical user interface(GUI). The command line version is practical when tailoring many problem files (for instances for testing), while the GUI is practical for modelling or testing a model's performance. The graphical user interface is evoked by either double-clicking the file `tailor.jar' or typing the following into the command line: shell> java -jar tailor.jarHere is an example for the command line, where a problem model in the file `myProblem.eprime' is tailored to Minion: shell> java -jar tailor.jar myProblem.eprimeThis will generate the file myProblem.eprime.minion. You can specify the output file name with the command: shell> java -jar tailor.jar -out myProblem.minion myProblem.eprimewhich will write the Minion input into the file `myProblem.minion'. Tailor's graphical user interface allows to solve constraint models using Minion in 4 simple steps:
6. Tailoring to GecodeTailor can translate Essence' and XCSP format to solver Gecode, a powerful constraint toolkit. Please note that the translation is still restricted (for limitations see below). Gecode is a white-box solver, i.e. it is a C++ library that allows the user to easily alter and customise the library, which makes modelling more difficult. Note that the input language of Gecode (i.e. C++) is far more expressive than Essence'/XCSP. Therefore, Tailor is restricted to use the standard tools provided by Gecode, which a Gecode expert would probably customise to the given problem. Performing such `expert' alterations automatically is currently out of scope of automated modelling. This means that Tailor cannot replace a Gecode expert but give assistance, especially to novices with Gecode. Note that Tailor can tailor problem classes to Gecode, since problems are represented by C++ classes, where parameters can be specified at runtime. In general, it is better to tailor the whole class, instead of tailoring every instance since it saves tailoring time, and problem classes can be expressed more compactly than problem instances in C++. Getting started shell> java -jar tailor.jarHere is an example for the command line, where a problem model in the file `myProblem.eprime' is tailored to Gecode: shell> java -jar tailor.jar -g myProblem.eprimeThis will generate the file myProblem.eprime.cc. You can specify the output file name with the command: shell> java -jar tailor.jar -g -out myProblem.cpp myProblem.eprimewhich will write the C++ class into the file `myProblem.cpp'. To get started, have a look at our set of Essence' examples; an easy example would be the Langford Number Problem. Compiling generated Gecode files
Gecode Features used in the Translation
Limitations
|