48 std::function<void()>
GenerateTask(int64_t task_id)
override;
54 bool ResetAndSolveModel(int64_t task_id);
57 SatParameters local_params_;
63 std::atomic<bool> stop_current_chunk_;
66 std::unique_ptr<Model> local_sat_model_;
67 CpModelProto local_proto_;
70 std::vector<int> postsolve_mapping_;
71 CpModelProto mapping_proto_;
74 IntegerValue objective_lb_ ABSL_GUARDED_BY(mutex_);
75 IntegerValue objective_ub_ ABSL_GUARDED_BY(mutex_);
76 IntegerValue current_objective_target_ub_ ABSL_GUARDED_BY(mutex_);
77 bool task_in_flight_ ABSL_GUARDED_BY(mutex_) =
false;
105 std::function<void()>
GenerateTask(int64_t task_id)
override;
112 int64_t DomainSize(
int var)
const ABSL_SHARED_LOCKS_REQUIRED(mutex_);
114 bool VarIsFixed(
int int_var)
const ABSL_SHARED_LOCKS_REQUIRED(mutex_);
116 bool ConstraintIsInactive(
int c)
const ABSL_SHARED_LOCKS_REQUIRED(mutex_);
118 bool FindNextVar(
State* state) ABSL_SHARED_LOCKS_REQUIRED(mutex_);
120 void CopyModelConnectedToVar(
State* state,
Model* local_model,
121 CpModelProto* shaving_proto,
122 bool* has_no_overlap_2d)
123 ABSL_SHARED_LOCKS_REQUIRED(mutex_);
125 bool ResetAndSolveModel(int64_t task_id,
State* state,
Model* local_model,
126 CpModelProto* shaving_proto);
129 SatParameters local_params_;
131 int shared_bounds_id_ = -1;
135 std::atomic<bool> stop_current_chunk_;
137 const CpModelProto& model_proto_;
140 int64_t current_index_ = -1;
141 std::vector<Domain> var_domains_ ABSL_GUARDED_BY(mutex_);
144 int num_vars_tried_ ABSL_GUARDED_BY(mutex_) = 0;
145 int num_vars_shaved_ ABSL_GUARDED_BY(mutex_) = 0;
146 int num_infeasible_found_ ABSL_GUARDED_BY(mutex_) = 0;