Changes have been pushed for the repository "fawkes.git".
(Fawkes Robotics Software Framework)

Clone:  g...@git.fawkesrobotics.org:fawkes.git
Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, thofmann/clips-executive-pddl has been updated
        to  026f3d380f7e18ba44def880257ada8fe21dc422 (commit)
      from  f1bd7e446b8aa9f5dd0d8013159eff59bb34e6ae (commit)

http://git.fawkesrobotics.org/fawkes.git/thofmann/clips-executive-pddl

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- *Log* ---------------------------------------------------------------
commit 026f3d380f7e18ba44def880257ada8fe21dc422
Author:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
AuthorDate: Fri Feb 9 11:18:16 2018 +0100
Commit:     Till Hofmann <hofm...@kbsg.rwth-aachen.de>
CommitDate: Fri Feb 9 11:26:02 2018 +0100

    clips-executive: fix action IDs for PDDL actions
    
    The last method did not work because the plan-action fact was not
    asserted yet before adding the next action, which resulted in same
    action IDs for all actions in a plan. Now, get the highest existing
    action ID only once as offset for the action IDs. Set the final action
    ID to the sum of the offset and the action ID in the plan.

http://git.fawkesrobotics.org/fawkes.git/commit/026f3d3
http://trac.fawkesrobotics.org/changeset/026f3d3

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------
 src/plugins/clips-executive/clips/pddl.clp |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)


- *Diffs* -------------------------------------------------------------

- *commit* 026f3d380f7e18ba44def880257ada8fe21dc422 - - - - - - - - - -
Author:  Till Hofmann <hofm...@kbsg.rwth-aachen.de>
Date:    Fri Feb 9 11:18:16 2018 +0100
Subject: clips-executive: fix action IDs for PDDL actions

 src/plugins/clips-executive/clips/pddl.clp |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/clips-executive/clips/pddl.clp 
b/src/plugins/clips-executive/clips/pddl.clp
index 955e0b8..c0158c1 100644
--- a/src/plugins/clips-executive/clips/pddl.clp
+++ b/src/plugins/clips-executive/clips/pddl.clp
@@ -82,10 +82,10 @@
   (modify ?p (status PLANNED))
 )
 
-(deffunction pddl-get-next-action-id ()
-  "Get the ID of the next action, i.e., the max ID of all current actions + 1"
-  (bind ?i 1)
-  (do-for-all-facts ((?a plan-action)) (> ?a:id ?i) (bind ?i (+ 1 ?a:id)))
+(deffunction pddl-get-max-action-id ()
+  "Get the max ID of all current action"
+  (bind ?i 0)
+  (do-for-all-facts ((?a plan-action)) (> ?a:id ?i) (bind ?i ?a:id))
   (return ?i)
 )
 
@@ -101,6 +101,7 @@
         )
   =>
   (printout t "Fetched a new plan!" crlf)
+  (bind ?id-offset (pddl-get-max-action-id))
   (progn$ (?action (bson-get-array (bson-get ?obj "o") "actions"))
     (bind ?param-values (bson-get-array ?action "args"))
     ; Convert all paramters to lower-case symbols
@@ -116,7 +117,7 @@
     (assert
       (plan (id ?plan-id) (goal-id ?goal-id))
       (plan-action
-        (id (pddl-get-next-action-id))
+        (id (+ ?action-index ?id-offset))
         (plan-id ?plan-id)
         (action-name (sym-cat (bson-get ?action "name")))
         (param-values ?param-values)




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org
_______________________________________________
fawkes-commits mailing list
fawkes-commits@lists.kbsg.rwth-aachen.de
https://lists.kbsg.rwth-aachen.de/listinfo/fawkes-commits

Reply via email to