#1 Add plan-tree to values passed to plan-found-hook

Alex Murray

It would be great to be able to have plan tree's returned incrementally along with plans via plan-found-hook


  • Robert P. Goldman

    I'm afraid I don't have the time to do this myself, but it would be a relatively simple extension for an interested party to make. Here's the short answer:

    Find the call to plan-found-hook. You need to add a plan tree to the arguments passed to it.

    Plan trees are not normally computed, so you need to do this. Fortunately, it should be pretty simple. The additional argument you would want to pass would be:

    (apply-substitution (extract-tree plan) unifier)

    So you could modify the call to:

    (when (fboundp 'plan-found-hook)
    (funcall (fdefinition 'plan-found-hook)
    state which-plans final-plan partial-plan-cost depth
    (apply-substitution (extract-tree final-plan) unifier)))

    [As an aside, I'm pretty sure that FDEFINITION there is unnecessary -- could be just (FUNCALL 'PLAN-FOUND-HOOK ...)]

    Then write whatever function you want to be the definition of SHOP2:PLAN-FOUND-HOOK

    (defun shop2:plan-found-hook (state which-plans final-plan cost depth tree)


  • Alex Murray

    Alex Murray - 2013-02-22

    Thanks for the prompt response Robert - I had already tried that but it wasn't working (all I was getting back was the operators without the methods) - but it seems if I run (find-plans) with :plan-tree t as arguments then it does work. Cheers.

  • Robert P. Goldman

    That makes sense: we may not be collecting enough information to create the plan trees if you don't pass :plan-tree t into find-plans. Haven't actually checked.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks