Done. FYI.
function refine_node {?node} (? {} ?result) (? (item (get ?node :tasks)
1) ?task) (if (is_primitive ?task) then (? (hierarchical_operators
?node) ?operators) (while (> (count ?operators) 0) (? (pop
?operators) ?operator) (? (next_state ?node ?operator) ?state) (?
(copy ?node :method nothing :operator ?operator :state ?state) ?next)
(add ?next :steps ?operator) (cut ?next :tasks ?task) (? (append
?result ?next) ?result)) else (? (hierarchical_methods ?node)
?methods) (while (> (count ?methods) 0) (? (pop ?methods) ?method)
(? (copy ?node :method ?method :operator nothing :state ?state) ?next)
(cut ?next :tasks ?task) (for ?subtask in (reverse (get ?method
steps)) (push ?next :tasks ?subtask)) (? (append ?result ?next)
?result))) (return ?result) end
Moving along...
Got several solvers coded this week.
Onto the next category of agents.
~PM
From: [email protected]
To: [email protected]
Subject: RE: HTN Plan refinement step
Date: Thu, 2 Jan 2014 22:19:44 -0800
p. 7 (385) seems to be a good example.
http://arxiv.org/pdf/1106.4869.pdf
Coding it now.
~PM.
Then onto the next...
From: [email protected]
To: [email protected]
Subject: HTN Plan refinement step
Date: Thu, 2 Jan 2014 00:22:10 -0800
Hi All,
I've been coding a few solvers this week and I'm currently working on an HTN
planner/solver.
I just wanted to know if anyone out there has experience with any sort of HTN
planner, and if so, what should happen in the node refinement step. I'm
working in a domain specific languagecalled Premise and my source code follows.
It should be legible enough.
; file pam_p2.hierarchical_solver.memory;; Copyright (c) 2013, 2014 Michael S P
Miller. All Rights Reserved;; Piaget Modeler - [email protected];
require premiserequire pam_p2require pam_p2.solver
module pam_p2.hierarchical_solver
"------------------------------ Notes on Premise DSL -----------------------"
; Bind function ? usage: (? val ?var) or (? obj :prop1 ?var1 :prop2 ?var2 ...)
; Lists {}, function calls (), pattern query []
"------------------------------ HTN Solver Types ---------------------------"
let state :items ... ; properties not worth mentioning end
let node :search :depth 0 :state :tasks ; remaining tasks
to refine :steps ; partial solution :operator :method ... end
let search :init :task :root :depth :frontier ...
end
"------------------------------ Solver Functions ---------------------------"
operation create_hierachical_solution ; if the most salient task is not
enabled, and has no best matching method, ; then create a method (i.e.
solution) for the task. (with (? (most_salient_task) ?task)
(none (is_enabled ?task) (best_matching_solution ?task)) do
{?task} (? (create_search ?task) ?search) (while (> (count (get
?search :frontier)) 0) (? (pop ?search :frontier) ?node) ; retrieve
?node from frontier (? ?node :tasks ?tasks :steps ?steps) ; bind vars
(if (= (count ?tasks) 0) then (create_solution ?task (get ?search
:init) ?steps) (old ?search) ; flag the search object for deletion
(return)) ; exit operation completely (? (refine_node ?node)
?successors) (for ?item in ?successors (push ?search :frontier
?item)))) push ?item onto the frontier end
function most_salient_task {} ; returns the most important task for the
current state of the system end
function is_enabled {?item} ; returns whether item is enabled (i.e., on)
in the current state end
function best_matching_solution {?task} ; returns any pre-existing methods
or operators to satisfy the task end function create_search {?task} ;
sets the initial state :init, root node :root, default max-depth :depth, ;
and :frontier nodes (set to the root node) for the returned search object end
function create_solution {?task ?initial_state ?plan} ; creates a solution
object with the HTN plan end
function refine_node {?node} ; TBD end
end
"------------------------------ EOF ---------------------------"
Otherwise it's digging into the innards of SHOP2 or O-PLAN or other such HTN
planners.I'd rather just have a broad outline or pseudocode algorithm if
possible.
Anyone knowledgeable about this?
Thanks in advance.
~PM
-------------------------------------------
AGI
Archives: https://www.listbox.com/member/archive/303/=now
RSS Feed: https://www.listbox.com/member/archive/rss/303/21088071-f452e424
Modify Your Subscription:
https://www.listbox.com/member/?member_id=21088071&id_secret=21088071-58d57657
Powered by Listbox: http://www.listbox.com