-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathact-touch-demo-model.lisp
225 lines (207 loc) · 4.88 KB
/
act-touch-demo-model.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Author : Frank Tamborello
;;; Copyright : (c) 2012 Cogscent, LLC
;;; Availability: GNU LGPL, see LGPL.txt
;;; Address : Cogscent, LLC
;;; : PMB 7431
;;; : 2711 Centerville Rd, Ste 120
;;; : Wilmington DE, USA 19808-1676
;;; : [email protected]
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; This library is free software; you can redistribute it and/or
;;; modify it under the terms of the Lisp Lesser General Public
;;; License: the GNU Lesser General Public License as published by the
;;; Free Software Foundation (either version 2.1 of the License,
;;; or, at your option, any later version),
;;; and the Franz, Inc Lisp-specific preamble.
;;;
;;; This library is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;;; Lesser General Public License for more details.
;;;
;;; You should have received a copy of the Lisp Lesser General Public
;;; License along with this library; if not, write to the Free Software
;;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;;; and see Franz, Inc.'s preamble to the GNU Lesser General Public License,
;;; http://opensource.franz.com/preamble.html.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Acknowledgements
;;; : This research is sponsored by Measurement Science and
;;; Engineering grant 60NANB12D134 from the
;;; National Institute of Standards and Technology (NIST).
;;; Special acknowledgements are due to Dr. Ross Micheals and
;;; Dr. Kristen K. Greene of NIST's Information Technology
;;; Laboratory.
;;; Thanks also to Dr. Michael D. Byrne, upon whose experiment
;;; library code I based the device code.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Filename : act-touch-demo-model.lisp
;;; Revision : 1
;;;
;;; Description : A quickie demonstration of ACT-Touch
;;;
;;; Usage : Place in ACT-R folder "User Loads." This file will load
;;; automatically after ACT-R loads.
;;;
;;; Bugs : None known
;;;
;;; To do : Nothing
;;;
;;; ----- History -----
;;; 2012.09.29 fpt 1
;;; : Inception: Forked from act-touch.lisp
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; ---------------------------------------------------------------------- ;;;;
;;;; A Demonstration Model
;;;; ---------------------------------------------------------------------- ;;;;
(clear-all)
(define-model act-touch-demo
(sgp :v t :trace-detail high)
(add-dm
(goal op start))
(goal-focus goal)
(p move-hand
=goal>
op start
=visual-location>
color red
?manual>
state free
==>
+manual>
cmd move-hand-touch
loc =visual-location
=goal>
op tap)
(p do-tap
=goal>
op tap
?manual>
preparation free
==>
+manual>
cmd tap
hand right
finger index
=goal>
op tapped)
(p do-tap-hold
=goal>
op tapped
?manual>
preparation free
==>
=goal>
op tap-holding
+manual>
cmd tap-hold
hand right
finger index)
(p do-tap-release
!eval! (zerop (index-z (current-device)))
=goal>
op tap-holding
?manual>
preparation free
==>
=goal>
op tap-drag-release
+manual>
cmd tap-release
hand right
finger index)
;; Here's an example of a composed movement: the tap-hold, drag, & release
(p do-tapping-drag-release
=goal>
op tap-drag-release
?manual>
preparation free
?imaginal>
buffer empty
==>
=goal>
op tapping-drag-release
+manual>
cmd tap-hold
hand right
finger index
+imaginal>
screen-x 550
screen-y 400)
(p do-tapped-dragging-release
!eval! (zerop (index-z (current-device)))
=goal>
op tapping-drag-release
?manual>
preparation free
=imaginal>
screen-x =x
screen-y =y
==>
=goal>
op tapped-dragging-release
+manual>
cmd move-hand-touch
loc =imaginal)
(p do-tapped-dragged-releasing
!eval! (zerop (index-z (current-device)))
=goal>
op tapped-dragging-release
?manual>
preparation free
==>
=goal>
op swipe
+manual>
cmd tap-release
hand right
finger index)
(p do-swipe
=goal>
op swipe
?manual>
preparation free
==>
=goal>
op pinch
+manual>
cmd swipe
hand right
finger index
r 50
theta 0
num-fngrs 2)
(p do-pinch
=goal>
op pinch
?manual>
preparation free
==>
=goal>
op rotate
+manual>
cmd pinch
hand right
finger index
start-width 20
end-width 50)
(p do-rotate
=goal>
op rotate
?manual>
preparation free
==>
=goal>
op rotated
+manual>
cmd rotate
hand right
finger index
rotation 1)
)