From ccb1fe83626c00b85616e8b293860c8f6301d042 Mon Sep 17 00:00:00 2001 From: Claudio Scheer Date: Sun, 17 May 2020 00:17:14 -0300 Subject: [PATCH] Correct validation function --- AP-Jupyternotebook.ipynb | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/AP-Jupyternotebook.ipynb b/AP-Jupyternotebook.ipynb index 0edc3df..33dee71 100644 --- a/AP-Jupyternotebook.ipynb +++ b/AP-Jupyternotebook.ipynb @@ -1441,11 +1441,11 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 58, "metadata": { "ExecuteTime": { - "end_time": "2020-05-17T02:00:33.406131Z", - "start_time": "2020-05-17T02:00:33.389837Z" + "end_time": "2020-05-17T03:16:50.956644Z", + "start_time": "2020-05-17T03:16:50.946907Z" }, "deletable": false, "nbgrader": { @@ -1498,11 +1498,13 @@ " state = initial_state\n", " for x in plan:\n", " for action in actions:\n", - " if applicable(\n", - " state, (action.positive_preconditions, action.negative_preconditions)\n", - " ):\n", - " state = apply(state, (action.add_effects, action.del_effects)).union(state)\n", - " \n", + " if x.parameters == action.parameters:\n", + " # I do not think this if is necessary, but I will keep it just to be sure.\n", + " if applicable(\n", + " state, (action.positive_preconditions, action.negative_preconditions)\n", + " ):\n", + " state = apply(state, (action.add_effects, action.del_effects)).union(state)\n", + "\n", " goals_reached = goals[0].intersection(state)\n", " return goals_reached == goals[0]" ] @@ -1529,11 +1531,11 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 59, "metadata": { "ExecuteTime": { - "end_time": "2020-05-17T02:00:34.862261Z", - "start_time": "2020-05-17T02:00:34.545889Z" + "end_time": "2020-05-17T03:16:53.558860Z", + "start_time": "2020-05-17T03:16:53.458390Z" }, "deletable": false, "editable": false, -- GitLab