{"id":15967654,"url":"https://github.com/elucidation/hanoi-pddl-generator","last_synced_at":"2025-03-26T15:32:33.945Z","repository":{"id":2021665,"uuid":"2957681","full_name":"Elucidation/Hanoi-PDDL-generator","owner":"Elucidation","description":"N-disk Hanoi tower PDDL generator","archived":false,"fork":false,"pushed_at":"2012-01-03T08:27:51.000Z","size":104,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T02:02:42.047Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Elucidation.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-12-11T10:41:38.000Z","updated_at":"2019-09-18T22:37:40.000Z","dependencies_parsed_at":"2022-09-20T22:45:58.593Z","dependency_job_id":null,"html_url":"https://github.com/Elucidation/Hanoi-PDDL-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elucidation%2FHanoi-PDDL-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elucidation%2FHanoi-PDDL-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elucidation%2FHanoi-PDDL-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elucidation%2FHanoi-PDDL-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Elucidation","download_url":"https://codeload.github.com/Elucidation/Hanoi-PDDL-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245681513,"owners_count":20655212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-07T18:40:39.130Z","updated_at":"2025-03-26T15:32:33.642Z","avatar_url":"https://github.com/Elucidation.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"N-disk Hanoi PDDL generator\n---\n\n[STRIPS](http://en.wikipedia.org/wiki/STRIPS) is an automated planner that solves problems defined by a PDDL syntax.\n\nThis python script generates PDDL problems for N-disk 3-peg [Tower of Hanoi](http://en.wikipedia.org/wiki/Tower_of_hanoi) problems\n\n\nUsage:\n\n    python towerHanoiMaker.py N\n\nwhere `N` is the number of disks\n\nFor example, for N = 3\n\n    python towerHanoiMaker.py 3 \u003e hanoi3.txt\n    \nWhich produces the following file \n\n``` \n(define (problem hanoi-3)\n  (:domain hanoi-domain)\n  (:objects p1 p2 p3 d1 d2 d3 )\n  (:init \n    (smaller d1 p1)(smaller d1 p2)(smaller d1 p3)\n    (smaller d2 p1)(smaller d2 p2)(smaller d2 p3)\n    (smaller d3 p1)(smaller d3 p2)(smaller d3 p3)\n\n    (smaller d1 d2)(smaller d1 d3)\n    (smaller d2 d3)\n    \n    (clear p1)(clear p2)(clear d1)\n    (disk d1)(disk d2)(disk d3)\n    (on d1 d2)(on d2 d3)(on d3 p3)\n  )\n  (:goal \n    (and (on d1 d2)(on d2 d3)(on d3 p1) )\n  )\n)\n```\n\nThat can be fed into a STRIPS planner and solved for, producing a set of move instructions. For example, for a `N = 6` problem, the solution produced\n\n```\n\nff: parsing domain file\ndomain 'HANOI-DOMAIN' defined\n ... done.\nff: parsing problem file\nproblem 'HANOI-6' defined\n ... done.\n\n\n\nCueing down from goal distance:    6 into depth [1]\n                                   5            [1][2][3][4]\n                                   4            [1]\n\nEnforced Hill-climbing failed !\nswitching to Best-first Search now.\n\nadvancing to distance :    6\n                           5\n                           4\n                           3\n                           2\n                           1\n                           0\n\nff: found legal plan as follows\n\nstep    0: MOVE-DISK D1 D2 P2\n        1: MOVE-DISK D2 D3 P1\n        2: MOVE-DISK D1 P2 D2\n        3: MOVE-DISK D3 D4 P2\n        4: MOVE-DISK D1 D2 D4\n        5: MOVE-DISK D2 P1 D3\n        6: MOVE-DISK D1 D4 D2\n        7: MOVE-DISK D4 D5 P1\n        8: MOVE-DISK D1 D2 D4\n        9: MOVE-DISK D2 D3 D5\n       10: MOVE-DISK D1 D4 D2\n       11: MOVE-DISK D3 P2 D4\n       12: MOVE-DISK D1 D2 P2\n       13: MOVE-DISK D2 D5 D3\n       14: MOVE-DISK D1 P2 D2\n       15: MOVE-DISK D5 D6 P2\n       16: MOVE-DISK D1 D2 D6\n       17: MOVE-DISK D2 D3 D5\n       18: MOVE-DISK D1 D6 D2\n       19: MOVE-DISK D3 D4 D6\n       20: MOVE-DISK D1 D2 D4\n       21: MOVE-DISK D2 D5 D3\n       22: MOVE-DISK D1 D4 D2\n       23: MOVE-DISK D4 P1 D5\n       24: MOVE-DISK D1 D2 D4\n       25: MOVE-DISK D2 D3 P1\n       26: MOVE-DISK D1 D4 D2\n       27: MOVE-DISK D3 D6 D4\n       28: MOVE-DISK D1 D2 D6\n       29: MOVE-DISK D2 P1 D3\n       30: MOVE-DISK D1 D6 D2\n       31: MOVE-DISK D6 P3 P1\n       32: MOVE-DISK D1 D2 D6\n       33: MOVE-DISK D2 D3 P3\n       34: MOVE-DISK D1 D6 D2\n       35: MOVE-DISK D3 D4 D6\n       36: MOVE-DISK D1 D2 D4\n       37: MOVE-DISK D2 P3 D3\n       38: MOVE-DISK D1 D4 D2\n       39: MOVE-DISK D4 D5 P3\n       40: MOVE-DISK D1 D2 D4\n       41: MOVE-DISK D2 D3 D5\n       42: MOVE-DISK D1 D4 D2\n       43: MOVE-DISK D3 D6 D4\n       44: MOVE-DISK D1 D2 D6\n       45: MOVE-DISK D2 D5 D3\n       46: MOVE-DISK D1 D6 D2\n       47: MOVE-DISK D5 P2 D6\n       48: MOVE-DISK D1 D2 P2\n       49: MOVE-DISK D2 D3 D5\n       50: MOVE-DISK D1 P2 D2\n       51: MOVE-DISK D3 D4 P2\n       52: MOVE-DISK D1 D2 D4\n       53: MOVE-DISK D2 D5 D3\n       54: MOVE-DISK D1 D4 D2\n       55: MOVE-DISK D4 P3 D5\n       56: MOVE-DISK D1 D2 D4\n       57: MOVE-DISK D2 D3 P3\n       58: MOVE-DISK D1 D4 D2\n       59: MOVE-DISK D3 P2 D4\n       60: MOVE-DISK D1 D2 P2\n       61: MOVE-DISK D2 P3 D3\n       62: MOVE-DISK D1 P2 D2\n     \n\ntime spent:    0.00 seconds instantiating 231 easy, 0 hard action templates\n               0.00 seconds reachability analysis, yielding 42 facts and 166 actions\n               0.00 seconds creating final representation with 41 relevant facts\n               0.00 seconds building connectivity graph\n               0.00 seconds searching, evaluating 334 states, to a max depth of 4\n               0.00 seconds total time\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felucidation%2Fhanoi-pddl-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felucidation%2Fhanoi-pddl-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felucidation%2Fhanoi-pddl-generator/lists"}