-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add PDDL * Update lib/linguist/languages.yml Co-authored-by: Colin Seymour <colin@github.com> * remove large examples * Add PDDL to README Co-authored-by: Colin Seymour <colin@github.com>
- Loading branch information
Showing
9 changed files
with
346 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
(define (domain search-and-rescure-scenario) | ||
|
||
(:requirements :strips :typing :fluents :disjunctive-preconditions :durative-actions) | ||
|
||
(:types drone package location dronezones) | ||
|
||
(:constants Area1 Area2 Area3 Area4 - location) | ||
|
||
(:functions | ||
(total-cost) | ||
) | ||
|
||
(:predicates | ||
(drone-empty ?d - drone) | ||
(holding ?d - drone ?p - package) | ||
(at-drone ?d - drone ?l - location) | ||
(at-package ?p - package ?l - location) | ||
(drone-ground ?d - drone) | ||
(drone-fly ?d - drone) | ||
(location-available ?l - location) | ||
(location-available-drone ?d - drone ?l -location) | ||
|
||
) | ||
|
||
(:durative-action TAKEOFF | ||
:parameters (?d - drone ?l - location) | ||
:duration ( = ?duration 5) | ||
:condition (and (at start (drone-ground ?d)) | ||
(at start(location-available-drone ?d ?l)) | ||
(over all(at-drone ?d ?l)) | ||
(at start(at-drone ?d ?l)) | ||
) | ||
:effect (and (at start(not (drone-ground ?d))) | ||
(at end(drone-fly ?d)) | ||
(at start(not (location-available ? l))) | ||
(at start(not(location-available-drone ?d ?l))) | ||
(at start(increase (total-cost) 10)) | ||
) | ||
) | ||
|
||
(:durative-action LAND | ||
:parameters (?d - drone ?l - location) | ||
:duration ( = ?duration 5) | ||
:condition (and (at start(drone-fly ?d)) | ||
(at start(location-available-drone ?d ?l)) | ||
(over all(at-drone ?d ?l)) | ||
(at start(at-drone ?d ?l)) | ||
) | ||
:effect (and (at end(drone-ground ?d)) | ||
(at start(not (drone-fly ?d))) | ||
(at start(increase (total-cost) 10)) | ||
) | ||
|
||
) | ||
|
||
|
||
(:durative-action LOAD | ||
:parameters (?d - drone ?p - package ?l - location) | ||
:duration (= ?duration 5) | ||
:condition (and (over all(at-drone ?d ?l)) | ||
(at start(drone-empty ?d)) | ||
(at start(at-package ?p ?l)) | ||
(over all(drone-ground ?d))) | ||
:effect (and (at end(holding ?d ?p)) | ||
(at start(not (drone-empty ?d))) | ||
(at start(not (location-available ? l))) | ||
(at start(not (at-package ?p ?l))) | ||
(at start(increase (total-cost) 10)) | ||
) | ||
) | ||
|
||
(:durative-action UNLOAD | ||
:parameters (?d - drone ?p - package ?l - location) | ||
:duration (= ?duration 5) | ||
:condition (and (over all(at-drone ?d ?l)) | ||
(at start(holding ?d ?p)) | ||
(over all(drone-ground ?d))) | ||
:effect (and (at start(not (holding ?d ?p))) | ||
(at end(drone-empty ?d)) | ||
(at end(at-package ?p ?l)) | ||
(at start(increase (total-cost) 10)) | ||
) | ||
) | ||
|
||
(:durative-action MOVE | ||
:parameters (?d - drone ?from ?to - location) | ||
:duration (= ?duration 5) | ||
:condition (and (at start(at-drone ?d ?from)) | ||
(over all(drone-fly ?d)) | ||
(at start(location-available ?to)) | ||
) | ||
:effect (and (at start(not(at-drone ?d ?from))) | ||
(at end(at-drone ?d ?to)) | ||
(at start(not (location-available ?to))) | ||
(at start(location-available ?from)) | ||
(at end(location-available-drone ?d ?to)) | ||
(at start(increase (total-cost) 10)) | ||
) | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
;;Domain for cleaning floor tiles | ||
;; A domain file for CMP2020M assignment 2018/2019 | ||
;;Myles Leslie 15614035 | ||
|
||
;; Define the name for this domain (needs to match the domain definition | ||
;; in the problem files) | ||
|
||
(define (domain floor-tile) | ||
|
||
;; We only require some typing to make this plan faster. We can do without! | ||
(:requirements :typing) | ||
|
||
;; We have two types: robots and the tiles, both are objects | ||
(:types robot tile - object) | ||
|
||
;; define all the predicates as they are used in the probem files | ||
(:predicates | ||
|
||
;; described what tile a robot is at | ||
(robot-at ?r - robot ?x - tile) | ||
|
||
;; indicates that tile ?x is above tile ?y | ||
(up ?x - tile ?y - tile) | ||
|
||
;; indicates that tile ?x is below tile ?y | ||
(down ?x - tile ?y - tile) | ||
|
||
;; indicates that tile ?x is right of tile ?y | ||
(right ?x - tile ?y - tile) | ||
|
||
;; indicates that tile ?x is left of tile ?y | ||
(left ?x - tile ?y - tile) | ||
|
||
;; indicates that a tile is clear (robot can move there) | ||
(clear ?x - tile) | ||
|
||
;; indicates that a tile is cleaned | ||
(cleaned ?x - tile) | ||
) | ||
|
||
;; ACTIONS that need to be defined: | ||
;; defining actions - if tile is cleaned below the robot | ||
(:action clean-down | ||
|
||
;; find what tile the robot is at and the where the tile it's going to is | ||
:parameters (?r - robot ?x - tile ?y - tile) | ||
|
||
;; find if the tile is below the robot and if it's cleaned | ||
:precondition (and( down ?y ?x)(robot-at ?r ?x) (not(cleaned ?y))) | ||
|
||
;; if not cleaned then clean | ||
:effect (and(cleaned ?y)) | ||
) | ||
|
||
(:action clean-up | ||
|
||
;; find what tile the robot is at and the where the tile it's going to is | ||
:parameters (?r - robot ?x - tile ?y - tile) | ||
|
||
;; find if the tile is above the robot and if it's cleaned | ||
:precondition (and ( up ?y ?x) (robot-at ?r ?x) (not(cleaned ?y))) | ||
|
||
;; if not cleaned then clean | ||
:effect (and(cleaned ?y)) | ||
) | ||
|
||
;; all further actions are the same except the direction the robot is going | ||
;;when there is a tile below | ||
(:action down | ||
|
||
;; find what tile the robot is at and the where the tile it's going to is | ||
:parameters (?r - robot ?x - tile ?y - tile) | ||
|
||
;; find if the tile is below the robot, checks if it's clear and if it's cleaned or not | ||
:precondition (and (down ?y ?x )(robot-at ?r ?x ) (clear ?y )(not(cleaned?y))) | ||
|
||
;; robot moves to tile if it's clear and doesn't if it isn't clear. | ||
:effect (and (robot-at ?r ?y) (not(robot-at ?r ?x)) (not (clear ?y)) (clear ?x)) | ||
) | ||
|
||
;;when there is a tile above the robot | ||
(:action up | ||
|
||
;; find what tile the robot is at and the where the tile it's going to is | ||
:parameters (?r - robot ?x - tile ?y - tile) | ||
|
||
;;find if the tile is above the robot, checks if it's clear and if it's cleaned or not | ||
:precondition (and (up ?y ?x )(robot-at ?r ?x ) (clear ?y )(not(cleaned?y))) | ||
|
||
;;robot moves to tile if it's clear and doesn't if it isn't clear. | ||
:effect (and (robot-at ?r ?y) (not(robot-at ?r ?x)) (not (clear ?y)) (clear ?x)) | ||
) | ||
|
||
;;when there is a tile to the left | ||
(:action left | ||
|
||
;; find what tile the robot is at and the where the tile it's going to is | ||
:parameters (?r - robot ?x - tile ?y - tile) | ||
|
||
;;find if the tile is to the left of the robot, checks if it's clear and if it's cleaned or not | ||
:precondition (and (left ?y ?x )(robot-at ?r ?x ) (clear ?y )(not(cleaned?y))) | ||
|
||
;;robot moves to tile if it's clear and doesn't if it isn't clear. | ||
:effect (and (robot-at ?r ?y) (not(robot-at ?r ?x)) (not (clear ?y)) (clear ?x)) | ||
) | ||
|
||
;;when there is a tile to the right | ||
(:action right | ||
|
||
;; find what tile the robot is at and the where the tile it's going to is | ||
:parameters (?r - robot ?x - tile ?y - tile) | ||
|
||
;;find if the tile is to the right of the robot, checks if it's clear and if it's cleaned or not | ||
:precondition (and (right ?y ?x )(robot-at ?r ?x ) (clear ?y )(not(cleaned?y))) | ||
|
||
;;robot moves to tile if it's clear and doesn't if it isn't clear. | ||
:effect (and (robot-at ?r ?y) (not(robot-at ?r ?x)) (not (clear ?y)) (clear ?x)) | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
(define (problem search-and-rescure-scenario_task) | ||
(:domain search-and-rescure-scenario) | ||
(:objects | ||
drone1 drone2 drone3 drone4 - drone | ||
RZ1 RZ2 RZ3 RZ4 - location | ||
water1 water2 food1 food2 medicine1 - package | ||
) | ||
(:init | ||
(at-drone drone1 Area1) | ||
(at-drone drone2 Area2) | ||
(at-drone drone3 Area3) | ||
(at-drone drone4 Area4) | ||
|
||
(at-package water1 Area1) | ||
(at-package water2 Area1) | ||
(at-package food1 Area2) | ||
(at-package food2 Area3) | ||
(at-package medicine1 Area4) | ||
|
||
(drone-empty drone1) | ||
(drone-empty drone2) | ||
(drone-empty drone3) | ||
(drone-empty drone4) | ||
|
||
(drone-ground drone1) | ||
(drone-ground drone2) | ||
(drone-ground drone3) | ||
(drone-ground drone4) | ||
|
||
(location-available-drone drone1 Area1) | ||
(location-available-drone drone1 Area2) | ||
(location-available-drone drone1 Area3) | ||
(location-available-drone drone1 Area4) | ||
|
||
(location-available-drone drone2 Area1) | ||
(location-available-drone drone2 Area2) | ||
(location-available-drone drone2 Area3) | ||
(location-available-drone drone2 Area4) | ||
|
||
(location-available-drone drone3 Area1) | ||
(location-available-drone drone3 Area2) | ||
(location-available-drone drone3 Area3) | ||
(location-available-drone drone3 Area4) | ||
|
||
(location-available-drone drone4 Area1) | ||
(location-available-drone drone4 Area2) | ||
(location-available-drone drone4 Area3) | ||
(location-available-drone drone4 Area4) | ||
|
||
(location-available Area1) | ||
(location-available Area2) | ||
(location-available Area3) | ||
(location-available Area4) | ||
(location-available RZ1) | ||
(location-available RZ2) | ||
(location-available RZ3) | ||
(location-available RZ4) | ||
|
||
(= (total-cost) 0) | ||
) | ||
(:goal (and | ||
(at-package water1 RZ1) | ||
(at-package water2 RZ3) | ||
(at-package medicine1 RZ2) | ||
(at-package food2 RZ2) | ||
(at-package food1 RZ4) | ||
(at-drone drone1 Area1) | ||
(at-drone drone2 Area2) | ||
(drone-ground drone1) | ||
(drone-ground drone2) | ||
(at-drone drone3 Area3) | ||
(at-drone drone4 Area4) | ||
(drone-ground drone3) | ||
(drone-ground drone4) | ||
)) | ||
|
||
(:metric minimize (total-cost)) | ||
|
||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule vscode-pddl
added at
24a073
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
name: vscode-pddl | ||
version: 24a0736f1f247a986593c923ebd4235125d157d7 | ||
type: git_submodule | ||
homepage: https://github.com/jan-dolejsi/vscode-pddl.git | ||
license: mit | ||
licenses: | ||
- sources: LICENSE | ||
text: | | ||
MIT License | ||
Copyright (c) 2017 jan-dolejsi | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
notices: [] |