rminizinc is aimed towards providing the R users an interface to MiniZinc. Various functionalities are providing for users that are comfortable with MiniZinc and use some results in their analysis in R and for users that are less confident in MiniZinc and want to create MiniZinc models and obtain results using R. The package vignette contains a basic demonstration of all the features of the package and explains how to interpret the results.
NOTE: This package is compatible with MiniZinc 2.5.5.
1) Build libminizinc
First, You need to download the libminizinc 2.5.5 release and build libminizinc library for MiniZinc to work properly.
Please follow these steps for Linux:
libminizinc
.cd libminizinc/
sudo sed -i '3 i set(CMAKE_POSITION_INDEPENDENT_CODE ON)' CMakeLists.txt
sudo cmake CMakeLists.txt
sudo make
sudo make install
Similarly, build libminizinc on Windows (can use cygwin) and OSX.
If sed
command doesn't work for you, just add set(CMAKE_POSITION_INDEPENDENT_CODE ON)
in the 3rd line (or any empty line in the starting) of CMakeLists.txt and follow the next steps.
2) Get Solver Binaries
Solvers are required to solve the MiniZinc models. The solvers currently supported by rminizinc are Chuffed, FindMUS and Gecode. Any solver can be selected based on the type of problem that is required to be solved.
Now download the solver binaries to be able to solve the models and achieve full functionality of the package.
To get the solver binaries, the Users can download the MiniZinc binary bundles for Windows, MAC OS or Linux from https://www.minizinc.org/software.html and the provide the path to the bin folder of the MiniZinc bundle folder as the --with-bin
argument. All the required solver binaries are present in that folder. The solver binary corresponding to Gecode will be fzn-gecode
, FindMUS will be findMUS
, Chuffed will be fzn-chuffed
(.exe extentions will be there on Windows for eg. fzn-gecode.exe
). ALternatively, if you don't want to keep the MiniZinc bundle, you can copy the solver binaries to another folder and just provide the path to that folder with --with-bin
.
Once these steps are over, you just need to re-install rminizinc by using
install.packages("rminizinc", configure.args="--with-mzn=/path/to/libminizinc --with-bin=/path/to/bin")
NOTE: Please don't use \
at the end of the path given to --with-bin
as it will cause some solver configuration issues.
Please note that if path arguments are not passed along with the installation (as --with-mzn
), the default path /usr/local/lib
for Linux and OSX, and C:/Program Files/
for Windows will be chosen but only if libminizinc in present in these default paths.
The features have been tested over a wide variety of problems but doesn't cover MiniZinc in its entirety. Please feel free to open an issue or submit a PR if you find any problems in the package. Any help towards making the installation easier is highly appreciated.
Under Development: Please note that the project is in it's early development stage and all the features haven't been tested for all of MiniZinc.
Thanks to my mentor Lars Kotthoff and co-mentors, Hans W Borchers and Guido Tack who helped me make key decisions for the project, and Jip Dekker for solving my queries regarding libminizinc.
I would like to thank all the developers of libminizinc for allowing me to use the library in my package and for providing help in understanding the usage of the library and MiniZinc.
Special thanks to Uwe Ligges ligges@statistik.tu-dortmund.de Dirk Eddelbuettel edd@debian.org Nik Pocuca nikpocuca@gmail.com Allan Cameron Duncan Murdoch murdoch.duncan@gmail.com and many other people who helped me on mailing lists as well as other platforms like StackOverflow.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.