Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Shared set of local search states that we work on. More...
#include <feasibility_jump.h>
Public Member Functions | |
SharedLsStates (absl::string_view name, const SatParameters ¶ms, SharedStatTables *stat_tables) | |
~SharedLsStates () | |
void | CreateNewState () |
LsState * | GetNextState () |
void | Release (LsState *state) |
void | ResetLubyCounter () |
void | ConfigureNextLubyRestart (LsState *state) |
void | CollectStatistics (const LsState &state) |
Accumulate in the relevant bucket the counters of the given states. | |
Shared set of local search states that we work on.
Definition at line 350 of file feasibility_jump.h.
|
inline |
Important: max_parallelism should be greater or equal than the actual number of thread sharing this class, otherwise the code will break.
We always start with at least 8 states. We will create more if there are more parallel workers as needed.
Definition at line 354 of file feasibility_jump.h.
operations_research::sat::SharedLsStates::~SharedLsStates | ( | ) |
Do a final collection.
Display aggregated states
Definition at line 102 of file feasibility_jump.cc.
|
inline |
Accumulate in the relevant bucket the counters of the given states.
Definition at line 432 of file feasibility_jump.h.
|
inline |
We share a global running Luby sequence for all the "restart" state.
Hack: options.use_restart is constant, so we are free to inspect it. Also if options.use_restart, then num_batches_before_change is only modified under lock, so this code should be thread safe.
Definition at line 423 of file feasibility_jump.h.
|
inline |
We add one no-restart per 16 states and put it last.
Definition at line 364 of file feasibility_jump.h.
|
inline |
Returns the next available state in round-robin fashion. This is thread safe. If we respect the max_parallelism guarantee, then all states should be independent.
We need more parallelism and create a new state.
Definition at line 377 of file feasibility_jump.h.
|
inline |
Definition at line 402 of file feasibility_jump.h.
|
inline |
Definition at line 412 of file feasibility_jump.h.