How to run the ../models/wolfram model.

First we import all necessary files.


In [ ]:
import ast
from models.wolfram import set_up

We then initialize global variables.


In [ ]:
from indra.agent import Agent
from indra.composite import Composite
from indra.display_methods import BLACK, WHITE, SQUARE
from indra.env import Env
from indra.space import DEF_WIDTH
from indra.utils import get_props

MODEL_NAME = "wolfram"
DEBUG = False  # Turns debugging code on or off
DEF_RULE = 30

# Group codes:
W = 0
B = 1

wolfram_env = None
groups = None
rule_dict = None
curr_row = None
rule_num = None

Next we call the set_up function to set up the environment, groups, and agents of the model.


In [ ]:
(wolfram_env, groups, rule_dict) = set_up()

You can run the model N periods by typing the number you want in the following function and then running it.


In [ ]:
wolfram_env.runN()

You can view the position of all of the agents in space with the following command:


In [ ]:
wolfram_env.scatter_graph()

You can view the line graph through the following command:


In [ ]:
wolfram_env.line_graph()