Skip to content
Snippets Groups Projects
Commit 4b6ff779 authored by GATEAU Thibault's avatar GATEAU Thibault
Browse files

pushing end TP

parent 5226c408
Branches
No related tags found
No related merge requests found
(define (problem gotoAirport) (:domain travel)
(:objects home park airport - location
)
(:htn
:tasks (and (travel home park) (travel park airport))
:ordering ()
:constraints ()
)
(:init
(at home)
(shortDistance home park)
(shortDistance park home)
)
)
(define (problem gotoAirport) (:domain travel)
(:objects home park airport - location
)
(:htn
:tasks (and (travel home airport))
:ordering ()
:constraints ()
)
(:init
(at home)
(shortDistance home park)
(shortDistance park home)
)
)
(define (problem gotoPark) (:domain travel)
(:objects home park - location
)
(:htn
:tasks (and (travel home park))
:ordering ()
:constraints ()
)
(:init
(at home)
(shortDistance home park)
)
)
### Writing some tasks, methods and litterals
plan travelWalkTaxi.hddl gotoAirport_problem.hddl debug
plan travelWalkTaxi.hddl gotoAirportFromPark_problem.hddl debug
plan travelWalkTaxiCost.hddl travelWalkTaxiCost_problem.hddl debug
plan travelManyPlaces.hddl travelManyPlaces_problem.hddl debug
(define (domain travel)
(:requirements :typing)
(:types
location - object
Money - object
)
(:predicates
(at ?x - object)
(hasTaxi ?x - object)
(shortDistance ?x ?y - object)
(next ?arg0 ?arg1 - Money)
(money-level ?arg0 - Money)
(cashMachinePresent ?x - object)
)
(:task travel :parameters (?from - object ?to - object))
(:method travel-by-foot
:parameters (?x ?y - location)
:task (travel ?x ?y)
:precondition (and (at ?x) (shortDistance ?x ?y))
:ordered-subtasks (and (walk ?x ?y)))
(:method travel-by-taxi
:parameters (?x ?y - object ?l2 ?l1 - Money)
:task (travel ?x ?y)
:precondition (and
(at ?x)
(next ?l2 ?l1)
)
:ordered-subtasks (and (getTaxi ?x) (rideTaxi ?x ?y) (pay_driver ?l2 ?l1))
)
(:method getCash-travel
:parameters (?x ?y ?z - object ?l1 ?l2 - Money)
:task (travel ?x ?y)
:precondition (and
(at ?x)
(money-level ?l1)
(next ?l2 ?l1)
(cashMachinePresent ?z)
(shortDistance ?x ?z)
)
:ordered-subtasks (and
(travel ?x ?z)
(getCash ?z ?l1 ?l2)
(travel ?z ?y)
)
)
(:action walk
:parameters (?x ?y - object)
:precondition (and
(at ?x)
(shortDistance ?x ?y)
)
:effect (and (not (at ?x)) (at ?y))
;:cost 0
)
(:action getCash
:parameters (?x - object ?l1 ?l2 - Money )
:precondition (and
(at ?x)
(cashMachinePresent ?x)
(money-level ?l1)
(next ?l2 ?l1)
)
:effect (and
(money-level ?l2)
)
;:cost 0
)
(:action getTaxi
:parameters (?x - object)
:precondition (and (at ?x)
)
:effect (and (hasTaxi ?x))
;:cost 0
)
(:action rideTaxi
:parameters (?x ?y - object)
:precondition (and (at ?x)
(hasTaxi ?x)
)
:effect (and (not (at ?x)) (not (hasTaxi ?x)) (at ?y))
;:cost 2
)
(:action pay_driver
:parameters (?l2 - Money ?l1 - Money)
:precondition (and
(money-level ?l2)
)
:effect (and
(not (money-level ?l2))
(money-level ?l1)
)
;:cost 2
)
)
(define (problem gotoAirport) (:domain travel)
(:objects home park airport museum cashMachine - location
$0 $20 $40 $60 - Money
)
(:htn
:tasks (and
(travel home park)
;(travel park airport)
(travel park museum)
(travel museum airport)
)
:ordering ()
:constraints ()
)
(:init
(at home)
(cashMachinePresent cashMachine)
(next $60 $40)
(next $40 $20)
(next $20 $0)
(shortDistance home park)
(shortDistance park home)
(shortDistance park cashMachine)
(shortDistance cashMachine park)
(shortDistance museum cashMachine)
(shortDistance cashMachine museum)
;(money-level $60)
(money-level $0)
)
)
(define (domain travel)
(:requirements :typing)
(:types
location - object
)
(:predicates
(at ?x - object)
(hasTaxi ?x - object)
(shortDistance ?x ?y - object)
)
(:task travel :parameters (?from - object ?to - object))
(:method travel-by-foot
:parameters (?x ?y - location)
:task (travel ?x ?y)
:precondition (and (at ?x) (shortDistance ?x ?y))
:ordered-subtasks (and (walk ?x ?y)))
(:method travel-by-taxi
:parameters (?x ?y - object)
:task (travel ?x ?y)
:precondition (and (at ?x) )
:ordered-subtasks (and (getTaxi ?x) (rideTaxi ?x ?y)))
(:action walk
:parameters (?x ?y - object)
:precondition (and
(at ?x)
(shortDistance ?x ?y)
)
:effect (and (not (at ?x)) (at ?y))
)
(:action getTaxi
:parameters (?x - object)
:precondition (and (at ?x) )
:effect (and (hasTaxi ?x))
)
(:action rideTaxi
:parameters (?x ?y - object)
:precondition (and (at ?x)
(hasTaxi ?x)
)
:effect (and (not (at ?x)) (not (hasTaxi ?x)) (at ?y))
)
)
File added
(define (domain travel)
(:requirements :typing)
(:types
location - object
Money - object
)
(:predicates
(at ?x - object)
(hasTaxi ?x - object)
(shortDistance ?x ?y - object)
(next ?arg0 ?arg1 - Money)
(money-level ?arg0 - Money)
)
(:task travel :parameters (?from - object ?to - object))
(:method travel-by-foot
:parameters (?x ?y - location)
:task (travel ?x ?y)
:precondition (and (at ?x) (shortDistance ?x ?y))
:ordered-subtasks (and (walk ?x ?y)))
(:method travel-by-taxi
:parameters (?x ?y - object ?l2 ?l1 - Money)
:task (travel ?x ?y)
:precondition (and
(at ?x)
(next ?l2 ?l1)
)
:ordered-subtasks (and (getTaxi ?x) (rideTaxi ?x ?y) (pay_driver ?l2 ?l1))
)
(:action walk
:parameters (?x ?y - object)
:precondition (and
(at ?x)
(shortDistance ?x ?y)
)
:effect (and (not (at ?x)) (at ?y))
;:cost 0
)
(:action getTaxi
:parameters (?x - object)
:precondition (and (at ?x)
)
:effect (and (hasTaxi ?x))
;:cost 0
)
(:action rideTaxi
:parameters (?x ?y - object)
:precondition (and (at ?x)
(hasTaxi ?x)
)
:effect (and (not (at ?x)) (not (hasTaxi ?x)) (at ?y))
;:cost 2
)
(:action pay_driver
:parameters (?l2 - Money ?l1 - Money)
:precondition (and
(money-level ?l2)
)
:effect (and
(not (money-level ?l2))
(money-level ?l1)
)
;:cost 2
)
)
(define (domain travel)
(:requirements :typing)
(:types
location - object
Money - object
)
(:predicates
(at ?x - object)
(hasTaxi ?x - object)
(shortDistance ?x ?y - object)
(next ?arg0 ?arg1 - Money)
(money-level ?arg0 - Money)
)
(:task travel :parameters (?from - object ?to - object))
(:method travel-by-foot
:parameters (?x ?y - location)
:task (travel ?x ?y)
:precondition (and (at ?x) (shortDistance ?x ?y))
:ordered-subtasks (and (walk ?x ?y)))
(:method travel-by-taxi
:parameters (?x ?y - object ?l2 ?l1 - Money)
:task (travel ?x ?y)
:precondition (and
(at ?x)
(next ?l2 ?l1)
)
:ordered-subtasks (and (getTaxi ?x) (rideTaxi ?x ?y) (pay_driver ?l2 ?l1))
)
(:action walk
:parameters (?x ?y - object)
:precondition (and
(at ?x)
(shortDistance ?x ?y)
)
:effect (and (not (at ?x)) (at ?y))
;:cost 0
)
(:action getTaxi
:parameters (?x - object)
:precondition (and (at ?x)
)
:effect (and (hasTaxi ?x))
;:cost 0
)
(:action rideTaxi
:parameters (?x ?y - object)
:precondition (and (at ?x)
(hasTaxi ?x)
)
:effect (and (not (at ?x)) (not (hasTaxi ?x)) (at ?y))
;:cost 2
)
(:action pay_driver
:parameters (?l2 - Money ?l1 - Money)
:precondition (and
(money-level ?l2)
)
:effect (and
(not (money-level ?l2))
(money-level ?l1)
)
;:cost 2
)
)
(define (problem gotoAirport) (:domain travel)
(:objects home park airport - location
$0 $20 $40 $60 - Money
)
(:htn
:tasks (and (travel home park) (travel park airport))
:ordering ()
:constraints ()
)
(:init
(at home)
(next $60 $40)
(next $40 $20)
(next $20 $0)
(shortDistance home park)
(shortDistance park home)
(money-level $60)
)
)
(define (problem gotoAirport) (:domain travel)
(:objects home park airport - location
$0 $20 $40 $60 - Money
)
(:htn
:tasks (and (travel home park) (travel park airport))
:ordering ()
:constraints ()
)
(:init
(at home)
(next $60 $40)
(next $40 $20)
(next $20 $0)
(shortDistance home park)
(shortDistance park home)
(money-level $60)
)
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment