diff --git a/cg/freecad/Frames/pddl/MillingMachine.FCStd b/cg/freecad/Frames/pddl/MillingMachine.FCStd new file mode 100644 index 0000000..c324eef Binary files /dev/null and b/cg/freecad/Frames/pddl/MillingMachine.FCStd differ diff --git a/cg/freecad/Frames/pddl/PartDesignExample.FCStd b/cg/freecad/Frames/pddl/PartDesignExample.FCStd new file mode 100644 index 0000000..09f22c4 Binary files /dev/null and b/cg/freecad/Frames/pddl/PartDesignExample.FCStd differ diff --git a/cg/freecad/Frames/pddl/Printer.FCStd b/cg/freecad/Frames/pddl/Printer.FCStd index b819cd5..b694cba 100644 Binary files a/cg/freecad/Frames/pddl/Printer.FCStd and b/cg/freecad/Frames/pddl/Printer.FCStd differ diff --git a/cg/freecad/Frames/pddl/domain.pddl b/cg/freecad/Frames/pddl/domain.pddl index 044c805..2131814 100644 --- a/cg/freecad/Frames/pddl/domain.pddl +++ b/cg/freecad/Frames/pddl/domain.pddl @@ -1,97 +1,86 @@ -(define (domain Printer) +(define (domain fabrication) (:requirements :strips :typing :fluents :durative-actions) (:types - printer workspace - zone + endmill workspace - zone part arm assembly human - filament ) (:predicates - (arm_available ?a - arm) + (endmill_is_ready endmill task observer) (part_at ?p - part ?z - zone) - (printer_ready ?p - printer) - (printer_checked ?p - printer) - (printer_at_work ?p - printer) - (part_of ?part - part ?whole - assembly) + (endmill_ready ?p - printer) + (endmill_checked ?p - printer) + (endmill_at_work ?p - printer) (assembly_order ?prev ?next - assembly) (assembled ?whole - assembly ?z - zone) (observer_free ?h - human) - (filament_at ?f - filament ?z - zone) ) (:functions ) -(:durative-action print - :parameters ( ?p - part ?pr - printer ) - :duration ( = ?duration 20) +(:action predpreparing + :parameters () :condition (and - (at start(printer_ready ?pr)) + (not endmill_is_ready) ) :effect (and - (at start (not (printer_ready ?pr))) - (at start (printer_at_work ?pr )) - (at end(part_at ?p ?pr)) - (at end (not (printer_at_work ?pr ))) + (endmill_is_ready) ) ) -(:durative-action remove - :parameters ( ?p - part ?pr - printer ?z - zone ?a - arm ) - :duration ( = ?duration 1) +(:durative-action PartDesignExample_TC: Default Tool + :parameters ( ) + :duration ( = ?duration 157) :condition (and - (at start (part_at ?p ?pr)) - (at start (arm_available ?a)) + (endmill_is_ready) ) :effect (and - (at start (not (arm_available ?a))) - (at end (part_at ?p ?z)) - (at end (arm_available ?a)) - (at end (printer_ready ?pr)) ) ) -(:durative-action assemble - :parameters ( ?p - part ?prev ?next - assembly ?z - zone ?arm - arm ?w - workspace ) - :duration ( = ?duration 5) +(:durative-action PartDesignExample_TC: Default Tool + :parameters ( ) + :duration ( = ?duration 170) :condition (and - (at start (assembled ?prev ?w)) - (at start (part_at ?p ?w)) - (at start (part_of ?p ?next)) - (at start (arm_available ?arm)) - (at start (assembly_order ?prev ?next)) + (endmill_is_ready) ) :effect (and - (at start (not (arm_available ?arm))) - (at end (not (part_at ?p ?w))) - (at end (arm_available ?arm)) - (at end (assembled ?next ?w)) ) ) -(:durative-action printer_check - :parameters ( ?p - printer ?h - human ) - :duration ( = ?duration 1) +(:durative-action PartDesignExample_TC: Default Tool + :parameters ( ) + :duration ( = ?duration 78) :condition (and - (at start ( observer_free ?h )) + (endmill_is_ready) ) :effect (and - (at start (not (observer_free ?h))) - (at end (observer_free ?h)) - (at end (printer_checked ?p)) ) ) -(:durative-action printer_filament_load - :parameters ( ?p - printer ?h - human ?f - filament ?z - zone ) - :duration ( = ?duration 5) +(:durative-action PartDesignExample_TC: Default Tool + :parameters ( ) + :duration ( = ?duration 157) :condition (and - (at start (printer_checked ?p)) - (at start (observer_free ?h)) - (at start (filament_at ?f ?z)) + (endmill_is_ready) + ) + :effect (and +) + ) +(:durative-action PartDesignExample_TC: Default Tool + :parameters ( ) + :duration ( = ?duration 170) + :condition (and + (endmill_is_ready) + ) + :effect (and +) + ) +(:durative-action PartDesignExample_TC: Default Tool + :parameters ( ) + :duration ( = ?duration 78) + :condition (and + (endmill_is_ready) ) :effect (and - (at start (not(observer_free ?h))) - (at end (observer_free ?h)) - (at end (printer_ready ?p)) - (at end (not (filament_at ?f ?z))) ) ) ) diff --git a/cg/freecad/Frames/pddl/etalon_domain.pddl b/cg/freecad/Frames/pddl/etalon_domain.pddl new file mode 100644 index 0000000..9262be7 --- /dev/null +++ b/cg/freecad/Frames/pddl/etalon_domain.pddl @@ -0,0 +1,97 @@ +(define (domain Printer) + +(:requirements :strips :typing :fluents :durative-actions) +(:types + printer workspace - zone + part + arm + assembly + human + filament +) + (:predicates + (arm_available ?a - arm) + (part_at ?p - part ?z - zone) + (printer_ready ?p - printer) + (printer_checked ?p - printer) + (printer_at_work ?p - printer) + (part_of ?part - part ?whole - assembly) + (assembly_order ?prev ?next - assembly) + (assembled ?whole - assembly ?z - zone) + (observer_free ?h - human) + (filament_at ?f - filament ?z - zone) + ) + (:functions + ) +(:durative-action print + :parameters ( ?p - part ?pr - printer ) + :duration ( = ?duration 20) + :condition (and + (at start(printer_ready ?pr)) + ) + :effect (and + (at start (not (printer_ready ?pr))) + (at start (printer_at_work ?pr )) + (at end(part_at ?p ?pr)) + (at end (not (printer_at_work ?pr ))) +) + ) +(:durative-action remove + :parameters ( ?p - part ?pr - printer ?z - zone ?a - arm ) + :duration ( = ?duration 1) + :condition (and + (at start (part_at ?p ?pr)) + (at start (arm_available ?a)) + ) + :effect (and + (at start (not (arm_available ?a))) + (at end (part_at ?p ?z)) + (at end (arm_available ?a)) + (at end (printer_ready ?pr)) +) + ) +(:durative-action assemble + :parameters ( ?p - part ?prev ?next - assembly ?arm - arm ?w - workspace ) + :duration ( = ?duration 5) + :condition (and + (at start (assembled ?prev ?w)) + (at start (part_at ?p ?w)) + (at start (part_of ?p ?next)) + (at start (arm_available ?arm)) + (at start (assembly_order ?prev ?next)) + ) + :effect (and + (at start (not (arm_available ?arm))) + (at end (not (part_at ?p ?w))) + (at end (arm_available ?arm)) + (at end (assembled ?next ?w)) +) + ) +(:durative-action printer_check + :parameters ( ?p - printer ?h - human ) + :duration ( = ?duration 1) + :condition (and + (at start ( observer_free ?h )) + ) + :effect (and + (at start (not (observer_free ?h))) + (at end (observer_free ?h)) + (at end (printer_checked ?p)) +) + ) +(:durative-action printer_filament_load + :parameters ( ?p - printer ?h - human ?f - filament ?z - zone ) + :duration ( = ?duration 5) + :condition (and + (at start (printer_checked ?p)) + (at start (observer_free ?h)) + (at start (filament_at ?f ?z)) + ) + :effect (and + (at start (not(observer_free ?h))) + (at end (observer_free ?h)) + (at end (printer_ready ?p)) + (at end (not (filament_at ?f ?z))) +) + ) + ) diff --git a/cg/freecad/Frames/pddl/problem.pddl b/cg/freecad/Frames/pddl/etalon_problem.pddl similarity index 100% rename from cg/freecad/Frames/pddl/problem.pddl rename to cg/freecad/Frames/pddl/etalon_problem.pddl diff --git a/cg/freecad/Frames/pddl/test_asm.FCStd b/cg/freecad/Frames/pddl/test_asm.FCStd new file mode 100644 index 0000000..5c2ca5f Binary files /dev/null and b/cg/freecad/Frames/pddl/test_asm.FCStd differ diff --git a/cg/freecad/Frames/pddldomain.pddl b/cg/freecad/Frames/pddldomain.pddl new file mode 100644 index 0000000..b9b1da6 --- /dev/null +++ b/cg/freecad/Frames/pddldomain.pddl @@ -0,0 +1,82 @@ +(define (domain fabrication) + +(:requirements :strips :typing :fluents :durative-actions) +(:types + ['endmill workspace - zone', 'part', 'arm', 'assembly', 'human', ''] +) + (:predicates + (endmill_is_ready endmill task observer) + (part_at [?p - part ?z - zone]) + (endmill_ready ?p - printer) + (endmill_checked ?p - printer) + (endmill_at_work ?p - printer) + (assembly_order ?prev ?next - assembly) + (assembled ?whole - assembly ?z - zone) + (observer_free ?h - human) + ) + (:functions + ) +(:action predpreparing + :parameters () + :condition (and + (not endmill_is_ready) + ) + :effect (and + (endmill_is_ready) +) + ) +(:durative-action PartDesignExample_TC: Default Tool + :parameters ( ) + :duration ( = ?duration 00:02:37) + :condition (and + (endmill_is_ready) + ) + :effect (and +) + ) +(:durative-action PartDesignExample_TC: Default Tool + :parameters ( ) + :duration ( = ?duration 00:02:50) + :condition (and + (endmill_is_ready) + ) + :effect (and +) + ) +(:durative-action PartDesignExample_TC: Default Tool + :parameters ( ) + :duration ( = ?duration 00:01:18) + :condition (and + (endmill_is_ready) + ) + :effect (and +) + ) +(:durative-action PartDesignExample_TC: Default Tool + :parameters ( ) + :duration ( = ?duration 00:02:37) + :condition (and + (endmill_is_ready) + ) + :effect (and +) + ) +(:durative-action PartDesignExample_TC: Default Tool + :parameters ( ) + :duration ( = ?duration 00:02:50) + :condition (and + (endmill_is_ready) + ) + :effect (and +) + ) +(:durative-action PartDesignExample_TC: Default Tool + :parameters ( ) + :duration ( = ?duration 00:01:18) + :condition (and + (endmill_is_ready) + ) + :effect (and +) + ) + )