Skip to content

Commit

Permalink
turn assertion into test
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianPommerening committed Aug 29, 2024
1 parent 8989cfb commit e347e04
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/search/potentials/potential_optimizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,16 @@ void PotentialOptimizer::construct_lp() {
int post = effect.get_fact().get_value();
int pre_lp = lp_var_ids[var_id][pre];
int post_lp = lp_var_ids[var_id][post];
assert(pre_lp != post_lp);
coefficients.emplace_back(pre_lp, 1);
coefficients.emplace_back(post_lp, -1);
if (pre_lp != post_lp) {
/*
Prevail conditions with pre = post can occur in transformed
tasks, see issue1150. We ignore them since they cancel out and
LPConstraints may not have two coefficients for the same
variable.
*/
coefficients.emplace_back(pre_lp, 1);
coefficients.emplace_back(post_lp, -1);
}
}
sort(coefficients.begin(), coefficients.end());
for (const auto &coeff : coefficients)
Expand Down

0 comments on commit e347e04

Please sign in to comment.