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.
First, You need to download and build libminizinc (2.5.2) library for MiniZinc to work properly. Please follow these steps:
Linux:
sudo git clone https://github.com/MiniZinc/libminizinc.gitcd libminizinc/sudo sed -i '3 i set(CMAKE_POSITION_INDEPENDENT_CODE ON)' CMakeLists.txtsudo cmake CMakeLists.txtsudo makesudo make install
Similarly, build libminizinc on Windows and OSX.
Now download the solver binaries from the binary bundles at (https://www.minizinc.org/) to be able to solve the models and achieve full functionality of the package.
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.
- Parse a MiniZinc model and get the details as a named list in R.
- Find the model parameters which have not been assigned a value yet.
- Set the values of unassigned parameters. (Scope needs to be extended)
- Solve a model and get parsed solutions as a named list in R.
- Create your own MiniZinc model in R using the R6 classes from MiniZinc API mirror (Note that the API mirror only includes the relevant functionalities to serialize various objects to MiniZinc along with some checks).
- Use the setter and getter functions of R6 classes to manipulate a model.
- Use the named list returned after parsing to initialize all the relevant objects in R, manipulate the model and serialize back to MiniZinc.
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.
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.