diff --git a/.github/workflows/build-doc.yml b/.github/workflows/build-doc.yml index ffe540c906..dba5850bef 100644 --- a/.github/workflows/build-doc.yml +++ b/.github/workflows/build-doc.yml @@ -101,7 +101,6 @@ jobs: run: | yarn global add vuepress && yarn install export NODE_OPTIONS=--openssl-legacy-provider # avoid issue with node 18 and current dependencies (ok because no interaction with external network during the build) - export DO_SKIP_MZN_CHECK=1 # avoid having to install minizinc for discrete-optimization yarn docs:build touch docs/.vuepress/dist/.nojekyll - name: upload as artifact diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04207fef4a..09fc1dc6f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1027,7 +1027,6 @@ jobs: uses: ./.github/workflows/build-doc.yml with: notebooks-branch: ${{ needs.update-notebooks-for-colab-and-binder.outputs.notebooks-branch }} - doc-prerequisites-cmdline: export DO_SKIP_MZN_CHECK=1 deploy: needs: [ trigger, test-ubuntu, test-macos, test-windows ] diff --git a/docs/install.md b/docs/install.md index 52fd74510c..fc274a92e6 100644 --- a/docs/install.md +++ b/docs/install.md @@ -2,9 +2,12 @@ ## Prerequisites -### Minizinc 2.6+ +### Minizinc 2.8+ (Optional) -You need to install [minizinc](https://www.minizinc.org/) (version greater than 2.6) and update the `PATH` environment variable +If you plan to use the solver for scheduling domains `DOSolver` +that wraps [discrete-optimization](https://github.com/airbus/discrete-optimization) solvers, +keep in mind that some of them are based on [minizinc](https://www.minizinc.org/). +In that case, you may need to install minizinc binary (version greater than 2.8) and update the `PATH` environment variable so that it can be found by Python. See [minizinc documentation](https://www.minizinc.org/doc-latest/en/installation.html) for more details. ::: tip @@ -20,7 +23,7 @@ On a Linux distribution, you can use the bundled [minizinc AppImage](https://www If [FUSE](https://en.wikipedia.org/wiki/Filesystem_in_Userspace) is available: ``` mkdir minizinc_install -curl -o minizinc_install/minizinc -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.6.3/MiniZincIDE-2.6.3-x86_64.AppImage +curl -o minizinc_install/minizinc -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-x86_64.AppImage chmod +x minizinc_install/minizinc export PATH="$(pwd)/minizinc_install/":$PATH minizinc --version @@ -29,7 +32,7 @@ Else, this is still possible by extracting the files: ``` mkdir minizinc_install cd minizinc_install -curl -o minizinc.AppImage -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.6.3/MiniZincIDE-2.6.3-x86_64.AppImage +curl -o minizinc.AppImage -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-x86_64.AppImage chmod +x minizinc.AppImage ./minizinc.AppImage --appimage-extract cd .. @@ -41,7 +44,7 @@ minizinc --version #### MacOs command line ``` mkdir minizinc_install -curl -o minizinc.dmg -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.6.3/MiniZincIDE-2.6.3-bundled.dmg +curl -o minizinc.dmg -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-bundled.dmg hdiutil attach minizinc.dmg cp -R /Volumes/MiniZinc*/MiniZincIDE.app minizinc_install/. export PATH="$(pwd)/minizinc_install/MiniZincIDE.app/Contents/Resources":$PATH @@ -52,26 +55,12 @@ minizinc --version Works on Windows Server 2022 with bash shell: ``` mkdir minizinc_install -curl -o minizinc_setup.exe -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.6.3/MiniZincIDE-2.6.3-bundled-setup-win64.exe +curl -o minizinc_setup.exe -L https://github.com/MiniZinc/MiniZincIDE/releases/download/2.8.5/MiniZincIDE-2.8.5-bundled-setup-win64.exe cmd //c "minizinc_setup.exe /verysilent /currentuser /norestart /suppressmsgboxes /sp" export PATH="~/AppData/Local/Programs/MiniZinc":$PATH minizinc --version ``` -#### Skipping minizinc version check - -It may happen that you do not want to install minzinc. -For instance if you need to use only a part of the library which is not relying on minizinc at all, -especially when not relying on discrete-optimization which is the actual library depending on minizinc. - -This can be troublesome as the minizinc binary version is checked by [discrete-optimization](https://airbus.github.io/discrete-optimization) at library import. -However discrete-optimization provides a way to bypass this check -by setting the environment variable DO_SKIP_MZN_CHECK: -```shell -export DO_SKIP_MZN_CHECK=1 -``` -Please note however that the library is never tested without minizinc (or minizinc versions < 2.6). - ### Python 3.8+ environment diff --git a/notebooks/13_scheduling_tuto.ipynb b/notebooks/13_scheduling_tuto.ipynb index bf1ebc4414..9bc50486d6 100644 --- a/notebooks/13_scheduling_tuto.ipynb +++ b/notebooks/13_scheduling_tuto.ipynb @@ -700,8 +700,6 @@ "metadata": {}, "outputs": [], "source": [ - "from discrete_optimization.generic_tools.cp_tools import ParametersCP\n", - "\n", "from skdecide.hub.solver.do_solver.do_solver_scheduling import DOSolver, SolvingMethod\n", "from skdecide.hub.solver.do_solver.sgs_policies import (\n", " BasePolicyMethod,\n", @@ -716,10 +714,6 @@ "outputs": [], "source": [ "logging.info(\"Solving with CP\")\n", - "dict_params = {}\n", - "params_cp = ParametersCP.default()\n", - "params_cp.TimeLimit = 300\n", - "dict_params[\"parameters_cp\"] = params_cp\n", "policy_method_params = PolicyMethodParams(\n", " base_policy_method=BasePolicyMethod.FOLLOW_GANTT,\n", " delta_index_freedom=0,\n", @@ -934,10 +928,8 @@ "method = SolvingMethod.CP\n", "# Let's define the parameters for our CP solver\n", "dict_params = {}\n", - "params_cp = ParametersCP.default()\n", - "# Let's change the 30 seconds default to something bigger\n", - "params_cp.time_limit = 300\n", - "dict_params[\"parameters_cp\"] = params_cp\n", + "# Let's change the default 30 seconds time limit to something bigger\n", + "dict_params[\"time_limit\"] = 300\n", "# Let's create our solver with the given feature\n", "solver = DOSolver(\n", " domain_factory=lambda: big_domain,\n", @@ -984,12 +976,8 @@ "\n", "dict_params = {}\n", "\n", - "# We will use the default TimeLimit value for the internal CP solver\n", - "# This value is 30 seconds\n", - "params_cp = ParametersCP.default()\n", - "params_cp.time_limit = 30\n", - "\n", - "dict_params[\"parameters_cp\"] = params_cp\n", + "# We will use 30 seconds as time limit for the internal CP solver\n", + "dict_params[\"time_limit_subsolver\"] = 30\n", "dict_params[\"nb_iteration_lns\"] = 30\n", "dict_params[\"verbose\"] = False\n", "dict_params[\"callbacks\"] = [TimerStopper(total_seconds=300)]\n", diff --git a/pyproject.toml b/pyproject.toml index 7a44bbbb9b..696d31b211 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ matplotlib = { version = ">=3.3.4", optional = true } joblib = { version = ">=1.0.1", optional = true } stable-baselines3 = { version = ">=2.0.0", optional = true } ray = { extras = ["rllib"], version = ">=2.9.0", optional = true } -discrete-optimization = { version = ">=0.3.2", optional = true } +discrete-optimization = { version = ">=0.4.0" } openap = { version = ">=1.5", python = ">=3.9", optional = true } pygeodesy = { version = ">=23.6.12", optional = true } unified-planning = { version = ">=1.1.0", python = ">=3.10", optional = true } @@ -79,7 +79,6 @@ domains = [ "gymnasium", "numpy", "matplotlib", - "discrete-optimization", "openap", "pygeodesy", "unified-planning", @@ -93,7 +92,6 @@ solvers = [ "joblib", "ray", "stable-baselines3", - "discrete-optimization", "unified-planning", "up-tamer", "up-fast-downward", @@ -108,7 +106,6 @@ all = [ "joblib", "ray", "stable-baselines3", - "discrete-optimization", "openap", "pygeodesy", "unified-planning",