Skip to content

Commit

Permalink
relax temporal constraint on increase effect
Browse files Browse the repository at this point in the history
  • Loading branch information
Yirmandias committed Oct 13, 2023
1 parent af1b77b commit 71a1b5f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions planning/planners/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1006,11 +1006,15 @@ pub fn encode(pb: &FiniteProblem, metric: Option<Metric>) -> std::result::Result

// Convert the increase effects into conditions in order to check that the new value is in the state variable domain.
for &&(eff_id, prez, eff) in &increases {
assert!(
eff.transition_start + FAtom::EPSILON == eff.persistence_start && eff.min_persistence_end.is_empty(),
"Only instantaneous effects are supported"
);
// Get the bounds of the state variable.
if RELAXED_TEMPORAL_CONSTRAINT.get() {
solver.enforce(eq(eff.transition_start + FAtom::EPSILON, eff.persistence_start), [prez]);
} else {
assert!(
eff.transition_start + FAtom::EPSILON == eff.persistence_start && eff.min_persistence_end.is_empty(),
"Only instantaneous effects are supported"
);
}

let (lb, ub) = if let Type::Int { lb, ub } = eff.state_var.fluent.return_type() {
(lb, ub)
} else {
Expand Down

0 comments on commit 71a1b5f

Please sign in to comment.