;;;;;;;;;;;;;;;;;;;;;;;ACTR model to program ER1 robot;;;
;;;;;;;;the model programs the robot so that when it sees a dollar,;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; it speaks the phrase "I saw the dollar";;;;;; 
;;;;;;;;;;;;;;;;;;;;;;;;;;   ;;Urmila Kukreja;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;     ;;Sept 2004;;



(clear-all)
(pm-reset)
(sgp 
   :ESC T
   :LF 0.05
)





(chunk-type program-dollar step start state)

(add-dm
   
   (first-goal ISA program-dollar step start))


(p start
   =goal>
      ISA   program-dollar
      step  start
==>
   =goal>
       step 2
       state program-sight
       !output!("starting-dollar-task")
       !eval! (see-if-side)
       !output! ("I saw the if-side")
)

(p sight
=goal>
 ISA   program-dollar
       state program-sight
==>
   =goal>
   step 3
   state program-drop-down
   !eval! (process-sight)
   !eval!(see-if-sight)
   !eval! (process-object)
   !output! ("I found object")
)

(p drop-down
=goal>
 ISA   program-dollar
       state program-drop-down
==>
   =goal>
   step 4
   state program-checkbox
   !eval! (process-drop-down)
   !eval! (see-drop-down)
 !eval! (process-dollar)
   !output! ("I found the dollar picture")
)

(p checkbox
=goal>
 ISA   program-dollar
       state program-checkbox
==>
   =goal>
   step 5
   state program-then
   !eval! (see-checkbox)
   !eval! (process-checkbox)
   !output! ("I finished the if-side")
       
)

(p then-side
=goal>
 ISA   program-dollar
       state program-then
==>
   =goal>
   step 6
   state program-typing
   !eval!(see-then-side)
   !eval!(process-play)
   !eval!(progn (segman::move-to #@(712 332)))
   !eval! (segman::single-click)
   !output! ("I found speak a phrase")
)


(p type
=goal>
 ISA   program-dollar
       state program-typing
==>
   =goal>
   step 7
   state run
!eval!(type-phrase)
)

(p execute
=goal>
 ISA   program-dollar
       state run
==>
   =goal>
   step 8
   state stop
!eval!(progn (segman::move-to #@(982 133)))
      !eval!(segman::single-click)
      !output!("I did the task!")

)




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;







(goal-focus first-goal)
