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.

[request] [choco4] add findOptimal in Model.

See original GitHub issue

I understand that using this function with modification of the model may lead to bad behaviour, however this is a simple use case that should IMO be of very simple use. I fear people (including me 😦 ) will need to rewrite this small part of code on several places otherwise.

add (…keep) a method in Model :

public Solution findOptimum(IntVar objective, boolean maximize){
  setObjective(maximize?ResolutionPolicy.MAXIMIZE:ResolutionPolicy.MINIMIZE, objective);
  Solution s = new Solution(this);
  while (solve()) {
    s.record();
  }
  return getSolver().isFeasible() == ESat.TRUE ? s : null;
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
cprudhomcommented, Apr 22, 2016

What about adding a resolution helper ? The resolution processes will still be disconnected from the model (solver) but the code will not be lost. That may also ease capitalizing on tricky resolution process.

poll: 👍 / 👎

0reactions
jgFagescommented, May 5, 2016

Shouldn’t the ResolutionHelper be in Solver rather than Model?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solving — Choco-4.10.2 user guide
To solve it, we need to use the Solver object that is obtained from the model as follows: Solver solver = model.getSolver();.
Read more >
java.lang.Object org.chocosolver.solver.Model - javadoc.io
Returns the unique constraint embedding a minisat model. A call to this method will create and post the constraint if it does not...
Read more >
Rule Solver - OpenRules Decision Manager
Simple Decision Model “DecisionHello”. In this example we will develop a simple application that should decide how to.
Read more >
Performing a Test Cut / How to Find Optimal Settings
When performing a test cut, you will first need to position the blade over your material using the arrows (1), and then press...
Read more >
Lauching the resolution process | Choco-solver
A call to solver.solve() launches a resolution which stops on the first ... it can be seen as solving multiple times the model...
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