I copied this code from the mesa introductory tutorial. the code is below
from tkinter import N
import mesa
class MoneyAgent(mesa.Agent):
"""An agent with fixed initial wealth."""
def __init__(self, unique_id, model):
super().__init__(unique_id, model)
self.wealth = 1
def step(self):
# The agent's step will go here.
#for demonstration purposeses we will print the agent's unique_id
print("Hi, I am agent " + str(self.unique_id) + ".")
class MoneyModel(mesa.Model):
""" A model with some number of agents."""
def__init__(self, N):
self.num_agents = N
self.schedule = mesa.time.randomActivation(self)
# Create agents
for i in range(self.num_agents):
a = MoneyAgent(i, self)
self.schedule.add(a)
def step(self):
"""Advance the model by one step."""
self.schedule.step()
The code I am apparently missing syntax is
def__init__(self, N):
and
self.schedule.step()
I don't quite understand why it says I am missing an expression, since I copied the code exactly as it was typed.