Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <constraint_solveri.h>
Classes | |
struct | FilterEvent |
Public Types | |
enum | FilterEventType { kAccept , kRelax } |
Public Member Functions | |
std::string | DebugString () const override |
LocalSearchFilterManager (std::vector< FilterEvent > filter_events) | |
LocalSearchFilterManager (std::vector< LocalSearchFilter * > filters) | |
void | Revert () |
Calls Revert() of filters, in reverse order of Relax events. | |
bool | Accept (LocalSearchMonitor *monitor, const Assignment *delta, const Assignment *deltadelta, int64_t objective_min, int64_t objective_max) |
void | Synchronize (const Assignment *assignment, const Assignment *delta) |
Synchronizes all filters to assignment. | |
int64_t | GetSynchronizedObjectiveValue () const |
int64_t | GetAcceptedObjectiveValue () const |
Public Member Functions inherited from operations_research::BaseObject | |
BaseObject () | |
BaseObject (const BaseObject &)=delete | |
This type is neither copyable nor movable. | |
BaseObject & | operator= (const BaseObject &)=delete |
virtual | ~BaseObject () |
Filter manager: when a move is made, filters are executed to decide whether the solution is feasible and compute parts of the new cost. This class schedules filter execution and composes costs as a sum.
Definition at line 2115 of file constraint_solveri.h.
This class is responsible for calling filters methods in a correct order. For now, an order is specified explicitly by the user.
Enumerator | |
---|---|
kAccept | |
kRelax |
Definition at line 2119 of file constraint_solveri.h.
|
explicit |
Builds a manager that calls filter methods ordered by increasing priority.
Definition at line 4634 of file local_search.cc.
|
explicit |
Builds a manager that calls filter methods using the following ordering: first Relax() in vector order, then Accept() in vector order.
Definition at line 4619 of file local_search.cc.
bool operations_research::LocalSearchFilterManager::Accept | ( | LocalSearchMonitor * | monitor, |
const Assignment * | delta, | ||
const Assignment * | deltadelta, | ||
int64_t | objective_min, | ||
int64_t | objective_max ) |
Returns true iff all filters return true, and the sum of their accepted objectives is between objective_min and objective_max. The monitor has its Begin/EndFiltering events triggered.
Bump up rejected event, together with its kRelax event, unless it is already first in its priority layer.
Definition at line 4659 of file local_search.cc.
|
inlineoverridevirtual |
Reimplemented from operations_research::BaseObject.
Definition at line 2126 of file constraint_solveri.h.
|
inline |
Definition at line 2148 of file constraint_solveri.h.
|
inline |
Definition at line 2147 of file constraint_solveri.h.
void operations_research::LocalSearchFilterManager::Revert | ( | ) |
Calls Revert() of filters, in reverse order of Relax events.
Filters' Revert() must be called in the reverse order in which their Relax() was called.
Definition at line 4648 of file local_search.cc.
void operations_research::LocalSearchFilterManager::Synchronize | ( | const Assignment * | assignment, |
const Assignment * | delta ) |
Synchronizes all filters to assignment.
If delta is nullptr or empty, then assignment may be a partial solution. Send a signal to Relaxing filters to inform them, so they can show the partial solution as a change from the empty solution.
Relax in the forward direction.
Synchronize/Commit backwards, so filters can read changes from their dependencies before those are synchronized/committed.
Definition at line 4715 of file local_search.cc.