Error thrown from optimizer when MOI.get(optimizer, attr)
is called inside an
AbstractCallback
while it is only defined once optimize!
has
completed. This can only happen when is_set_by_optimize(attr)
is true
.
Abstract type for a model attribute representing a callback function. The
value set to subtypes of AbstractCallback
is a function that may be called
during optimize!
. As optimize!
is in progress, the result
attributes (i.e, the attributes attr
such that is_set_by_optimize(attr)
)
may not be accessible from the callback, hence trying to get result attributes
might throw a OptimizeInProgress
error.
简单来说这个报错就是在optimize!
过程中,不可以获取参数值get attr,一般出现在callback中
因此在callback中,获取参数值,有专门的方法callback.value(x,cb)
,这样就不会报错