Giter VIP home page Giter VIP logo

bt-from-planning-experts's Introduction

Learning Behavior Trees from Planning Experts Using Data Mining and Logic Factorization

This README will guide you to generate the results presented in the paper Learning Behavior Trees from Planning Experts Using Decision Tree and Logic Factorization. This repository is the so called SETUPI in the paper.

Install

  1. Install python3.8 and R
  2. Install GraphViz
  3. (Optional) create a python3 virtual environment and activate it
  4. Install packages in python pip install pydot pyyaml matplotlib celluloid sympy wheel pandas sklearn graphviz networkx pyeda If you have troubles installing pyeda in windows, we provide the wheel file. Run the command pip install pyeda-0.28.0-cp38-cp38-win_amd64.whl If you want to visualize the tree (more instruction later) run pip install IPython
  5. Install packages in R install.packages('C50') Check the settings and change them so the output will be saved in the top level directory

Reproducing the results for Correctness and Performance

Open a terminal in the top level directory. Note that these steps are sequential and they need to be run in order. If you would like to skip one step, in the output folder we provide the files (created during the steps) that are needed to run the following steps. Copy paste the file in the right directory and run the next step

  1. (Optional) If you want to visualize the manually defined initial BT run the notebook show_BT.ipynb This notebook can be used to easily visualize any BT given its definition (string).

  2. To create the simulation data copy paste in the terminal: python run_simulations.py Expected output: ExecutedTraces.csv in the top level directory

  3. To learn the rules run the script c50.R in R Expected output: c50-rules.txt in the top level directory

    1. To convert the rules into the BT using BT-Factor copy paste in the terminal: python BT-Factor.py Expected output: BTFactor folder in the top level directory with 3 behavior_tree files (.dot, .png, .svg) and the BT.py file. The BT (string form) will be printed in the terminal

    2. To convert the rules into the BT using BT-Factor without Horn Clauses change the defaul_action_and_horn_clauses variable (defined at line 19 of BT-Factor.py) to False, save and copy paste in the terminal: python BT-Factor.py Expected output: BTFactor_DNF folder in the top level directory with 3 behavior_tree files (.dot, .png, .svg) and the BT.py file. The BT (string form) will be printed in the terminal

  4. To One-Hot-Encoding the executed traces and thus creating the input for RE:BT-Espresso copy paste in the terminal: python hotencode.py Expected output: ExecutedTracesOneHot.csv

  5. To run RE:BT-Espresso copy paste in the terminal: python RE-BT-Espresso.py Note that we already provide the pruning values (line 578 of RE-BT-Espresso.py) generated by using the minimal cost-complexity pruning (Wathieu et all. 2022). If you want to run with different pruning values comment line line 578 of RE-BT-Espresso.py

    Expected output: REBTEspresso folder in the top level directory with 3 behavior_tree files (.dot, .png, .svg), and 3 python files (BT.py, alpha.py, possible_to_improve.py). The BTs (string form) will be printed in the terminal

  6. To run 200 simulations, copy paste in the terminal python run_experiments.py Expected output: performance-correctness.csv in the \results directory

  7. To compute the results copy paste in the terminal: python evaluation.py Expected output: results printed in the terminal

  8. To compute the GED results presented in Table 4 copy paste in the terminal: python GED-Calculation.py Expected output: ```GED.txt `` in the \results directory

bt-from-planning-experts's People

Contributors

jstyrud avatar matiov avatar simonagug avatar

Stargazers

 avatar Blackbird avatar  avatar

Forkers

alexanderdurr

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.