(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 ?z - zone ?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))) 
)
  )
 )
