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

First we import all necessary files.


In [ ]:
from indra.agent import Agent
from indra.composite import Composite
from indra.display_methods import RED, BLUE
from indra.env import Env
from indra.registry import get_env, get_prop
from indra.space import DEF_HEIGHT, DEF_WIDTH
from indra.user import user_tell
from indra.utils import init_props
from models.basic import set_up

We then initialize global variables.


In [ ]:
MODEL_NAME = "basic"
DEBUG = True  # turns debugging code on or off
DEBUG2 = False  # turns deeper debugging code on or off

DEF_NUM_BLUE = 10

DEF_NUM_RED = 10

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


In [ ]:
set_up()

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


In [ ]:
Env("env",
.runN()

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


In [ ]:
Env("env",
.scatter_graph()

You can view the line graph through the following command:


In [ ]:
Env("env",
.line_graph()