;;
;; Camile Scenario IDEF 3 representation
;;
;; Mihai Ciocoiu
;;

(define-UOB Make-GT350
    :documentation "Make GT350")

(define-UOB Make-Interior
    :documentation "Make Interior"
    :objects (A002-bench)
    :constraints (and (duration Make-Interior 5)
	              (BeginOf Make-Interior 7)))

(define-UOB Make-Drive
    :documentation "Make Drive"
    :objects (A003-bench))

(define-UOB Make-Trim
    :documentation "Make Trim"
    :objects (A002-bench A005-bench))

; Make-Engine flattened

(define-UOB Make-Chassis
    :documentation "Make Chassis")

(define-UOB Final-Assembly
    :documentation "Final Assembly")

(define-UOB Make-Hamess
    :documentation "Make Hamess")

; Make-Block flattened

(define-UOB Make-Wires
    :documentation "Make Wires")

(define-UOB Assemble-Engine
    :documentation "Assemble Engine")

; Produce-Moulded-Metal-Item flattened

(define-UOB Machine-Block
    :documentation "Machine Block")

(define-UOB Change-Mould
    :documentation "Change Mould")

(define-UOB Setup-Furnace
    :documentation "Setup Furnace")

(define-UOB Analyse-Metal
    :documentation "Analyse Metal")

(define-UOB Melt
    :documentation "Melt")

; Mould flattened

(define-UOB Wait
    :documentation "Wait")

(define-UOB Clear-Cavities
    :documentation "Clear Cavities")

(define-UOB Setup-Racks
    :documentation "Setup Racks")

(define-UOB Pour
    :documentation "Pour")

(define-UOB Remove-Racks
    :documentation "Remove Racks")

(define-UOB Batch-Complete
    :documentation "Batch Complete")

(define-process Make-GT350-proc
    :documentation "Make GT350 Process"
    :components (Make-Interior-1 Make-Drive-1 Make-Trim-1 
		 Make-Chassis-1 Final-Assembly-1 J2 J1
                 Make-Harness-1 Make-Wires-1 Assemble-Engine-1 J4 J3
                 Machine-Block-1
                 Change-Mould-1 Setup-Furnace-1 Analyse-Metal-1 Melt-1
                 Wait-1 Clear-Cavities-1 J8 J7 J6 J5
                 Setup-Racks-1 Pour-1 Remove-Racks-1 Batch-Complete-1)
    :constraints nil)

(define-UOB-use Make-Interior-1
    :documentation "The occurence of Make-Interior in the Dec-19 schematic"
    :in-process Make-GT350-proc
    :use-of (Make-Interior)
    :decompositions nil
    :constraints nil)

(define-UOB-use Make-Drive-1
    :documentation "The occurence of Make-Drive in the Dec-19 schematic"
    :in-process Make-GT350-proc
    :use-of (Make-Drive)
    :decompositions nil
    :constraints nil)

(define-UOB-use Make-Trim-1
    :documentation "The occurence of Make-Trim in the Dec-19 schematic"
    :in-process Make-GT350-proc
    :use-of (Make-Trim)
    :decompositions nil
    :constraints nil)

(define-UOB-use Make-Chassis-1
    :documentation "The occurence of Make-Chassis in the Dec-19 schematic"
    :in-process Make-GT350-proc
    :use-of (Make-Chassis)
    :decompositions nil
    :constraints nil)

(define-UOB-use Final-Assembly-1
    :documentation "The occurence of Final-Assembly in the Dec-19 schematic"
    :in-process Make-GT350-proc
    :use-of (Final-Assembly)
    :decompositions nil
    :constraints nil)

(define-fan-in-&-junction J2
    :documentation "J2"
    :in-process Make-GT350-proc
    :pred (Make-Interior-1 Make-Drive-1 Make-Trim-1 Assemble-Engine-1 Make-Chassis-1)
    :succ Final-Assembly-1
    :constraints nil)

(define-fan-out-&-junction J1
    :documentation "J1"
    :in-process Make-GT350-proc
    :pred nil
    :succ (Make-Interior-1 Make-Drive-1 Make-Trim-1 J3 Make-Chassis-1)
    :constraints nil)

    
(define-UOB-use Make-Harness-1
    :documentation "The occurence of Make-Harness in the Dec-26 schematic"
    :in-process Make-GT350-proc
    :use-of (Make-Harness)
    :decompositions nil
    :constraints nil)

(define-UOB-use Make-Wires-1
    :documentation "The occurence of Make-Wires in the Dec-26 schematic"
    :in-process Make-GT350-proc
    :use-of (Make-Wires)
    :decompositions nil
    :constraints nil)

(define-UOB-use Assemble-Engine-1
    :documentation "The occurence of Assemble-Engine in the Dec-26 schematic"
    :in-process Make-GT350-proc
    :use-of (Assemble-Engine)
    :decompositions nil
    :constraints nil)

