First we import all necessary files.
In [ ]:
from models.coop import set_up
We then initialize global variables.
In [ ]:
from indra.agent import Agent
from indra.composite import Composite
from indra.env import Env, UNLIMITED
from indra.registry import get_env, get_group, get_prop
from indra.utils import gaussian
from indra.user import user_tell
from indra.utils import init_props
MODEL_NAME = 'coop'
DEF_BABYSITTER = 10
DEF_DESIRED_CASH_BAL = 8
DEF_COUPON = 2
DEF_DISTRIBUTING_COUPON = 2
DEF_SIGMA = 0.2
DEF_PERCENT = 10
CO_OP_MEMBERS = "Co-op members"
BABYSIT = "BABYSITTING"
GO_OUT = "GOING_OUT"
CB_intervention_points = []
num_of_rounds = 1
last_period_exchanges = 0
last_period_unemployed = 0
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('coop_env', members=[co_op_members, central_bank],
.runN()
You can view the position of all of the agents in space with the following command:
In [ ]:
Env('coop_env', members=[co_op_members, central_bank],
.scatter_graph()
You can view the line graph through the following command:
In [ ]:
Env('coop_env', members=[co_op_members, central_bank],
.line_graph()