question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with Model.intGeView()

See original GitHub issue

In our non public Choco model we have code on the form:

final IntVar[] xs = model.intVarArray(10, 0, 9);
final BoolVar[] bs = Stream.of(xs).map(x -> model.intGeView(x, 1)).toArray(BoolVar[]::new);

final IntVar count = model.intVar(0, 10);
model.sum(bs, "=", count).post();

Our model produced wrong solutions, and after debugging we found out that:

  • The domain size of all bs are 10, and not 2 that we had expected. It seems the domain size of the underlying IntVar is used.

  • Replacing (only) the code model.intGeView(x, 1) above by model.arithm(x, ">", 0).reify() makes our model produce correct solutions. In addition the domain size of all bs are then 2, as expected.

  • During debugging (and still using intGeView()), we replaced model.sum(bs, "=", count).post(); by model.sum(bs, "<=", count).post(); model.sum(bs, ">=", count).post();. This made the solver (from producing a solution within seconds) not producing any solution within reasonable time.

I apologise that this report does not contain a reproducing example of the bug that produce wrong solutions, but hope that it is still useful.

Choco version: 4.10.0 Java version: 11.0.1 Operating system: Linux Kernel 5.0.2

Best regards,

Magnus

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
cprudhomcommented, Apr 2, 2019

I fix the issue (thank you for reporting it). This was related to a missing method implementation in views.

This should work now (you can try the snapshot version, or wait for a release).

Best, CP

0reactions
cprudhomcommented, Nov 13, 2019

Only eq and leq views were affected by the problem. The other ones (scale, offset, minus and not) act in a different way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Top 24 Data Modelling Interview Questions with Detailed ...
Here I am going to share some Data Modeling interview questions and detailed answers based on my own experience during interview interactions in ......
Read more >
Predictive Modeling Interview Questions and Answers
Let's start with a list of some basic and tricky predictive modeling interview questions with answers. 1. What are the essential steps in...
Read more >
40 Model Interview Questions (With Example Answers) - Indeed
General model interview questions · Can you tell us a little about yourself? · What is your greatest strength as a professional? ·...
Read more >
10 Essential Data Modeling Interview Questions - Toptal
Comprehensive, community-driven list of essential Data Modeling interview questions ... Please discuss the issues/disadvantages with this dimensional model:.
Read more >
Watch Me Solve a REPE Technical Interview Modeling Test
If you're preparing for a real estate technical interview, watch me ... Error Check formula was inadvertently written with ROUNDUP() instead ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found