sat: backport from main

This commit is contained in:
Corentin Le Molgat
2025-09-22 17:24:20 +02:00
parent 8df4d12bbf
commit b05315de21
59 changed files with 1904 additions and 1006 deletions

View File

@@ -297,8 +297,10 @@ UnassignedVarWithLowestMinAtItsMinHeuristic(
std::function<BooleanOrIntegerLiteral()> SequentialSearch(
std::vector<std::function<BooleanOrIntegerLiteral()>> heuristics) {
for (const auto& h : heuristics) {
CHECK(h != nullptr);
if (DEBUG_MODE) {
for (const auto& h : heuristics) {
DCHECK(h != nullptr);
}
}
return [heuristics]() {
for (const auto& h : heuristics) {
@@ -994,19 +996,16 @@ std::function<BooleanOrIntegerLiteral()> RandomizeOnRestartHeuristic(
weights.push_back(1);
}
// Add heuristic search if present.
// Add model based heuristic search if present.
if (heuristics.heuristic_search != nullptr) {
policies.push_back(
SequentialSearch({heuristics.heuristic_search, sat_policy,
heuristics.integer_completion_search}));
weights.push_back(1);
}
if (policies.size() == 1) {
CHECK(heuristics.fixed_search != nullptr);
policies.push_back(
SequentialSearch({heuristics.fixed_search, sat_policy,
heuristics.integer_completion_search}));
} else if (heuristics.user_search == nullptr) {
// Add pseudo cost search if nothing else is present.
policies.push_back(SequentialSearch(
{PseudoCost(model), sat_policy, heuristics.integer_completion_search}));
weights.push_back(1);
}