diff --git a/planning/planners/src/encode.rs b/planning/planners/src/encode.rs index 5525b9a5..e6d88475 100644 --- a/planning/planners/src/encode.rs +++ b/planning/planners/src/encode.rs @@ -735,9 +735,15 @@ pub fn encode(pb: &FiniteProblem, metric: Option) -> std::result::Result let EffectOp::Assign(val) = ass.operation else { unreachable!() }; - let Atom::Int(val) = val else { unreachable!() }; - solver.enforce(geq(val, lb), [prez]); - solver.enforce(leq(val, ub), [prez]); + if let Atom::Int(val) = val { + solver.enforce(geq(val, lb), [prez]); + solver.enforce(leq(val, ub), [prez]); + } else if let Atom::Fixed(val) = val { + solver.enforce(f_geq(val, FAtom::new((lb * val.denom).into(), val.denom)), [prez]); + solver.enforce(f_leq(val, FAtom::new((ub * val.denom).into(), val.denom)), [prez]); + } else { + unreachable!(); + } num_numeric_assignment_coherence_constraints += 1; } @@ -805,8 +811,10 @@ pub fn encode(pb: &FiniteProblem, metric: Option) -> std::result::Result if solver.model.entails(!*cond_prez) { continue; } - let Atom::Int(cond_val) = cond.value else { - unreachable!() + let cond_val = match cond.value { + Atom::Int(val) => FAtom::new(val, 1), + Atom::Fixed(val) => val, + _ => unreachable!(), }; let mut supported: Vec = Vec::with_capacity(128); let mut inc_support: HashMap> = HashMap::new(); diff --git a/planning/planners/src/encoding.rs b/planning/planners/src/encoding.rs index 989ae86c..4b7143b4 100644 --- a/planning/planners/src/encoding.rs +++ b/planning/planners/src/encoding.rs @@ -117,7 +117,7 @@ pub fn conditions(pb: &FiniteProblem) -> impl Iterator bool { - matches!(sv.fluent.return_type().into(), Kind::Int) + matches!(sv.fluent.return_type().into(), Kind::Int) || matches!(sv.fluent.return_type().into(), Kind::Fixed(_)) } pub struct TaskRef<'a> {