-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathchoice.py
More file actions
54 lines (33 loc) · 1.26 KB
/
Copy pathchoice.py
File metadata and controls
54 lines (33 loc) · 1.26 KB
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
import actr
actr.load_act_r_model("ACT-R:tutorial;unit6;choice-model.lisp")
choice_data = [0.664, 0.778, 0.804, 0.818]
response = False
def respond_to_key_press (model,key):
global response
response = key
def person():
global response
if actr.visible_virtuals_available():
window = actr.open_exp_window("Choice Experiment",visible=True)
actr.add_command("choice-response",respond_to_key_press,"Choice task key response")
actr.monitor_command("output-key","choice-response")
actr.add_text_to_exp_window (window, 'choose', x=50, y=100)
response = ''
while response == '':
actr.process_events()
actr.clear_exp_window(window)
if actr.random(1.0) < .9:
answer = 'heads'
else:
answer = 'tails'
actr.add_text_to_exp_window (window, answer, x=50, y=100)
start = actr.get_time(False)
while (actr.get_time(False) - start) < 1000:
actr.process_events()
actr.remove_command_monitor("output-key","choice-response")
actr.remove_command("choice-response")
return response
def model ():
None
def data (n):
None