From d43020758ff379858dd4223f192406210e7a97b8 Mon Sep 17 00:00:00 2001 From: "Robert P. Goldman" Date: Sat, 4 Nov 2023 11:03:54 -0500 Subject: [PATCH] Disable plan tree output on classic SHOP. These are still messed up, and not critical. --- shop3/buildapp/shop-app-entrypoints.lisp | 58 ++++++++++--------- shop3/buildapp/test.sh | 74 ++++++++++++------------ 2 files changed, 68 insertions(+), 64 deletions(-) diff --git a/shop3/buildapp/shop-app-entrypoints.lisp b/shop3/buildapp/shop-app-entrypoints.lisp index 16d1079c..7ac2b302 100644 --- a/shop3/buildapp/shop-app-entrypoints.lisp +++ b/shop3/buildapp/shop-app-entrypoints.lisp @@ -88,11 +88,7 @@ (defun common/options () (list - (clingon:make-option - :flag - :description "Print plan tree as well as plan." - :key :plan-tree - :long-name "tree") + (clingon:make-option :counter :description "Verbose output." @@ -105,22 +101,27 @@ :description "Print plan to file." :key :plan-file :required nil - :long-name "plan-file") - (clingon:make-option - :string - :description "Print plan tree to file." - :key :tree-file - :required nil - :long-name "tree-file"))) + :long-name "plan-file"))) (defun ess/options () (append (list (clingon:make-option :flag - :description "Print HDDL output (plan and tree)." - :key :hddl - :long-name "hddl") + :description "Print plan tree as well as plan." + :key :plan-tree + :long-name "tree") + (clingon:make-option + :string + :description "Print plan tree to file." + :key :tree-file + :required nil + :long-name "tree-file") + (clingon:make-option + :flag + :description "Print HDDL output (plan and tree)." + :key :hddl + :long-name "hddl") (clingon:make-option :string :description "Print HDDL output to file." @@ -199,8 +200,8 @@ (defun classic/handler (cmd) (let ((args (clingon:command-arguments cmd)) - (plan-tree (or (clingon:getopt cmd :plan-tree) - (clingon:getopt cmd :tree-file))) + ;; (plan-tree (or (clingon:getopt cmd :plan-tree) + ;; (clingon:getopt cmd :tree-file))) (shop::*define-silently* (zerop (clingon:getopt cmd :verbose)))) (handler-bind ((error (lambda (x) @@ -209,9 +210,11 @@ (uiop:quit 1))))) (iter (for x in args) (load-shop-file x)) - (multiple-value-bind (plans time trees) - (find-plans shop::*problem* :plan-tree plan-tree :verbose (clingon:getopt cmd :verbose)) - (declare (ignore time)) ; at least for now... + (multiple-value-bind (plans ;; time trees + ) + (find-plans shop::*problem* :plan-tree nil ;plan-tree + :verbose (clingon:getopt cmd :verbose)) + ;;(declare (ignore time)) ; at least for now... (unless plans (error "Unable to find a plan for problem ~a" (shop::problem-name shop::*problem*))) @@ -221,13 +224,14 @@ (unwind-protect (print-plan (first plans) plan-stream) (unless (eq plan-stream t) (close plan-stream)))) - (when plan-tree - (let ((stream (alexandria:if-let ((plan-path (clingon:getopt cmd :tree-file))) - (open plan-path :direction :output :if-exists :supersede) - t))) - (unwind-protect - (print-classic-tree (first trees) stream) - (unless (eq stream t) (close stream))))))))) + ;; (when plan-tree + ;; (let ((stream (alexandria:if-let ((plan-path (clingon:getopt cmd :tree-file))) + ;; (open plan-path :direction :output :if-exists :supersede) + ;; t))) + ;; (unwind-protect + ;; (print-classic-tree (first trees) stream) + ;; (unless (eq stream t) (close stream))))) + )))) (defun tree-compare/handler (cmd) (let ((args (clingon:command-arguments cmd))) diff --git a/shop3/buildapp/test.sh b/shop3/buildapp/test.sh index 8ff35256..439b52de 100755 --- a/shop3/buildapp/test.sh +++ b/shop3/buildapp/test.sh @@ -210,45 +210,45 @@ elif [ "$RES" != "$EXPECTED" ]; then exit 1 fi -echo "Test SHOP with 2 arguments and plan-tree" +# echo "Test SHOP with 2 arguments and plan-tree" -PLAN=$(mktemp -t "planXXXXXX") -PLAN_TREE=$(mktemp -t "treeXXXXXX") -shop --tree-file ${PLAN_TREE} --plan-file ${PLAN} logistic.lisp Log_ran_problems_15.lisp -EC=$? -if [ "$EC" -ne 0 ]; then - echo "Failed to run planner successfully"; - exit $EC -else - RES=`cat ${PLAN}` - if [ "$RES" != "$EXPECTED" ]; then - echo "Plan result did not equal the expected." - exit 1 - fi - compare_trees -fi -echo "... ok" +# PLAN=$(mktemp -t "planXXXXXX") +# PLAN_TREE=$(mktemp -t "treeXXXXXX") +# shop --tree-file ${PLAN_TREE} --plan-file ${PLAN} logistic.lisp Log_ran_problems_15.lisp +# EC=$? +# if [ "$EC" -ne 0 ]; then +# echo "Failed to run planner successfully"; +# exit $EC +# else +# RES=`cat ${PLAN}` +# if [ "$RES" != "$EXPECTED" ]; then +# echo "Plan result did not equal the expected." +# exit 1 +# fi +# compare_trees +# fi +# echo "... ok" -echo "Test SHOP with 1 argument and plan tree" -INPUT=$(mktemp -t "inputXXXXXX") -cat logistic.lisp > ${INPUT} -cat Log_ran_problems_15.lisp >> ${INPUT} -PLAN=$(mktemp -t "planXXXXXX") -PLAN_TREE=$(mktemp -t "treeXXXXXX") -shop --tree-file ${PLAN_TREE} --plan-file ${PLAN} ${INPUT} -EC=$? -if [ "$EC" -ne 0 ]; then - echo "Failed to run planner successfully"; - exit $EC -else - RES=`cat ${PLAN}` - if [ "$RES" != "$EXPECTED" ]; then - echo "Plan result did not equal the expected." - exit 1 - fi - compare_trees -fi -echo "... ok" +# echo "Test SHOP with 1 argument and plan tree" +# INPUT=$(mktemp -t "inputXXXXXX") +# cat logistic.lisp > ${INPUT} +# cat Log_ran_problems_15.lisp >> ${INPUT} +# PLAN=$(mktemp -t "planXXXXXX") +# PLAN_TREE=$(mktemp -t "treeXXXXXX") +# shop --tree-file ${PLAN_TREE} --plan-file ${PLAN} ${INPUT} +# EC=$? +# if [ "$EC" -ne 0 ]; then +# echo "Failed to run planner successfully"; +# exit $EC +# else +# RES=`cat ${PLAN}` +# if [ "$RES" != "$EXPECTED" ]; then +# echo "Plan result did not equal the expected." +# exit 1 +# fi +# compare_trees +# fi +# echo "... ok" echo "Test ESS-SHOP with 2 arguments"