Skip to content

Understanding simple_production_v3.py

githubjimmyd edited this page Jan 30, 2019 · 9 revisions

From the code tab at the top, download simple_production_v3.py into your ccm suite folder.
Right-click it and select "open in Idle."

You can read over the comments in the file. This page has more detailed descriptions of the code. Python ACT-R actually re-programs parts of Python, being it to its will. If you already understand how to program in Python, you might get some interference, because certain functions have been redefined!

Importing Functions to Make it Work

import ccm

log=ccm.log()

from ccm.lib.actr import *

This is a code block.

For now, these commands should be in every Python ACT-R model you make.
They import the necessary functions for everything to run, and saves a record of what happened into a variable called "log."

The Environment

This is where we will eventually put things that are in the agent's environment--that is, not concepts in the head, but in the (simulated) world. But we're trying to keep things simple, so, for now, we will have nothing in the environment. To do this, we just put in 'pass.'

class MyEnvironment(ccm.Model):

`pass`

Clone this wiki locally