Comments (3)
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.
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.
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)
- Segfault using Table constraint HOT 6
- Support Gurobi Compute Server running in the cloud HOT 1
- Issues with .Mul operator for constraints. HOT 15
- New puzzle examples ready. HOT 1
- Get only the first solution HOT 4
- Confused why solutions do not satisfy constraints... HOT 1
- setup.py is always searching for CPLEX
- Setup fails to find xml2-config on Windows HOT 1
- If statement with constraint HOT 2
- Installation issue HOT 1
- discussion group HOT 1
- AttributeError: 'Element' object has no attribute 'domain_ while trying to add Predicate Sum HOT 1
- Deprecated built-in function __getslice__ in python 3.7 to get a slice from a list
- The docs link is dead :(
- Can't use gurobi on Debian 9 (undefined symbol)
- KeyError: 'f'
- ImportError: No module named '_Mistral' HOT 2
- AttributeError: 'float' object has no attribute 'lb'_
- Solvers not available
- arm64 support? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from numberjack.