Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <callback.h>
Public Member Functions | |
absl::Status | CheckModelStorage (const ModelStorage *expected_storage) const |
CallbackRegistrationProto | Proto () const |
Public Attributes | |
absl::flat_hash_set< CallbackEvent > | events |
MapFilter< Variable > | mip_solution_filter |
MapFilter< Variable > | mip_node_filter |
bool | add_cuts = false |
bool | add_lazy_constraints = false |
Provided with a callback at the start of a Solve() to inform the solver:
Definition at line 144 of file callback.h.
absl::Status operations_research::math_opt::CallbackRegistration::CheckModelStorage | ( | const ModelStorage * | expected_storage | ) | const |
Returns a failure if the referenced variables don't belong to the input expected_storage (which must not be nullptr).
Definition at line 92 of file callback.cc.
CallbackRegistrationProto operations_research::math_opt::CallbackRegistration::Proto | ( | ) | const |
Returns the proto equivalent of this object.
The caller should use CheckModelStorage() as this function does not check internal consistency of the referenced variables.
Definition at line 101 of file callback.cc.
bool operations_research::math_opt::CallbackRegistration::add_cuts = false |
If the callback will ever add "user cuts" at event CallbackEvent::kMipNode during the solve process (a linear constraint that excludes the current LP solution but does not cut off any integer points).
Definition at line 175 of file callback.h.
bool operations_research::math_opt::CallbackRegistration::add_lazy_constraints = false |
If the callback will ever add "lazy constraints" at event CallbackEvent::kMipNode or CallbackEvent::kMipSolution during the solve process (a linear constraint that excludes integer points).
Definition at line 180 of file callback.h.
absl::flat_hash_set<CallbackEvent> operations_research::math_opt::CallbackRegistration::events |
The events the solver should invoke the callback at.
When a solver is called with registered events that are not supported, an InvalidArgument is returned. The supported events may depend on the model. For example registering for CallbackEvent::kMip with a model that only contains continuous variables will fail for most solvers. See the documentation of each event to see their supported solvers/model types.
Definition at line 162 of file callback.h.
Restricts the variable returned in CallbackData.solution for event CallbackEvent::kMipNode. This can improve performance.
Definition at line 170 of file callback.h.
Restricts the variable returned in CallbackData.solution for event CallbackEvent::kMipSolution. This can improve performance.
Definition at line 166 of file callback.h.