Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDDL-based Goal Formulation Preconditions for the Decentral Agent #493

Draft
wants to merge 45 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a4a532d
rcll: extend domain for use with pddl-based goal preconditions
snoato Nov 3, 2021
7efde7d
goal-class: add goal classes for DELIVER, PRODUCE-C0 and CLEAR-BS
snoato Nov 3, 2021
5ec8b0e
cx: remove old groundings from plan-action preconditions
snoato Nov 3, 2021
60e7692
refbox-worldmodel: prioritize gamestate messages to keep time in synch
snoato Nov 12, 2021
a1590ac
rcll: add predicate to indicate machine sides for grounding purposes
snoato Nov 12, 2021
b023f1b
rcll: add predicate to indicate if an order has any workpiece assigned
snoato Nov 12, 2021
3ed0c3b
plan-actions: move action timer to noop-actions to resolve loading co…
snoato Nov 12, 2021
c425855
rcll: add minimum execution time for noops to enable consistent DB up…
snoato Nov 12, 2021
59d6141
fawkes: udpate submodule pointer
snoato Nov 12, 2021
141e0d4
rcll: fix typo in domain predicate
snoato Nov 12, 2021
c2cbfe7
goal-class: update goal-class assertion to decrease complexity
snoato Nov 12, 2021
e432b82
goal-class: move formulation of CX goals to goal-class approach
snoato Nov 12, 2021
98ac917
rcll: add predicate to indicate which ring-costs are currently paid for
snoato Nov 12, 2021
474f60c
goal-class: move mount-first-ring to PDDL based formulation precondit…
snoato Nov 12, 2021
48c546b
goal-production: disable old mount-first-ring formulation rule
snoato Nov 12, 2021
1ccfe73
rcll: minor adaptions
snoato Nov 15, 2021
1132088
goal-class: add pddl-precondition for MOUNT-NEXT-RING
snoato Nov 15, 2021
d08fcde
goal-class: switch MOUNT-NEXT-RING to PDDL formulation
snoato Nov 15, 2021
7828f35
goal-class: fix preconditions for DELIVER goals
snoato Nov 16, 2021
4be674e
goal-class: add order-producible predicate for CX
snoato Nov 16, 2021
fa0d8c7
goal-class: add deliver-ahead time constraint to deliverability check
snoato Nov 16, 2021
29acc2a
goal-class: switch deliverable to producible for MOUNT-RING and PRODUCE
snoato Nov 16, 2021
62dc9d6
goal-class: add comments, remove unnecessary predicates
snoato Nov 16, 2021
f993a43
goal-class: add goal-class for FILL-CAP goals
snoato Nov 16, 2021
713db1e
goal-class: switch FILL-CAP to PDDL-based formulation precondition
snoato Nov 16, 2021
eb1a85a
fawkes: update submodule pointer
snoato Nov 16, 2021
6249edb
goal-class: move clear bs goal rules
snoato Nov 16, 2021
8c4f8e9
goal-class: add section header comments
snoato Nov 16, 2021
096a8dd
goal-class: add goal-class for FILL-RS and associated get goals
snoato Nov 16, 2021
41be3c9
goal-class: switch FILL-RS and associated get goals to PDDL precons
snoato Nov 16, 2021
ee479a5
goal-class: fix preconditions
snoato Nov 17, 2021
09383b2
goal-class: add precondition for DISCARD goals
snoato Nov 17, 2021
cf45e65
rcll: add additional predicates to domain
snoato Nov 17, 2021
57102ba
goal-class: move DISCARD goals to PDDL-based preconditions
snoato Nov 17, 2021
74e6088
goal-class: add preconditions for CLEAR-MPS goals
snoato Nov 17, 2021
8f49876
goal-class: switch CLEAR-MPS goals to PDDL preconditions
snoato Nov 17, 2021
451a9e5
goal-class: precondition fixes
snoato Nov 19, 2021
a665781
rcll: add predicate to model that a workpiece is assigned to any order
snoato Nov 19, 2021
7e09f78
rcll: add description
snoato Nov 19, 2021
3d79968
goal-class: update preconditions
snoato Nov 19, 2021
0ff400f
goal-class: update descriptions and comments
snoato Nov 19, 2021
d606ad5
goal-production: remove replace goal formulation rules
snoato Nov 19, 2021
cc6dbe2
goal-class: re-add falsely removed precondition
snoato Nov 19, 2021
8ec7902
fawkes: udpate submodule pointer
snoato Nov 19, 2021
3a47d66
goal-class: use variables for subtypes and class identifiers
snoato Nov 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cfg/conf.d/clips-executive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ clips-executive:
- rcll/production-strategy.clp
- rcll/exploration.clp
- rcll/goal-lock-expiration.clp
- rcll/goal-class.clp
- name: goal-expander
file: rcll/fixed-sequence.clp
- name: action-selection
Expand Down
102 changes: 95 additions & 7 deletions src/clips-specs/rcll/domain.clp
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@
(domain-object (name CCG1) (type cap-carrier))
(domain-object (name CCG2) (type cap-carrier))
(domain-object (name CCG3) (type cap-carrier))
(domain-object (name ?bs) (type mps))
(domain-object (name ?cs1) (type mps))
(domain-object (name ?cs2) (type mps))
(domain-object (name ?ds) (type mps))
(domain-object (name ?rs1) (type mps))
(domain-object (name ?rs2) (type mps))
(domain-object (name ?ss) (type mps))
(domain-object (name ?bs) (type bs))
(domain-object (name ?cs1) (type cs))
(domain-object (name ?cs2) (type cs))
(domain-object (name ?ds) (type ds))
(domain-object (name ?rs1) (type rs))
(domain-object (name ?rs2) (type rs))
(domain-object (name ?ss) (type ss))
(domain-object (name INPUT) (type mps-side))
(domain-object (name OUTPUT) (type mps-side))
(domain-object (name WAIT) (type mps-side))
Expand Down Expand Up @@ -280,6 +280,20 @@
(domain-fact (name mps-side-free) (param-values ?rs2 OUTPUT))
(domain-fact (name mps-side-free) (param-values ?ds OUTPUT))
(domain-fact (name mps-side-free) (param-values ?ss OUTPUT))
(domain-fact (name mps-has-side) (param-values ?bs INPUT))
(domain-fact (name mps-has-side) (param-values ?cs1 INPUT))
(domain-fact (name mps-has-side) (param-values ?cs2 INPUT))
(domain-fact (name mps-has-side) (param-values ?rs1 INPUT))
(domain-fact (name mps-has-side) (param-values ?rs2 INPUT))
(domain-fact (name mps-has-side) (param-values ?ds INPUT))
(domain-fact (name mps-has-side) (param-values ?ss INPUT ))
(domain-fact (name mps-has-side) (param-values ?bs OUTPUT))
(domain-fact (name mps-has-side) (param-values ?cs1 OUTPUT))
(domain-fact (name mps-has-side) (param-values ?cs2 OUTPUT))
(domain-fact (name mps-has-side) (param-values ?rs1 OUTPUT))
(domain-fact (name mps-has-side) (param-values ?rs2 OUTPUT))
(domain-fact (name mps-has-side) (param-values ?ds OUTPUT))
(domain-fact (name mps-has-side) (param-values ?ss OUTPUT))

