Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::SharedLsStates Class Reference

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 &params, SharedStatTables *stat_tables)
 
 ~SharedLsStates ()
 
void CreateNewState ()
 
LsStateGetNextState ()
 
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.
 

Detailed Description

Shared set of local search states that we work on.

Definition at line 350 of file feasibility_jump.h.

Constructor & Destructor Documentation

◆ SharedLsStates()

operations_research::sat::SharedLsStates::SharedLsStates ( absl::string_view name,
const SatParameters & params,
SharedStatTables * stat_tables )
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.

◆ ~SharedLsStates()

operations_research::sat::SharedLsStates::~SharedLsStates ( )

Do a final collection.

Display aggregated states

Definition at line 102 of file feasibility_jump.cc.

Member Function Documentation

◆ CollectStatistics()

void operations_research::sat::SharedLsStates::CollectStatistics ( const LsState & state)
inline

Accumulate in the relevant bucket the counters of the given states.

Definition at line 432 of file feasibility_jump.h.

◆ ConfigureNextLubyRestart()

void operations_research::sat::SharedLsStates::ConfigureNextLubyRestart ( LsState * state)
inline

We share a global running Luby sequence for all the "restart" state.

Note
we randomize the parameters on each restart.

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.

◆ CreateNewState()

void operations_research::sat::SharedLsStates::CreateNewState ( )
inline

We add one no-restart per 16 states and put it last.

Definition at line 364 of file feasibility_jump.h.

◆ GetNextState()

LsState * operations_research::sat::SharedLsStates::GetNextState ( )
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.

◆ Release()

void operations_research::sat::SharedLsStates::Release ( LsState * state)
inline

Definition at line 402 of file feasibility_jump.h.

◆ ResetLubyCounter()

void operations_research::sat::SharedLsStates::ResetLubyCounter ( )
inline

Definition at line 412 of file feasibility_jump.h.


The documentation for this class was generated from the following files: