SHOP 2Simple Hierarchical OrderedPlanner 2slides by Andrea Tucci
● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications (SHOP & SHOP 2)● Refere...
● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications● ReferencesOverview
IntroductionSimple Hierarchical Ordered Planner 2 (SHOP 2) :● Based on Hierarchical Task Network (HTN)● Implemented in LIS...
Introduction (2)● Steps of a plan have the same order as their execution(like SHOP).>> this speed up reasoning process● SH...
● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications● ReferencesOverview
Hierarchical Task Networks(HTNs)● Produces actions to reach a (complex) task.● Task can be decomposed in subtasks, primiti...
Hierarchical Task Networks(HTNs) - (2)
Hierarchical Task Networks(HTNs) - (3)Planner :● Choose a method for decompose a complex task intosubtasks● Repeat until a...
Hierarchical Task Networks(HTNs) - (4)Example :(transport-two p1 p2)initial state :(package p1), (at p1 l1), (destination ...
Hierarchical task Networks(HTNs) - (4)
● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications● ReferencesOverview
Features - Basic ElementsSpecify a domain description that consists of a set ofmethods, operators and axioms.>Syntactical ...
Features - Basic Elements - (2)● MethodsHow to decompose a complex task.(:method h [n1] C1 T1 [n2] C2 T2 ... [nk] CkTk)● A...
Features - Basic Elements 6● External Function CallResult is returned by a procedure, e.gnumeric evaluation.( call f t1 t2...
Features - Additional● Sorting variable bindings● Branch and Bound Optimization● PDDL Operator Translation● Protected Cond...
● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications● ReferencesOverview
SHOP 2 Algorithmif t is primitive, use an instance a of anoperator that matches t and has satisfiedprecondition in s. Appl...
● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications● ReferencesOverview
Using SHOP 2● SHOP 2 requires lisp● JSHOP also available, based on JavaCreate a program in SHOP 21. Define a domain2. Defi...
Using SHOP 2 - (2); extremely simple example(defdomain basic ((:operator (!pickup ?a) () () ((have ?a)))(:operator (!drop ...
● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● ApplicationsOverview○ Video games○ E...
Application - Video games
Application - Video Games (2)● The use of HTNs in video games arise inthe last years.
Application - Video Game (3)● An example : Killzone 2 (Guerrilla Games, PS3 2009)● First Person Shooter (FPS)● Planner bas...
Application - Video Games (4)● Killzone 2 AI : HTN-based● High-level rules -> what to do● Low-level rules -> how to do sel...
Application - Video Games (5)example(:method (select_weapon_and_attack_as_turret ?inp_threat)(branch_use_bullets // Only u...
Application - Video Games (6)some numbersIndividual bot domain● 360 methods● 1048 branches● 138 behaviors● 147 continue br...
Application - Evacuation● US Naval Research Laboratory’s HierarchicalInteractive Case-Based Architecture for Planning(HICA...
Application - evaluating terroristthreats● Naval Research Laboratory’s AnalogicalHypothesis Elaboration for ActivityDetect...
Application - evaluating terroristthreats● SHOP 2 produces a plan compatible withhypothesis.● SHOP 2 queries an external e...
Application - automatedcomposition of web services● Web service : a part of web that offerfunctionality● The OWL-S (Web On...
Application - automatedcomposition of web services (2)● Goal : compose web services● User can compose them by using SHOP2●...
Application - others● Fighting forest fires● Material selection for manifacturing● Project PlanningetcCheck this paper out...
● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications○ Video games○ Evacuatio...
References● SHOP 2 : An HTN Planning System - (D.Nau et al, 2003)● A hierarchically-layered multiplayer botsystem for a fi...
Thanks for your attentionAndrea Tucci@andreatux
Upcoming SlideShare
Loading in...5
×

Shop 2 presentation slide

575

Published on

pdf version of my presentation on SHOP 2.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
575
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Shop 2 presentation slide

  1. 1. SHOP 2Simple Hierarchical OrderedPlanner 2slides by Andrea Tucci
  2. 2. ● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications (SHOP & SHOP 2)● ReferencesOverview
  3. 3. ● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications● ReferencesOverview
  4. 4. IntroductionSimple Hierarchical Ordered Planner 2 (SHOP 2) :● Based on Hierarchical Task Network (HTN)● Implemented in LISP● Developed by D.Nau, T.Au, O.Ilghami, U.Kuter, D.Wu,and F.Yaman, H. Muñoz-Avila, J.W. Murdock in 2001;● Award-winning at International Planning Competition(2002) for its performance
  5. 5. Introduction (2)● Steps of a plan have the same order as their execution(like SHOP).>> this speed up reasoning process● SHOP 2 characteristics go further :○ task and subtask can be partially ordered;○ many PDDL features included (e.g. quantifiers,conditional effects)○ possibilities to satisfy a methods precondition aresorted according to specifications provided by theprogrammer○ others
  6. 6. ● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications● ReferencesOverview
  7. 7. Hierarchical Task Networks(HTNs)● Produces actions to reach a (complex) task.● Task can be decomposed in subtasks, primitive orcomplex● Method : how a complex task can be decomposed● Planner decomposes complex tasks until a primitive oneis found
  8. 8. Hierarchical Task Networks(HTNs) - (2)
  9. 9. Hierarchical Task Networks(HTNs) - (3)Planner :● Choose a method for decompose a complex task intosubtasks● Repeat until a plan is found or we came out with aninfeasible plan● In the latter case, backtrack and try other implementingmethods.
  10. 10. Hierarchical Task Networks(HTNs) - (4)Example :(transport-two p1 p2)initial state :(package p1), (at p1 l1), (destination p1l3), (available-truck t1), (at t1 home)(package p2), (at p2 l2), (destination p2l4), (available-truck t2), (at t2 home)
  11. 11. Hierarchical task Networks(HTNs) - (4)
  12. 12. ● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications● ReferencesOverview
  13. 13. Features - Basic ElementsSpecify a domain description that consists of a set ofmethods, operators and axioms.>Syntactical NoteA variable is preceded by "?" symbol.A comment is preceded by ";".● TasksAction to be done. They can be either primitive orcomplex.(s t1 t2 ... tn)A primitive task is preceded by "!" symbol.● OperatorsIndicates how a primitive task can be executed.(:operator h P D A [c])
  14. 14. Features - Basic Elements - (2)● MethodsHow to decompose a complex task.(:method h [n1] C1 T1 [n2] C2 T2 ... [nk] CkTk)● AxiomsUsed to infer precondition that are not explicitlyasserted in our current state (e.g. including quantifiers,implications etc).(:- a [name1] E1 ... [namen] En)(:- head tail)Which means that head is true if tail is true (Hornclauses).
  15. 15. Features - Basic Elements 6● External Function CallResult is returned by a procedure, e.gnumeric evaluation.( call f t1 t2 ... tn )where f is a function symbol
  16. 16. Features - Additional● Sorting variable bindings● Branch and Bound Optimization● PDDL Operator Translation● Protected Condition and Anti-Interleaving● Debugging Facilities
  17. 17. ● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications● ReferencesOverview
  18. 18. SHOP 2 Algorithmif t is primitive, use an instance a of anoperator that matches t and has satisfiedprecondition in s. Apply a.if t is complex, find a method that can beapplied to t and decompose it.
  19. 19. ● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications● ReferencesOverview
  20. 20. Using SHOP 2● SHOP 2 requires lisp● JSHOP also available, based on JavaCreate a program in SHOP 21. Define a domain2. Define one (or more) problems3. run!
  21. 21. Using SHOP 2 - (2); extremely simple example(defdomain basic ((:operator (!pickup ?a) () () ((have ?a)))(:operator (!drop ?a) ((have ?a)) ((have ?a)) ())(:method (swap ?x ?y)((have ?x) (in-range ?x ?y))((!drop ?x) (!pickup ?y))((have ?y) (in-range ?x ?y))((!drop ?y) (!pickup ?x))))); axiom(:- (in-range ?x)yes((position ?x ?p1) (position ?y ?p2) (max-range ?r) (call >= ?r(call - ?p2 ?p1)))))(defproblem problem basic((have phone) (max-range 20) (position phone 5) (position key 10))((swap phone key)))PLAN -> (!drop phone) (!pickup key)
  22. 22. ● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● ApplicationsOverview○ Video games○ Evacuation○ Evaluation of terrorist threats○ Automated composition of web services○ ...more.● Resources
  23. 23. Application - Video games
  24. 24. Application - Video Games (2)● The use of HTNs in video games arise inthe last years.
  25. 25. Application - Video Game (3)● An example : Killzone 2 (Guerrilla Games, PS3 2009)● First Person Shooter (FPS)● Planner based on SHOP syntax● Killzone AI structure : goal driven● Behavior associated with the selected goal
  26. 26. Application - Video Games (4)● Killzone 2 AI : HTN-based● High-level rules -> what to do● Low-level rules -> how to do selected task(s)● More flexibility● HTN also control squads
  27. 27. Application - Video Games (5)example(:method (select_weapon_and_attack_as_turret ?inp_threat)(branch_use_bullets // Only use bullets against humanoids and turrets.(and(or (threat ?inp_threat humanoid) (threat ?inp_threat turret) )(distance_to_threat ?inp_threat ?threat_distance)(call lt ?threat_distance @weapon_bullet_max_range) )((attack_as_turret_using_weapon_pref ?inp_threat wp_bullets)))( branch_use_rockets // Dont use rockets against humanoids and turrets.(and(not (threat ?inp_threat humanoid)) (not (threat ?inp_threatturret))(distance_to_threat ?inp_threat ?threat_distance)(call lt ?threat_distance @weapon_rocket_max_range) )((attack_as_turret_using_weapon_pref ?inp_threat wp_rockets))))
  28. 28. Application - Video Games (6)some numbersIndividual bot domain● 360 methods● 1048 branches● 138 behaviors● 147 continue branchesDuring multiplayer game (14 bots / max. 10 turrets / max. 6drones / squads)● Approx. 500 plans generated per second● Approx. 8000 decompositions per second● Avg. 15 decompositions per planning.● Approx 24000 branch evaluations per second.
  29. 29. Application - Evacuation● US Naval Research Laboratory’s HierarchicalInteractive Case-Based Architecture for Planning(HICAP) helps human planners to build evacuationplans.● Generative and case-specific planning. SHOP providesthe generative component.● Interactive plan modification : human expert can modifytasks and plans interactively.
  30. 30. Application - evaluating terroristthreats● Naval Research Laboratory’s AnalogicalHypothesis Elaboration for ActivityDetection (AHEAD) helps to understandand evaluate terrorists threats.● A HTN domain encode hostile activities.● AHEAD takes a hypothesis as input andreturns a model of the hostile activity.
  31. 31. Application - evaluating terroristthreats● SHOP 2 produces a plan compatible withhypothesis.● SHOP 2 queries an external evidencedatabase to make some tests
  32. 32. Application - automatedcomposition of web services● Web service : a part of web that offerfunctionality● The OWL-S (Web Ontology Language forServices) is a language for semantic markupof Web services● It describes services as complex or atomicprocesses with preconditions and effects.● University of Maryland has developed analgorithm to translate OWL-S process-models to SHOP 2 methods and operators.
  33. 33. Application - automatedcomposition of web services (2)● Goal : compose web services● User can compose them by using SHOP2● Result : HTN plan that corresponds to thecomposite process.
  34. 34. Application - others● Fighting forest fires● Material selection for manifacturing● Project PlanningetcCheck this paper out SHOP & SHOP 2applications
  35. 35. ● Introduction● Hierarchical Task Networks● Features● SHOP 2 Algorithm● Using SHOP 2● Applications○ Video games○ Evacuation○ Location-based services○ Automated composition of web services○ ...more.● ReferencesOverview
  36. 36. References● SHOP 2 : An HTN Planning System - (D.Nau et al, 2003)● A hierarchically-layered multiplayer botsystem for a first-person shooter (TimVerweij, 2007)● Killzone 2 Multiplayer Bots - ( AlexChampandard, Tim Verweij, RemcoStraatman, 2009)● Application of SHOP and SHOP 2 - (D.Nauet al, 2005)● Documentation for SHOP 2
  37. 37. Thanks for your attentionAndrea Tucci@andreatux

×