Skip to content

Commit 847b896

Browse files
authored
Create hello_world.py
Very simple Python ACT-R code. This is a "Hello World" program, the purpose of which is to aid someone going through the tutorial in making sure that Python ACT-R is running correctly.
1 parent 00a9164 commit 847b896

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from python_actr import * ## Imports the code you need to run Python ACT-R
2+
3+
class MyAgent(ACTR): ## Each agent will be an instance of the class MyAgent,
4+
## which is a subclass of the class ACTR
5+
6+
focus=Buffer() ## There is a memory buffer called focus
7+
focus.set('greeting:hello') ## We set the focus to the task of greeting.
8+
9+
def hello(focus='greeting:hello'): ## if focus buffer has this thing in it
10+
print("hello world!") ## print something
11+
focus.set('greeting:stop') ## change chunk in focus buffer. Required for it to stop.
12+
13+
tim=MyAgent() ## Create an instance of MyAgent called tim
14+
tim.run() ## Now tim has a focus and something to do, so run tim.

0 commit comments

Comments
 (0)