[request] [choco4] add findOptimal in Model.
See original GitHub issueI 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:
- Created 7 years ago
- Comments:12 (12 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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: 👍 / 👎
Shouldn’t the ResolutionHelper be in Solver rather than Model?