Skip to content

acharaakshit/RMiniZinc

Repository files navigation

MINIZINC INTERFACE FOR R

Build Status

TABLE OF CONTENTS

INTRODUCTION

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.

INSTALLATION

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

FEATURES

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

SCOPE OF FEATURES

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.

PROJECT STATUS

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.

ACKNOWLEDGMENT

About

R Interface to MiniZinc

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors