-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgrouped.py
More file actions
41 lines (26 loc) · 1.01 KB
/
Copy pathgrouped.py
File metadata and controls
41 lines (26 loc) · 1.01 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
# ACT-R tutorial unit 5 grouped task.
# This is a simple example task to show partial matching.
# It simply runs the model and records values that the
# model provides and returns the list of provided values
# in the order provided after the run.
# Import the actr module for tutorial tasks
import actr
# Load the corresponding model for the task.
actr.load_act_r_model("ACT-R:tutorial;unit5;grouped-model.lisp")
# Create a variable to hold the responses
response = []
# The recall function creates a command for
# the record_response function, clears the response
# list, runs the model, and returns the response list.
def recall ():
actr.add_command("grouped-response",record_response,"Response recording function for the tutorial grouped model.")
global response
response = []
actr.reset()
actr.run(20)
actr.remove_command("grouped-response")
return response
# Store a value provided by the model on the response list
def record_response (item):
global response
response.append(item)