Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
intro-HTN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
saclab
ssa
intro-HTN
Commits
288ed55b
Commit
288ed55b
authored
Oct 17, 2024
by
GATEAU Thibault
Browse files
Options
Downloads
Patches
Plain Diff
[hddl] adding example
parent
d6db12f4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
TP02/cooking_domain.hddl
+245
-0
245 additions, 0 deletions
TP02/cooking_domain.hddl
TP02/cooking_problem.hddl
+60
-0
60 additions, 0 deletions
TP02/cooking_problem.hddl
with
305 additions
and
0 deletions
TP02/cooking_domain.hddl
0 → 100644
+
245
−
0
View file @
288ed55b
(define (domain cooking)
(:requirements :typing)
(:types
location - object
ingredient - object
agent - object
)
(:predicates
(at ?a - agent ?x - location)
(isIdle ?a - agent)
(isChoppedOnion ?i - ingredient)
(isChopLoc ?l - location)
(isOnion ?i - ingredient)
(isCookLoc ?l - location)
(recipie ?o1 ?o2 ?o3 ?s - ingredient)
(recipie ?o ?co - ingredient)
(deliveryloc ?l - location)
(isReadyToServe ?i - ingredient)
(isServed ?i - ingredient)
(isActive ?a - agent)
(notenoughingredients)
)
(:task goto
:parameters (?a - agent ?l - location)
)
(:task deliver_foods
:parameters (?a - agent)
)
(:task deliver_food
:parameters (?a - agent)
)
(:task cookrecipe
:parameters (?a - agent)
)
(:task deliver_ingredient
:parameters (?i - ingredient ?l - location)
)
(:task prepare_ingredients
:parameters (?i - ingredient)
)
(:task prepare_ingredient
:parameters (?i - ingredient)
)
(:method m_deliver_food_ready
:parameters (?a - agent ?l - location ?i - ingredient)
:task (deliver_food ?a)
:precondition (and
(deliveryloc ?l)
(isReadyToServe ?i)
)
:subtasks (and
(goto ?a ?l)
(serve ?a ?i ?l)
)
)
(:method m_deliver_food_stop
:parameters (?a - agent)
:task (deliver_food ?a)
:precondition (and
)
:subtasks (and
(stop ?a)
)
)
(:method m_deliver_foods_notAnyFood
:parameters (?a - agent ?l - location)
:task (deliver_foods ?a)
:precondition (and
(not-enough-ingredients)
(at ?a ?l)
)
:subtasks (and
(idle ?a ?l) ;; can be removed
)
)
(:method m_deliver_foods_loop
:parameters (?a - agent)
:task (deliver_foods ?a)
:precondition (and
(isActive ?a)
)
:subtasks (and
(deliver_food ?a)
(deliver_foods ?a)
;;(deliver_food ?a)
;;(deliver_food ?a)
;;(deliver_food ?a)
;;(deliver_food ?a)
)
)
(:method m_goto_already_there
:parameters (?a - agent ?l - location)
:task (goto ?a ?l)
:precondition (at ?a ?l)
:subtasks (and
(idle ?a ?l) ;; can be removed
)
)
(:method m_ingredient_there
:parameters (?i - ingredient ?l - location)
:task (deliver_ingredient ?i ?l)
:precondition (at ?i ?l)
:subtasks ()
)
;;====== ACTIONS ===============================================
(:action idle
:parameters (?a - agent ?l - location)
:precondition (and
)
:effect (and (isIdle ?a))
)
(:action yes
:parameters ()
:precondition (and
)
:effect ()
)
(:action move
:parameters (?a - agent ?from ?to - location)
:precondition (and
(at ?a ?from)
)
:effect (and (not (at ?a ?from)) (at ?a ?to))
)
(:action pickup
:parameters (?a - agent ?i - ingredient ?l - location)
:precondition (and
(at ?i ?l)
(at ?a ?l)
)
:effect (and
(not (at ?i ?l))
(ingredient-pickedByAgent ?a ?i)
)
)
(:action drop
:parameters (?a - agent ?i - ingredient ?l - location)
:precondition (and
(ingredient-pickedByAgent ?a ?i)
(at ?a ?l)
)
:effect (and
(not (ingredient-pickedByAgent ?a ?i))
(at ?i ?l)
)
)
(:action stop
:parameters (?a - agent)
:precondition (and
)
:effect (and
(not-enough-ingredients)
(not (isActive ?a))
)
)
(:action chop
:parameters (?a - agent ?i - ingredient ?l - location)
:precondition (and
(at ?a ?l)
(at ?i ?l)
(isChopLoc ?l)
)
:effect (and
(isChoppedOnion ?i))
)
(:action cook
:parameters (?a - agent ?o1 ?o2 ?o3 ?s - ingredient ?l - location)
:precondition (and
(at ?a ?l)
(isCookLoc ?l)
(isChoppedOnion ?o1)
(isChoppedOnion ?o2)
(isChoppedOnion ?o3)
(at ?o1 ?l)
(at ?o2 ?l)
(at ?o3 ?l)
)
:effect (and
(not (isChoppedOnion ?o1))
(not (isChoppedOnion ?o2))
(not (isChoppedOnion ?o3))
(not (at ?o1 ?l))
(not (at ?o2 ?l))
(not (at ?o3 ?l))
(isReadyToServe ?s)
(at ?s ?l)
)
)
(:action serve
:parameters (?a - agent ?i - ingredient ?l - location)
:precondition (and
(at ?a ?l)
(deliveryloc ?l)
(isReadyToServe ?i)
)
:effect (and
(isServed ?i)
(not (isReadyToServe ?i))
)
)
(:action get_position
:parameters (?a - agent ?l - location)
:precondition (and
(at ?a ?l)
)
:effect (and
)
)
)
This diff is collapsed.
Click to expand it.
TP02/cooking_problem.hddl
0 → 100644
+
60
−
0
View file @
288ed55b
(define (problem cookSoup) (:domain cooking)
(:objects
centerloc choploc deliveryloc stockloc faraway cookLoc - location
a1 - agent
onion1 onion2 onion3 onion4 onion5 onion6 soup soupAlreadyReady soupFromRaw - ingredient
)
(:htn
;;:tasks (and (deliver_food a1)(deliver_food a1))
:tasks (and (deliver_foods a1))
:ordering ()
:constraints ()
)
(:init
(at a1 deliveryloc)
;(at a1 faraway)
(at onion1 cookLoc)
(at onion2 stockloc)
(at onion3 stockloc)
(at onion4 stockloc)
(at onion5 stockloc)
(at onion6 stockloc)
(isReadyToServe soupAlreadyReady)
(at soupAlreadyReady deliveryloc)
;(at soupAlreadyReady cookLoc)
(isChoppedOnion onion1)
(isChoppedOnion onion2)
(isChoppedOnion onion3)
(isChoppedOnion onion4)
(isChopLoc choploc)
(isCookLoc cookLoc)
(deliveryloc deliveryloc)
(connected centerloc cookLoc)
(connected cookLoc centerloc)
(connected centerloc choploc)
(connected choploc centerloc)
(connected centerloc stockloc)
(connected stockloc centerloc)
(connected centerloc deliveryloc)
(connected deliveryloc centerloc)
(connected deliveryloc faraway)
(connected faraway deliveryloc)
(recipie onion1 onion2 onion3 soup)
(recipie onion4 onion5 onion6 soupFromRaw)
(isActive a1)
;;(not-enough-ingredients)
)
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment