maximum_seconds returns weird results
Closed this issue · 2 comments
mtanneau commented
Clp returns weird results when querying the time limit after it has been set.
The code below
import Clp
m = Clp.ClpModel()
@show Clp.maximum_seconds(m) # returns -1.0
Clp.set_maximum_seconds(m, 1.0)
@show Clp.maximum_seconds(m) # returns a (seemingly) random value
Clp.set_maximum_seconds(m, 0.0)
@show Clp.maximum_seconds(m) # returns a (seemingly) random value
returns seemingly random values after the time limit is set.
Might there be a bug on the C interface's side?
odow commented
The issue is that when setting, Clp adds a +CoinCpuTime()
offset:
https://github.com/coin-or/Clp/blob/29a3d29d94f102e9029eb4be72cde2bfd378d752/Clp/src/ClpModel.cpp#L2793
but it doesn't subtract this when returning.
https://github.com/coin-or/Clp/blob/633bcb884303806a0b083834f702c597f44c01a9/src/ClpModel.hpp#L406
You could open an upstream issue?
mtanneau commented
You could open an upstream issue?
Done. coin-or/Clp#141