14#ifndef OR_TOOLS_SAT_RESTART_H_
15#define OR_TOOLS_SAT_RESTART_H_
20#include "absl/log/check.h"
24#include "ortools/sat/sat_parameters.pb.h"
35 : parameters_(*(
model->GetOrCreate<SatParameters>())),
51 void OnConflict(
int conflict_trail_index,
int conflict_decision_level,
65 const SatParameters& parameters_;
69 int conflicts_until_next_strategy_change_;
70 int strategy_change_conflicts_;
72 int strategy_counter_;
73 std::vector<SatParameters::RestartAlgorithm> strategies_;
76 int conflicts_until_next_restart_;
95 const int most_significant_bit_position =
97 if ((1 << most_significant_bit_position) ==
i + 1) {
98 return 1 << (most_significant_bit_position - 1);
100 i -= (1 << most_significant_bit_position) - 1;
double GlobalAverage() const
Contain the logic to decide when to restart a SAT tree search.
int NumRestarts() const
Returns the number of restarts since the last Reset().
void Reset()
Resets the policy using the current model parameters.
std::string InfoString() const
Returns a string with the current restart statistics.
double LbdAverageSinceReset() const
RestartPolicy(Model *model)
void OnConflict(int conflict_trail_index, int conflict_decision_level, int conflict_lbd)
In SWIG mode, we don't want anything besides these top-level includes.
int MostSignificantBitPosition64(uint64_t n)