(define-fan-in-&-junction J4
    :documentation "J4"
    :in-process Make-GT350-proc
    :pred (Machine-Block-1 Make-Harness-1 Make-Wires-1)
    :succ Assemble-Engine-1
    :constraints nil)

(define-fan-out-&-junction J3
    :documentation "J3"
    :in-process Make-GT350-proc
    :pred nil
    :succ (J5 Make-Harness-1 Make-Wires-1)
    :constraints nil)

(define-UOB-use Machine-Block-1
    :documentation "The occurence of Machine-Block in the Dec-27 schematic"
    :in-process Make-GT350-proc
    :use-of (Machine-Block)
    :decompositions nil
    :constraints nil)

(define-link L93
    :documentation "L93"
    :in-process Make-GT350-proc
    :pred Clear-Cavities-1
    :succ Machine-Block-1
    :constraints nil)

(define-UOB-use Change-Mould-1
    :documentation "The occurence of Change-Mould in the Dec-1 schematic"
    :in-process Make-GT350-proc
    :use-of (Change-Mould)
    :decompositions nil
    :constraints nil)

(define-UOB-use Setup-Furnace-1
    :documentation "The occurence of Setup-Furnace in the Dec-1 schematic"
    :in-process Make-GT350-proc
    :use-of (Setup-Furnace)
    :decompositions nil
    :constraints nil)

(define-UOB-use Analyse-Metal-1
    :documentation "The occurence of Analyse-Metal in the Dec-1 schematic"
    :in-process Make-GT350-proc
    :use-of (Analyse-Metal)
    :decompositions nil
    :constraints nil)

(define-UOB-use Melt-1
    :documentation "The occurence of Melt in the Dec-1 schematic"
    :in-process Make-GT350-proc
    :use-of (Melt)
    :decompositions nil
    :constraints nil)

(define-UOB-use Wait-1
    :documentation "The occurence of Wait in the Dec-1 schematic"
    :in-process Make-GT350-proc
    :use-of (Wait)
    :decompositions nil
    :constraints nil)

(define-UOB-use Clear-Cavities-1
    :documentation "The occurence of Clear-Cavities in the Dec-1 schematic"
    :in-process Make-GT350-proc
    :use-of (Clear-Cavities)
    :decompositions nil
    :constraints nil)

(define-fan-in-&-junction J8
    :documentation "J8"
    :in-process Make-GT350-proc
    :pred (Analyse-Metal-1 Melt-1)
    :succ Setup-Racks-1
    :constraints nil)

(define-fan-out-&-junction J7
    :documentation "J7"
    :in-process Make-GT350-proc
    :pred Setup-Furnace-1
    :succ (Analyse-Metal-1 Melt-1)
    :constraints nil)

(define-fan-in-X-junction J6
    :documentation "J6"
    :in-process Make-GT350-proc
    :pred (Change-Mould-1)
    :succ Setup-Furnace-1
    :constraints nil)

(define-fan-out-X-junction J5
    :documentation "J5"
    :in-process Make-GT350-proc
    :pred nil
    :succ (J6 Change-Mould-1)
    :constraints nil)

(define-link L121
    :documentation "L121"
    :in-process Make-GT350-proc
    :pred Remove-Racks-1
    :succ Batch-Complete-1
    :constraints nil)

(define-link L122
    :documentation "L122"
    :in-process Make-GT350-proc
    :pred Pour-1
    :succ Remove-Racks-1
    :constraints nil)

(define-link L124
    :documentation "L124"
    :in-process Make-GT350-proc
    :pred Setup-Racks-1
    :succ Pour-1
    :constraints nil)

(define-link L120
    :documentation "L120"
    :in-process Make-GT350-proc
    :pred Batch-Complete-1
    :succ Wait-1
    :constraints nil)

(define-link L123
    :documentation "L123"
    :in-process Make-GT350-proc
    :pred Wait-1
    :succ Clear-Cavities-1
    :constraints nil)

(define-UOB-use Setup-Racks-1
    :documentation "The occurence of Setup-Racks in the Dec-1-1 schematic"
    :in-process Make-GT350-proc
    :use-of (Setup-Racks)
    :decompositions nil
    :constraints nil)

(define-UOB-use Pour-1
    :documentation "The occurence of Pour in the Dec-1-1 schematic"
    :in-process Make-GT350-proc
    :use-of (Pour)
    :decompositions nil
    :constraints nil)

(define-UOB-use Remove-Racks-1
    :documentation "The occurence of Remove-Racks in the Dec-1-1 schematic"
    :in-process Make-GT350-proc
    :use-of (Remove-Racks)
    :decompositions nil
    :constraints nil)

(define-UOB-use Batch-Complete-1
    :documentation "The occurence of Batch-Complete in the Dec-1-1 schematic"
    :in-process Make-GT350-proc
    :use-of (Batch-Complete)
    :decompositions nil
    :constraints nil)