This repo contains the source code for ACTIVE-SIMULATE-PLAN, a simulation-free implementation of Monte Carlo Tree Search (MCTS) for finding sequences of causal interventions that transform an initial symbolic state into a goal state for unknown anomalies.
ACTIVE-SIMULATE-PLAN has been tested on Ubuntu 22.04 LTS with Python 3.10. To install, run:
git clone --recurse-submodules https://github.com/convince-project/active-simulate-plan
cd active-simulate-plan/src/simulate-plan/downward
./build.py
ACTIVE-SIMULATE-PLAN uses Fast Downward for PDDL planning. This is included as a submodule and is handled by the above steps. Citation: Helmert, M. (2006). The Fast Downward Planning System. Journal of Artificial Intelligence Research, 26, 191-246.
ACTIVE-PLAN identifies anomalies by applying causal interventions with Monte Carlo Tree Search (MCTS) to run “what-if” analyses.
src/active-plan/
└── identification/
├── mcts.py # Core MCTS algorithm
├── state_manager.py # Symbolic state tracking and updates
├── interventions.py # Intervention parsing and application
├── reward_shaper.py # Reward computation
config/
├── scenario1.json # Block misalignment scenario
├── scenario2.json # (to be added)
├── scenario3.json # (to be added)
└── symbolic_state.json # Initial world state
cd src/active-plan/identification
python3 mcts.pyWhen prompted, select a scenario (default is Scenario 1):
Select scenario (1-3, or press Enter for scenario1): 1
ACTIVE-PLAN will execute MCTS to find a sequence of interventions that achieves the goal state.
Upon running mcts.py, the system will:
- Load the scenario configuration from
config/scenario1.json - Load the initial symbolic state from
config/symbolic_state.json - Execute MCTS search to identify corrective interventions
- Save results to
results_scenario1.json
SIMULATE-PLAN uses PDDL planning to generate recovery actions for geometrically misaligned blocks identified by MCTS.
src/simulate-plan/
└── recovery/
├── planner.py # PDDL recovery planner
├── pddl_builder.py # PDDL problem generator
├── plan_parser.py # Fast Downward output parser
└── domains/
└── domain_s1.pddl # PDDL domain for block stacking
cd src/simulate-plan/recovery
python3 planner.pyWhen prompted, select a scenario (default is Scenario 1):
Select scenario (1-3, or press Enter for scenario1): 1
Upon running planner.py, the system will:
- Load the initial state from
active-plan/config/symbolic_state.json - Load the goal state from
active-plan/config/scenario1.json - Load MCTS interventions from
active-plan/identification/results_scenario1.json - Generate PDDL problem with target predicates for misaligned blocks
- Execute Fast Downward planner to find optimal action sequence
- Parse and display the recovery plan
- Save results to
fd_output/plan_scenario1.json
The documentation for ACTIVE-SIMULATE-PLAN can be found here, where you can read more about the API and find tutorials.
This repository is maintained by:
| Yazz Warsame | yazz | yazzwarsame@gmail.com |