Code Monkey home page Code Monkey logo

Comments (3)

diligence-dev avatar diligence-dev commented on July 20, 2024 1

I found a workaround:

  • "wood": {"max": "storage"}, means wood <= storage or wood - storage <= 0
  • add a new constraint "wood - storage": {"max": "0"},
  • change the variables: "wood": {"wood - storage": 1} and "storage": {"wood - storage": -1}
    Same thing can be done for the other constraint, add "labor + storage": 1 to the labor and the storage variable.

from jslpsolver.

diligence-dev avatar diligence-dev commented on July 20, 2024

Would also be interested in this. https://github.com/njoubert/csp.js seems to support this with functions, but it does not run in the browser.

from jslpsolver.

apolinario avatar apolinario commented on July 20, 2024

I have the same issue. I have this lp file format array:

var model = [
          "max: x00 + x01 + x10 + x11",
          "x10 + x11 = 1.00 x00 + 1.00 x01 + 1.00 x10 + 1.00 x11",
          "x01 + x11 = 0.15 x00 + 0.15 x01 + 0.15 x10 + 0.15 x11",
          "x01 + x00 = 0.00 x00 + 0.00 x01 + 0.00 x10 + 0.00 x11",
          "x10 + x00 = 0.85 x00 + 0.85 x01 + 0.85 x10 + 0.85 x11",
          "x00 <= 60",
          "x01 <= 30",
          "x10 <= 100",
          "x11 <= 50",
];

And can't get it to work on jsLPSolver. If I use the solver.ReformatLP() function, I believe it is a bug because it thinks my value is 11 (probably because of this last variable x11). I also tried scaling everything up by multiplying by 100 without results

I also didn't find a way to natively create this array from scratch

from jslpsolver.

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.