Skip to content

Commit

Permalink
New test and example plus changed test in yaml file to use right vers…
Browse files Browse the repository at this point in the history
…ion of up-enhsp for testing purposes
  • Loading branch information
Enrico Scala committed Oct 10, 2024
1 parent fc12ae3 commit 168c1b5
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
up_tamer_commit: "fba59b93ed7a85370f4bbf0dc5310bbeffce05b7"
up_pyperplan_commit: "a24854213caf5038e1540e31613d24b93825fbb3"
up_fast_downward_commit: "c60b6ab82cb8c3046cfd4782afe4d4c6071c4109"
up_enhsp_commit: "f689d3b65bed921bed35c61b468ca771ae6f54a2"
up_enhsp_commit: "36894fb546336e5e0814da517ff582cd7c67ef3c"
up_fmap_commit: "f29e66c8483abcb8f17ff1c46a0745ee9b1e95fa"

jobs:
Expand Down
1 change: 0 additions & 1 deletion unified_planning/test/examples/processes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from unified_planning.shortcuts import *
from unified_planning.model.action import Process
from unified_planning.io import PDDLReader, PDDLWriter


on = Fluent("on")
Expand Down
73 changes: 73 additions & 0 deletions unified_planning/test/pddl/car_nl/d.pddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
;; Enrico Scala ([email protected]) and Miquel Ramirez ([email protected])
(define
(domain car_nonlinear_mt_sc)

(:predicates
(engine_running)
(engine_stopped)
)

(:functions
(d)
(v)
(a)
(drag_coefficient)
(max_acceleration)
(min_acceleration)
)

(:action accelerate
:parameters ()
:precondition (and (< (a) (max_acceleration)) (engine_running) )
:effect (increase (a) 1.0) ;;
)

(:action stop_car
:parameters ()
:precondition (and (> (v) -0.1) (< (v) 0.1) (= (a) 0.0) (engine_running))
:effect (and
(assign (v) 0.0)
(engine_stopped)
(not (engine_running))
)

)

(:action start_car
:parameters ()
:precondition (engine_stopped)
:effect (and
(engine_running)
(not (engine_stopped))
)
)


(:action decelerate
:parameters ()
:precondition (and (> (a) (min_acceleration)) (engine_running))
:effect (decrease (a) 1.0) ;;
)

(:process displacement
:parameters ()
:precondition (and (engine_running) (> (v) 0))
:effect (increase (d) (* #t (v)))
)

(:process moving_acceleration
:parameters ()
:precondition (engine_running)
:effect (and
(increase (v) (* #t (a)) ) ;; velocity changes because of the acceleration
)
)
(:process drag_ahead
:parameters ()
:precondition (and (engine_running) (> (v) 0))
:effect (and
(decrease (v) (* #t (* (* (v) (v)) (drag_coefficient) ) ) ) ;; velocity changes because of the acceleration
)
)

)
24 changes: 24 additions & 0 deletions unified_planning/test/pddl/car_nl/p.pddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
;; Enrico Scala ([email protected]) and Miquel Ramirez ([email protected])

(define (problem instance_1_300_01_100)
(:domain car_nonlinear_mt_sc)

(:init
(= (d) 0.0)
(= (v) 0.0)
(engine_stopped)
(= (a) 0.0)
(= (max_acceleration) 1)
(= (min_acceleration) -1)
(= (drag_coefficient) 0.1)
(= (max_speed) 10.0)
)

(:goal
(and
(>= (d) 29.5 )
(<= (d) 30.5 )
(engine_stopped)
)
)
)

0 comments on commit 168c1b5

Please sign in to comment.