Giter Club home page Giter Club logo

ipyhop's Introduction


If you use this repository please cite our work:

@inproceedings{bansod2022htn,
  title={HTN Replanning from the Middle},
  author={Bansod, Yash and Patra, Sunandita and Nau, Dana and Roberts, Mark},
  booktitle={The International FLAIRS Conference Proceedings},
  volume={35},
  year={2022}
}

IPyHOP is a Re-entrant Iterative GTPyHOP written in Python 3. PyHOP is an acronym for Python Hierarchical Ordered Planner.

IPyHOP is a Totally-Ordered Goal Task Network (GTN) Planner written in Python 3. It effectively plans like a re-entrant iterative version of GTPyHOP. However, IPyHOP produces a solution tree (a task decomposition network) to accomplish a to-do list T consisting of actions, tasks, and goals. The solution tree preserves the hierarchy of the decompositions performed to obtain the solution plan. The solution plan can be obtained by listing the actions in the solution tree in a pre-ordered depth-first search manner. The plan presents the sequence of actions that accomplishes all of the items in T, in the order that they occur in T.

IPyHOP can also re-enter any point in the task decomposition network and re-plan from there. Alternatively, it can be fed a partially solved task decomposition network to solve the planning problem.

For more details on IPyHOP's planning algorithm please read the paper: HTN Replanning from the Middle

For examples of how to use it, see the example files that come with IPyHOP.

IPyHOP provides the following classes and functions:

  • state = State('foo') tells IPyHOP to create an empty state object named 'foo'.
    To put variables and values into it, you should do assignments such as foo.var1 = val1

  • methods = Methods() tells IPyHOP to create an empty methods container.
    To add tasks and associated task methods into it, you should use methods.declare_task_methods(task_name, method_list).
    To add tasks and associated goal methods into it, you should use methods.declare_goal_methods(goal_name, method_list).
    To add tasks and associated multigoal methods into it, you should use methods.declare_multigoal_methods(goal_tag, method_list).

  • actions = Actions() tells IPyHOP to create an empty actions container.
    To add actions into it, you should use actions.declare_actions(action_list).
    declare_actions([a1, a2, ..., ak]) tells IPyHOP that a1, a2, ..., ak are all of the planning actions.
    This supersedes any previous call to declare_actions([a1, a2, ..., ak]).

  • planner = IPyHOP(methods, actions) tells IPyHOP to create a IPyHOP planner object.
    To plan using the planner, you should use planner.plan(state, task_list).

  • planner.replan(state, fail_node_id) can be used to re-plan from a failure node in the planner's solution tree.
    fail_node_id is the id of the node in the solution tree that failed.
    Let fail_node describe the action, task, or goal that caused the failure. Ex. ('move', 'a', 'b').
    Then, to mark fail_node as a deterministic failure, you should blacklist it using planner.blacklist_command(fail_node).

  • planar_plot(planner.sol_tree) can be used to visualize the solution tree graphically.

  • planner.simulate(state) can be used to deterministically simulate the plan generated by the planner from a given initial state.

Please see the code doc strings for detailed descriptions of IPyHOP's classes and functions.


Please see the IPyHOP Wiki for more project details.


ipyhop's People

Contributors

yashbansod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.