Giter Site home page Giter Site logo

Comments (5)

cyderize avatar cyderize commented on August 11, 2024

As a workaround until this is fixed, you can pass the funcs array as an argument to your dog function:

function var bool:dog(array[int] of var func: fns, int:t) =
(funcs:dog,input:t) in fns;

var int:d1 = dog(funcs, 1);

from libminizinc.

jarble avatar jarble commented on August 11, 2024

@cyderize and @guidotack This error still appears in the MiniZinc playground. Has it not been updated to the latest version?

from libminizinc.

Dekker1 avatar Dekker1 commented on August 11, 2024

The problem is resolved when you select the “edge” version of MiniZinc in the playground. The fix has not been included in any release yet, so the “latest” version does not yet include the fix.

from libminizinc.

jarble avatar jarble commented on August 11, 2024

@Dekker1 Now a different error appears when running this model using the COIN-BC solver:

MiniZinc: flattening error: variable X_INTRODUCED_19_ needs finite bounds for linearisation. Or, use indicator constraints. Current domain is [[ [ -inf, 0 ] [ 1, 1 ] [ 2, inf ] ]]

Is this another compiler bug?

from libminizinc.

cyderize avatar cyderize commented on August 11, 2024

I think this is just a limitation of how linearisation works for MIP solvers like CBC.

Without any bounds for the input field of the record, it's not possible to turn (funcs:dog,input:t) in funcs into an integer variable which the solver can handle.

You can add bounds with

type func = record(functions:funcs,-10..10: input);

which will fix the problem.

from libminizinc.

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.