(domain-fact (name wp-cap-color) (param-values CCB1 CAP_BLACK))
(domain-fact (name wp-cap-color) (param-values CCB2 CAP_BLACK))
Expand All @@ -296,6 +310,8 @@

(domain-fact (name rs-filled-with) (param-values ?rs1 ZERO))
(domain-fact (name rs-filled-with) (param-values ?rs2 ZERO))
(domain-fact (name rs-filled-for) (param-values ?rs1 ZERO))
(domain-fact (name rs-filled-for) (param-values ?rs2 ZERO))
)

(assert (domain-facts-loaded))
Expand All @@ -315,3 +331,75 @@
(wm-robmem-sync-restore)
(assert (domain-facts-loaded))
)

; ----------------- PDDL Goal Formulation Objects and Predicates -------------------
; the following objects and predicates cary information that make it easier to
; define goal-formulation preconditions in PDDL by either removing the need for
; quantification, or by reducing the size of the grounding space in the case of object
; types.
; (e.g. to detect if the given order has a workpiece assigned to it,
; order-has-wp can be used instead just for that order instead of having to use
; wp-for-order and quantifying over all workpieces)

(defrule domain-assert-mps-polymorphism
(domain-object (name ?mps) (type bs|cs|ds|rs|ss))
=>
(assert (domain-object (name ?mps) (type mps)))
)
(defrule domain-assert-fs-polymorphism
(domain-object (name ?mps) (type cs|ss))
=>
(assert (domain-object (name ?mps) (type fs)))
)

(defrule domain-assert-order-has-wp
(domain-fact (name wp-for-order) (param-values ?wp ?order))
(not (domain-fact (name order-has-wp) (param-values ?order)))
=>
(assert (domain-fact (name order-has-wp) (param-values ?order)))
)

(defrule domain-retract-order-has-wp
?df <- (domain-fact (name order-has-wp) (param-values ?order))
(not (domain-fact (name wp-for-order) (param-values ?wp ?order)))
=>
(retract ?df)
)

(defrule goal-class-wp-has-order
(wm-fact (key domain fact wp-for-order args? wp ?wp ord ?order))
(not (domain-fact (name wp-has-order) (param-values ?wp)))
=>
(assert (domain-fact (name wp-has-order) (param-values ?wp)))
)

(defrule goal-class-not-wp-has-order
?wmf <- (domain-fact (name wp-has-order) (param-values ?wp))
(not (wm-fact (key domain fact wp-for-order args? wp ?wp ord ?order)))
=>
(retract ?wmf)
)

(defrule domain-assert-rs-paid-for
(domain-fact (name rs-filled-with) (param-values ?rs ?bases-filled))
(not (domain-fact (name rs-filled-with) (param-values ?rs ?other-bases&~?bases-filled)))
(domain-constant (type ring-num) (value ?required))
(not (domain-fact (name rs-paid-for) (param-values ?rs ?required)))
(wm-fact (key domain fact rs-sub args? minuend ?bases-filled
subtrahend ?required
difference ZERO|ONE|TWO|THREE))
=>
(assert (domain-fact (name rs-paid-for) (param-values ?rs ?required)))
)

