Giter Site home page Giter Site logo

Comments (4)

paolodragone avatar paolodragone commented on June 8, 2024

Hi!
Unfortunately I still haven't had the time to add support for the features of the newer versions of MiniZinc, the last one supported is the 2.1.7. I expect to be able to work my way through the new features by February. In the mean time, I suppose you could "cheat" your way around it by setting this option via the configuration of the path to the mzn2fzn binary:

import pymzn
pymzn.config.set('mzn2fzn', 'mzn2fzn -O5')

It should work, though I haven't tested it. Let me know if it works. I'll keep the issue open as a reminder.
Cheers!

from pymzn.

ladm2110 avatar ladm2110 commented on June 8, 2024

Hello, I tried the way you proposed but it raises the following exception:
FileNotFoundError: [Errno 2] No such file or directory: 'mzn2fzn -O5': 'mzn2fzn -O5'

I found that if you add the line:
args += ['-O5']
inside the mzn2fzn method, I can accomplish that, but it feels wrong.

from pymzn.

paolodragone avatar paolodragone commented on June 8, 2024

Yeah, sorry about that. OK, maybe another workaround (that I actually tested this time) would be:

import pymzn
pymzn.minizinc('your_file.mzn', '-O5')

Basically, you are pretending that '-O5' is a dzn file. In theory the function minizinc function expects only dzn files as additional positional arguments, but it basically gets anything really.
This is a bug, not a feature! :) As soon as I release the new version, that won't probably work anymore.
I'll also add some mechanism to ensure that if I miss some command line option or new ones get added to minizinc they will be easy to add without modifying the code.
Cheers!

from pymzn.

paolodragone avatar paolodragone commented on June 8, 2024

Fixed in 0.18.1.

from pymzn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.