Skip to content

Instantly share code, notes, and snippets.

View zephirefaith's full-sized avatar

Priyam Parashar zephirefaith

View GitHub Profile
@zephirefaith
zephirefaith / solve_easy_grid_with_htn.py
Created October 4, 2022 20:11
Python code to instantiate a simple 4 node HTN for an agent in 2D grid. The agent is spawned randomly somewhere in the world, the HTN encodes decisions needed to get the agent to top-right corner of the grid.
#!/bin/env python
import networkx as nx
import numpy as np
from enum import Enum
class Actions(Enum):
MOVE_UP = 0
MOVE_RIGHT = 1