(defrule domain-retract-rs-paid-for
(domain-fact (name rs-filled-with) (param-values ?rs ?bases-filled))
(not (domain-fact (name rs-filled-with) (param-values ?rs ?other-bases&~?bases-filled)))
(domain-constant (type ring-num) (value ?required))
?df <- (domain-fact (name rs-paid-for) (param-values ?rs ?required))
(not (wm-fact (key domain fact rs-sub args? minuend ?bases-filled
subtrahend ?required
difference ZERO|ONE|TWO|THREE)))
=>
(retract ?df)
)
43 changes: 35 additions & 8 deletions src/clips-specs/rcll/domain.pddl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@
robot - object
team-color - object
location - object
waitpoint - location
waitpoint - location
mps - location
;cs - mps
bs - mps
;ss - mps
rs - mps
ds - mps
fs - mps
cs - fs
ss - fs
mps-typename - object
mps-statename - object
mps-side - object
Expand All @@ -38,14 +46,16 @@
cs-operation - object
cs-statename - object
order - object
order-complexity-value - object
order-complexity-value - object
workpiece - object
cap-carrier - workpiece
shelf-spot - object
ring-num - object
zone - object
token - object
master-token - token
refbox-phasename - object
refbox-statename - object
)

(:constants
Expand Down Expand Up @@ -75,6 +85,7 @@
(mps-state ?m - mps ?s - mps-statename)
(mps-team ?m - mps ?col - team-color)
(mps-side-free ?m - mps ?side - mps-side)
(mps-has-side ?m - mps ?side - mps-side)
(bs-prepared-color ?m - mps ?col - base-color)
(bs-prepared-side ?m - mps ?side - mps-side)
(cs-can-perform ?m - mps ?op - cs-operation)
Expand All @@ -86,6 +97,8 @@
(rs-prepared-color ?m - mps ?col - ring-color)
(rs-ring-spec ?m - mps ?r - ring-color ?rn - ring-num)
(rs-filled-with ?m - mps ?n - ring-num)
(rs-paid-for ?rs - mps ?n - ring-num)
(rs-failed-put-slide ?rs - mps ?robot - robot ?wp - workpiece)
;rs-sub and rs-inc are static predicates stating the legal ring-num operations
(rs-sub ?minuend - ring-num ?subtrahend - ring-num ?difference - ring-num)
(rs-inc ?summand - ring-num ?sum - ring-num)
Expand All @@ -100,6 +113,10 @@
(order-delivery-begin ?ord - order)
(order-delivery-end ?ord - order)
(order-gate ?ord - order ?gate - ds-gate)
(order-producible ?ord - order)
(order-deliverable ?ord - order)
(order-has-wp ?ord - order)
(order-out-of-delivery ?ord -order)
(wp-unused ?wp - workpiece)
(wp-usable ?wp - workpiece)
(wp-at ?wp - workpiece ?m - mps ?side - mps-side)
Expand All @@ -110,12 +127,22 @@
(wp-cap-color ?wp - workpiece ?col - cap-color)
(wp-on-shelf ?wp - workpiece ?m - mps ?spot - shelf-spot)
(wp-spawned-for ?wp - workpiece ?r - robot)
(wp-for-order ?wp - workpiece ?ord - order)
(spot-free ?m - mps ?spot - shelf-spot)
(ss-initialized ?m - mps)
(ss-stored-wp ?m - mps ?wp - workpiece)
(locked ?name - object)
(location-locked ?m - mps ?s - mps-side)
(wp-for-order ?wp - workpiece ?ord - order)
(wp-has-order ?wp - workpiece)
(spot-free ?m - mps ?spot - shelf-spot)
(ss-initialized ?m - mps)
(ss-stored-wp ?m - mps ?wp - workpiece)
(locked ?name - object)
(location-locked ?m - mps ?s - mps-side)
(refbox-order-quantity-requested ?order - order ?quantity - integer)
(refbox-order-quantity-delivered ?order - order ?quantity - integer)
(refbox-game-time ?value - float)
(refbox-points-cyan ?value - integer)
(refbox-points-magenta ?value - integer)
(refbox-team-color ?value - team-color)
(refbox-phase ?value - refbox-phasename)
(refbox-state ?value - refbox-statename)
(refbox-field-ground-truth ?name - object ?mtype - object ?zone - object ?yaw - float ?orientation - float)
)

;Kind of a hack. actually it should model the removal of present workpieces
Expand Down
9 changes: 0 additions & 9 deletions src/clips-specs/rcll/execution-monitoring.clp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@



;A timeout for an action
(deftemplate action-timer
(slot plan-id (type SYMBOL))
(slot action-id(type NUMBER))
(slot timeout-duration)
(multislot start-time)
(slot status)
)

(defglobal
?*MONITORING-SALIENCE* = 1
?*COMMON-TIMEOUT-DURATION* = 30
Expand Down
Loading