From 08b4cf5b326fb2894915f3f33f6c57cfcc668df9 Mon Sep 17 00:00:00 2001 From: Luca Framba Date: Mon, 16 Oct 2023 17:39:12 +0200 Subject: [PATCH] Added extra text on error --- unified_planning/model/walkers/state_evaluator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unified_planning/model/walkers/state_evaluator.py b/unified_planning/model/walkers/state_evaluator.py index 7d828e215..50d2ddbd9 100644 --- a/unified_planning/model/walkers/state_evaluator.py +++ b/unified_planning/model/walkers/state_evaluator.py @@ -53,6 +53,7 @@ def evaluate( self._state = state r = self.walk(expression) self._variable_assignments = None + self._exp = expression assert r.is_constant() return r @@ -79,5 +80,5 @@ def walk_fluent_exp(self, expression: "FNode", args: List["FNode"]) -> "FNode": def walk_param_exp(self, expression: "FNode", args: List["FNode"]) -> "FNode": raise UPProblemDefinitionError( - f"The StateEvaluator.evaluate should only be called on grounded expressions but is called on the parameter: {expression}" + f"The StateEvaluator.evaluate should only be called on grounded expressions but is called on the parameter: {expression} in exp {self._exp}" )