Skip to content

Commit

Permalink
add(tests): Added package performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Framba-Luca committed Nov 8, 2023
1 parent d4bf98a commit fa43660
Show file tree
Hide file tree
Showing 27 changed files with 1,283 additions and 0 deletions.
4 changes: 4 additions & 0 deletions up_test_cases/performance/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from functools import partial
from utils import _get_test_cases # type: ignore

get_test_cases = partial(_get_test_cases, "performance")
4 changes: 4 additions & 0 deletions up_test_cases/performance/numeric/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from functools import partial
from utils import _get_test_cases # type: ignore

get_test_cases = partial(_get_test_cases, "performance.numeric")
9 changes: 9 additions & 0 deletions up_test_cases/performance/numeric/depots/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os
from functools import partial

from utils import _get_pddl_test_cases

FILE_DIR = os.path.dirname(os.path.abspath(__file__))
PDDL_FILES_DIR = os.path.join(FILE_DIR, "pddl_files")

get_test_cases = partial(_get_pddl_test_cases, PDDL_FILES_DIR)
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
(define (domain Depot)
;(:requirements :typing :fluents)
(:types place locatable - object
depot distributor - place
truck hoist surface - locatable
pallet crate - surface)

(:predicates (at ?x - locatable ?y - place)
(on ?x - crate ?y - surface)
(in ?x - crate ?y - truck)
(lifting ?x - hoist ?y - crate)
(available ?x - hoist)
(clear ?x - surface)
)

(:functions
(load_limit ?t - truck)
(current_load ?t - truck)
(weight ?c - crate)
(fuel-cost)
)

(:action Drive
:parameters (?x - truck ?y - place ?z - place)
:precondition (and (at ?x ?y))
:effect (and (not (at ?x ?y)) (at ?x ?z)
(increase (fuel-cost) 10)))

(:action Lift
:parameters (?x - hoist ?y - crate ?z - surface ?p - place)
:precondition (and (at ?x ?p) (available ?x) (at ?y ?p) (on ?y ?z) (clear ?y))
:effect (and (not (at ?y ?p)) (lifting ?x ?y) (not (clear ?y)) (not (available ?x))
(clear ?z) (not (on ?y ?z)) (increase (fuel-cost) 1)))

(:action Drop
:parameters (?x - hoist ?y - crate ?z - surface ?p - place)
:precondition (and (at ?x ?p) (at ?z ?p) (clear ?z) (lifting ?x ?y))
:effect (and (available ?x) (not (lifting ?x ?y)) (at ?y ?p) (not (clear ?z)) (clear ?y)
(on ?y ?z)))

(:action Load
:parameters (?x - hoist ?y - crate ?z - truck ?p - place)
:precondition (and (at ?x ?p) (at ?z ?p) (lifting ?x ?y)
(<= (+ (current_load ?z) (weight ?y)) (load_limit ?z)))
:effect (and (not (lifting ?x ?y)) (in ?y ?z) (available ?x)
(increase (current_load ?z) (weight ?y))))

(:action Unload
:parameters (?x - hoist ?y - crate ?z - truck ?p - place)
:precondition (and (at ?x ?p) (at ?z ?p) (available ?x) (in ?y ?z))
:effect (and (not (in ?y ?z)) (not (available ?x)) (lifting ?x ?y)
(decrease (current_load ?z) (weight ?y))))

)
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
(define (problem depotprob7654) (:domain Depot)
(:objects
depot0 depot1 depot2 - depot
distributor0 distributor1 distributor2 - distributor
truck0 truck1 - truck
pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 - pallet
crate0 crate1 crate2 crate3 crate4 crate5 - crate
hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 - hoist)
(:init
(at pallet0 depot0)
(clear crate1)
(at pallet1 depot1)
(clear crate0)
(at pallet2 depot2)
(clear crate4)
(at pallet3 distributor0)
(clear crate5)
(at pallet4 distributor1)
(clear pallet4)
(at pallet5 distributor2)
(clear crate3)
(at truck0 depot1)
(= (current_load truck0) 0)
(= (load_limit truck0) 370)
(at truck1 depot2)
(= (current_load truck1) 0)
(= (load_limit truck1) 287)
(at hoist0 depot0)
(available hoist0)
(at hoist1 depot1)
(available hoist1)
(at hoist2 depot2)
(available hoist2)
(at hoist3 distributor0)
(available hoist3)
(at hoist4 distributor1)
(available hoist4)
(at hoist5 distributor2)
(available hoist5)
(at crate0 depot1)
(on crate0 pallet1)
(= (weight crate0) 96)
(at crate1 depot0)
(on crate1 pallet0)
(= (weight crate1) 72)
(at crate2 distributor2)
(on crate2 pallet5)
(= (weight crate2) 74)
(at crate3 distributor2)
(on crate3 crate2)
(= (weight crate3) 16)
(at crate4 depot2)
(on crate4 pallet2)
(= (weight crate4) 23)
(at crate5 distributor0)
(on crate5 pallet3)
(= (weight crate5) 42)
(= (fuel-cost) 0)
)

(:goal (and
(on crate0 crate4)
(on crate2 pallet3)
(on crate3 pallet0)
(on crate4 pallet5)
)
)

;(:metric minimize (total-time))
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
(define (problem depotprob8765) (:domain Depot)
(:objects
depot0 depot1 depot2 - depot
distributor0 distributor1 distributor2 - distributor
truck0 truck1 - truck
pallet0 pallet1 pallet2 pallet3 pallet4 pallet5 - pallet
crate0 crate1 crate2 crate3 crate4 crate5 crate6 crate7 crate8 crate9 - crate
hoist0 hoist1 hoist2 hoist3 hoist4 hoist5 - hoist)
(:init
(at pallet0 depot0)
(clear crate1)
(at pallet1 depot1)
(clear crate3)
(at pallet2 depot2)
(clear crate9)
(at pallet3 distributor0)
(clear pallet3)
(at pallet4 distributor1)
(clear pallet4)
(at pallet5 distributor2)
(clear crate8)
(at truck0 depot2)
(= (current_load truck0) 0)
(= (load_limit truck0) 336)
(at truck1 distributor0)
(= (current_load truck1) 0)
(= (load_limit truck1) 366)
(at hoist0 depot0)
(available hoist0)
(at hoist1 depot1)
(available hoist1)
(at hoist2 depot2)
(available hoist2)
(at hoist3 distributor0)
(available hoist3)
(at hoist4 distributor1)
(available hoist4)
(at hoist5 distributor2)
(available hoist5)
(at crate0 depot1)
(on crate0 pallet1)
(= (weight crate0) 42)
(at crate1 depot0)
(on crate1 pallet0)
(= (weight crate1) 6)
(at crate2 depot2)
(on crate2 pallet2)
(= (weight crate2) 74)
(at crate3 depot1)
(on crate3 crate0)
(= (weight crate3) 64)
(at crate4 depot2)
(on crate4 crate2)
(= (weight crate4) 61)
(at crate5 depot2)
(on crate5 crate4)
(= (weight crate5) 79)
(at crate6 distributor2)
(on crate6 pallet5)
(= (weight crate6) 29)
(at crate7 distributor2)
(on crate7 crate6)
(= (weight crate7) 77)
(at crate8 distributor2)
(on crate8 crate7)
(= (weight crate8) 19)
(at crate9 depot2)
(on crate9 crate5)
(= (weight crate9) 98)
(= (fuel-cost) 0)
)

(:goal (and
(on crate0 crate7)
(on crate1 pallet4)
(on crate2 pallet5)
(on crate3 crate9)
(on crate4 pallet0)
(on crate5 pallet2)
(on crate6 crate5)
(on crate7 crate1)
(on crate8 pallet3)
(on crate9 crate2)
)
)

;(:metric minimize (fuel-cost))
)
9 changes: 9 additions & 0 deletions up_test_cases/performance/numeric/farmlands/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os
from functools import partial

from utils import _get_pddl_test_cases

FILE_DIR = os.path.dirname(os.path.abspath(__file__))
PDDL_FILES_DIR = os.path.join(FILE_DIR, "pddl_files")

get_test_cases = partial(_get_pddl_test_cases, PDDL_FILES_DIR)
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
;;Setting seed to 1229
;; Enrico Scala (enricos83@gmail.com) and Miquel Ramirez (miquel.ramirez@gmail.com)
(define (problem instance_10_1000_1229_ladder)
(:domain farmland)
(:objects
farm0 farm1 farm2 farm3 farm4 farm5 farm6 farm7 farm8 farm9 - farm
)
(:init
(= (x farm0) 1)
(= (x farm1) 1000)
(= (x farm2) 0)
(= (x farm3) 0)
(= (x farm4) 0)
(= (x farm5) 1)
(= (x farm6) 1)
(= (x farm7) 0)
(= (x farm8) 0)
(= (x farm9) 0)

(adj farm0 farm1)
(adj farm0 farm5)
(adj farm1 farm0)
(adj farm1 farm2)
(adj farm1 farm6)
(adj farm2 farm1)
(adj farm2 farm3)
(adj farm2 farm7)
(adj farm3 farm8)
(adj farm3 farm2)
(adj farm3 farm4)
(adj farm4 farm9)
(adj farm4 farm3)
(adj farm5 farm0)
(adj farm5 farm6)
(adj farm6 farm1)
(adj farm6 farm5)
(adj farm6 farm7)
(adj farm7 farm8)
(adj farm7 farm2)
(adj farm7 farm6)
(adj farm8 farm9)
(adj farm8 farm3)
(adj farm8 farm7)
(adj farm9 farm8)
(adj farm9 farm4)

(= (cost) 0)
)
(:goal
(and
(>= (x farm0) 1)
(>= (x farm1) 1)
(>= (x farm2) 1)
(>= (x farm3) 1)
(>= (x farm4) 1)
(>= (x farm5) 1)
(>= (x farm6) 1)
(>= (x farm7) 1)
(>= (x farm8) 1)
(>= (x farm9) 1)

(>= (+ (* 1.7 (x farm0))(+ (* 1.0 (x farm1))(+ (* 1.3 (x farm2))(+ (* 1.1 (x farm3))(+ (* 1.4 (x farm4))(+ (* 1.9 (x farm5))(+ (* 1.3 (x farm6))(+ (* 1.4 (x farm7))(+ (* 1.4 (x farm8))(+ (* 1.1 (x farm9)) 0)))))))))) 1400.0)
)
)
)


Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
;;Setting seed to 1229
;; Enrico Scala (enricos83@gmail.com) and Miquel Ramirez (miquel.ramirez@gmail.com)
(define (problem instance_10_400_1229_ladder)
(:domain farmland)
(:objects
farm0 farm1 farm2 farm3 farm4 farm5 farm6 farm7 farm8 farm9 - farm
)
(:init
(= (x farm0) 1)
(= (x farm1) 400)
(= (x farm2) 0)
(= (x farm3) 0)
(= (x farm4) 0)
(= (x farm5) 1)
(= (x farm6) 1)
(= (x farm7) 0)
(= (x farm8) 0)
(= (x farm9) 0)

(adj farm0 farm1)
(adj farm0 farm5)
(adj farm1 farm0)
(adj farm1 farm2)
(adj farm1 farm6)
(adj farm2 farm1)
(adj farm2 farm3)
(adj farm2 farm7)
(adj farm3 farm8)
(adj farm3 farm2)
(adj farm3 farm4)
(adj farm4 farm9)
(adj farm4 farm3)
(adj farm5 farm0)
(adj farm5 farm6)
(adj farm6 farm1)
(adj farm6 farm5)
(adj farm6 farm7)
(adj farm7 farm8)
(adj farm7 farm2)
(adj farm7 farm6)
(adj farm8 farm9)
(adj farm8 farm3)
(adj farm8 farm7)
(adj farm9 farm8)
(adj farm9 farm4)

(= (cost) 0)
)
(:goal
(and
(>= (x farm0) 1)
(>= (x farm1) 1)
(>= (x farm2) 1)
(>= (x farm3) 1)
(>= (x farm4) 1)
(>= (x farm5) 1)
(>= (x farm6) 1)
(>= (x farm7) 1)
(>= (x farm8) 1)
(>= (x farm9) 1)

(>= (+ (* 1.7 (x farm0))(+ (* 1.0 (x farm1))(+ (* 1.3 (x farm2))(+ (* 1.1 (x farm3))(+ (* 1.4 (x farm4))(+ (* 1.9 (x farm5))(+ (* 1.3 (x farm6))(+ (* 1.4 (x farm7))(+ (* 1.4 (x farm8))(+ (* 1.1 (x farm9)) 0)))))))))) 560.0)
)
)
)


Loading

0 comments on commit fa43660

Please sign in to comment.