GithubHelp home page GithubHelp logo

Comments (3)

ehebrard avatar ehebrard commented on August 10, 2024

Can you please send us a full example? I do not observe the same behavior.

And (Barry, please correct me if I'm wrong) the first method should be
something like:
for _ in solver.solutions():

On Thu, Dec 17, 2015 at 8:51 PM, Brian McMahan [email protected]
wrote:

Hello!

I am trying to use Numberjack to solve a CSP problem.

I have the model built and I am trying two different ways of solving (as
illustrated in your examples). All of my variables are binary.

Method1:
solver = model.load("Mistral")
solver.solve()
while solver.solutions():

reference variables to get solutions

solutions = [val for sym,val in sym_dict.items() if sym.get_value()!=0]

Method2
solver = model.load("Mistral")
solver.startNewSearch()
while solver.getNextSolution() == Numberjack.SAT:

reference variables to get solutions

solutions = [val for sym,val in sym_dict.items() if sym.get_value()!=0]

The second method will terminate immediately for me. The first method
works. Why is this?

All the best,
Brian


Reply to this email directly or view it on GitHub
#29.

-Emmanuel

from numberjack.

braingineer avatar braingineer commented on August 10, 2024

Hi!

Thanks for the response.

You are correct on the for loop. Not fully sure what I was thinking there.

I'm trying to recreate with what I thought was the reason the issue was happening, but other small bugs are now presenting themselves. I'll ping back either when I have a minimum working example or determine that I've made a mistake in this question =)

Best,
Brian

from numberjack.

braingineer avatar braingineer commented on August 10, 2024

Hi, I think that this was my mistake in how I formulated the code. Things are working now as expected (modulo a loophole in the constraints I've set up). Thanks again.

from numberjack.

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.