Comments (6)
You can also add a fn set_parameter(key: &str, value: &str)
without any invariant breaking.
from good_lp.
I would prefer having direct access to the parameter here. I feel like wiring this up to log
is be not a good idea:
log
provides a mechanism for libraries and applications to write log messages and an implementation of a filtering mechanism to only show some of those messages. Especially, behindlog
you'll always need a backend which actually takes care of logging the generated messages somewhere and initializing the filters. CBC doesn't care about all this and just writes its messages to stdout directly. So it wouldn't really tie into thelog
ecosystem at all. The only "connection" which could be made is by askinglog
of the (default!) log-level and setting something similar in CBC.- The log-levels from
log
don't really map to the verbosity levels from CBC well, I think. So it would be confusing for downstream users to understand what log-level fromlog
corresponds to which setting from CBC. - There might also be a mismatch between what the user wants to see logged from the application and what they want to see logged from CBC. To some degree, applications might want to control this, too. You could use a magic module name for setting the CBC log-level but that feels like a hack to me.
In the end I think this wouldn't gain us much and just make the original task I wanted to accomplish more complicated. I think what I wanted to do is what most people will care about: silencing CBC to keep the console free for actually interesting messages.
We don't want people changing the solver parameters, and for instance removing variables from under our feet, do we ?
That's why I would suggest making the access to the CBC model "unsafe":
unsafe fn as_inner_mut(&mut self) -> &mut Model {
// ...
}
This way people can't possibly destroy invariants assumed by good_lp
without unsafe code.
In parallel to adding the above (which is probably useful beyond this issue alone), for logging in particular, maybe adding another method specifically to set the verbosity might be a good idea? It would certainly help people searching through good_lp
documentation for terms like "log" or "verbosity" to find what they need... For example:
fn set_solver_verbosity(&mut self, v: &str) {
// ...
}
from good_lp.
I think a good solution would be to depend on the almost universal log crate, and set the cbc verbosity based on the standard rust log level. What do you think ?
from good_lp.
I think exposing parameters is a good idea: there is log, bit also solver tunning available.
The log crate has a complicated syntax, and levels that doesn't really match with coin.
from good_lp.
We don't want people changing the solver parameters, and for instance removing variables from under our feet, do we ?
How is the log crate syntax complicated?
from good_lp.
I would like to add that we are experiencing the same problems in the highs solver. Any way of changing the verbosity would be extremely appreciated. I think being able to set the options on the models themselves would be extremely useful.
from good_lp.
Related Issues (20)
- `From<Expression> not implemented for f64` HOT 4
- `mul` with a float doesn't seem to to the right thing for binary variables HOT 1
- How can I set model/solver options, especially for HiGHS ? HOT 1
- Add Gurobi Support HOT 3
- really need an example that had these properties HOT 2
- Does good_lp work on Windows with CBC? [It does] HOT 7
- Making CoinCbcProblem cloneable...
- Add support for Clarabel.rs HOT 2
- Small documentation error HOT 3
- HiGHS does depend on additional libs HOT 2
- Suppressing Cbc command line output HOT 1
- cannot multiply `usize` by `good_lp::Variable` in constraint on integer variable HOT 5
- Add const to determine at compile-time what default_solver resolves to HOT 1
- Add support for Windows HOT 1
- External solver failing due to LP file format HOT 5
- Compilation failing HOT 2
- Typos in repo description HOT 4
- Feature request: SOS1 constraint support for cplex-rs HOT 1
- [Q/A] using HiGHs LP solver HOT 2
- Accessing variable names after a solution has been created
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 good_lp.