diff --git a/examples/bank_reserves/bank_reserves/model.py b/examples/bank_reserves/bank_reserves/model.py index 0bf7dd6ee..993c2d40b 100644 --- a/examples/bank_reserves/bank_reserves/model.py +++ b/examples/bank_reserves/bank_reserves/model.py @@ -114,6 +114,7 @@ def __init__( rich_threshold=10, reserve_percent=50, ): + super().__init__() self.height = height self.width = width self.init_people = init_people diff --git a/examples/boid_flockers/boid_flockers/model.py b/examples/boid_flockers/boid_flockers/model.py index 3f7428f09..22e9dce67 100644 --- a/examples/boid_flockers/boid_flockers/model.py +++ b/examples/boid_flockers/boid_flockers/model.py @@ -40,6 +40,7 @@ def __init__( keep from any other cohere, separate, match: factors for the relative importance of the three drives.""" + super().__init__() self.population = population self.vision = vision self.speed = speed diff --git a/examples/boltzmann_wealth_model/boltzmann_wealth_model/model.py b/examples/boltzmann_wealth_model/boltzmann_wealth_model/model.py index 0f61b8838..11a3e9587 100644 --- a/examples/boltzmann_wealth_model/boltzmann_wealth_model/model.py +++ b/examples/boltzmann_wealth_model/boltzmann_wealth_model/model.py @@ -18,6 +18,7 @@ class BoltzmannWealthModel(mesa.Model): """ def __init__(self, N=100, width=10, height=10): + super().__init__() self.num_agents = N self.grid = mesa.space.MultiGrid(width, height, True) self.schedule = mesa.time.RandomActivation(self) diff --git a/examples/boltzmann_wealth_model_network/boltzmann_wealth_model_network/model.py b/examples/boltzmann_wealth_model_network/boltzmann_wealth_model_network/model.py index 42d58bd8e..d7b433749 100644 --- a/examples/boltzmann_wealth_model_network/boltzmann_wealth_model_network/model.py +++ b/examples/boltzmann_wealth_model_network/boltzmann_wealth_model_network/model.py @@ -14,6 +14,7 @@ class BoltzmannWealthModelNetwork(mesa.Model): """A model with some number of agents.""" def __init__(self, num_agents=7, num_nodes=10): + super().__init__() self.num_agents = num_agents self.num_nodes = num_nodes if num_nodes >= self.num_agents else self.num_agents self.G = nx.erdos_renyi_graph(n=self.num_nodes, p=0.5) diff --git a/examples/charts/charts/model.py b/examples/charts/charts/model.py index 55352a397..8f3006434 100644 --- a/examples/charts/charts/model.py +++ b/examples/charts/charts/model.py @@ -97,6 +97,7 @@ def __init__( rich_threshold=10, reserve_percent=50, ): + super().__init__() self.height = height self.width = width self.init_people = init_people diff --git a/examples/color_patches/color_patches/model.py b/examples/color_patches/color_patches/model.py index 973b91ad3..9b4227b30 100644 --- a/examples/color_patches/color_patches/model.py +++ b/examples/color_patches/color_patches/model.py @@ -71,7 +71,7 @@ def __init__(self, width=20, height=20): Create a 2D lattice with strict borders where agents live The agents next state is first determined before updating the grid """ - + super().__init__() self._grid = mesa.space.SingleGrid(width, height, torus=False) self._schedule = mesa.time.SimultaneousActivation(self) diff --git a/examples/conways_game_of_life/conways_game_of_life/model.py b/examples/conways_game_of_life/conways_game_of_life/model.py index bf2204e02..f6c9637a6 100644 --- a/examples/conways_game_of_life/conways_game_of_life/model.py +++ b/examples/conways_game_of_life/conways_game_of_life/model.py @@ -13,6 +13,7 @@ def __init__(self, width=50, height=50): """ Create a new playing area of (width, height) cells. """ + super().__init__() # Set up the grid and schedule. diff --git a/examples/el_farol/el_farol/model.py b/examples/el_farol/el_farol/model.py index d636903e5..e03fa54e2 100644 --- a/examples/el_farol/el_farol/model.py +++ b/examples/el_farol/el_farol/model.py @@ -14,6 +14,7 @@ def __init__( height=100, N=100, ): + super().__init__() self.running = True self.num_agents = N self.schedule = mesa.time.RandomActivation(self) diff --git a/examples/forest_fire/forest_fire/model.py b/examples/forest_fire/forest_fire/model.py index 3d5f448a2..843176b71 100644 --- a/examples/forest_fire/forest_fire/model.py +++ b/examples/forest_fire/forest_fire/model.py @@ -16,6 +16,7 @@ def __init__(self, width=100, height=100, density=0.65): width, height: The size of the grid to model density: What fraction of grid cells have a tree in them. """ + super().__init__() # Set up model objects self.schedule = mesa.time.RandomActivation(self) self.grid = mesa.space.SingleGrid(width, height, torus=False) diff --git a/examples/hex_snowflake/hex_snowflake/model.py b/examples/hex_snowflake/hex_snowflake/model.py index ef9b61134..329bfe117 100644 --- a/examples/hex_snowflake/hex_snowflake/model.py +++ b/examples/hex_snowflake/hex_snowflake/model.py @@ -13,7 +13,7 @@ def __init__(self, width=50, height=50): """ Create a new playing area of (width, height) cells. """ - + super().__init__() # Set up the grid and schedule. # Use SimultaneousActivation which simulates all the cells diff --git a/examples/pd_grid/pd_grid/model.py b/examples/pd_grid/pd_grid/model.py index d2445c88d..b970c0f4c 100644 --- a/examples/pd_grid/pd_grid/model.py +++ b/examples/pd_grid/pd_grid/model.py @@ -29,6 +29,7 @@ def __init__( Determines the agent activation regime. payoffs: (optional) Dictionary of (move, neighbor_move) payoffs. """ + super().__init__() self.grid = mesa.space.SingleGrid(width, height, torus=True) self.schedule_type = schedule_type self.schedule = self.schedule_types[self.schedule_type](self) diff --git a/examples/schelling/model.py b/examples/schelling/model.py index c7fe766ac..2eb148df6 100644 --- a/examples/schelling/model.py +++ b/examples/schelling/model.py @@ -38,8 +38,7 @@ class Schelling(mesa.Model): """ def __init__(self, width=20, height=20, density=0.8, minority_pc=0.2, homophily=3): - """ """ - + super().__init__() self.width = width self.height = height self.density = density diff --git a/examples/shape_example/shape_example/model.py b/examples/shape_example/shape_example/model.py index 5ffe114af..23f47a6ff 100644 --- a/examples/shape_example/shape_example/model.py +++ b/examples/shape_example/shape_example/model.py @@ -11,6 +11,7 @@ def __init__(self, unique_id, model, pos, heading=(1, 0)): class ShapeExample(mesa.Model): def __init__(self, N=2, width=20, height=10): + super().__init__() self.N = N # num of agents self.headings = ((1, 0), (0, 1), (-1, 0), (0, -1)) # tuples are fast self.grid = mesa.space.SingleGrid(width, height, torus=False) diff --git a/examples/sugarscape_cg/sugarscape_cg/model.py b/examples/sugarscape_cg/sugarscape_cg/model.py index e323c77e2..e1857cb0d 100644 --- a/examples/sugarscape_cg/sugarscape_cg/model.py +++ b/examples/sugarscape_cg/sugarscape_cg/model.py @@ -30,6 +30,7 @@ def __init__(self, width=50, height=50, initial_population=100): Args: initial_population: Number of population to start with """ + super().__init__() # Set parameters self.width = width diff --git a/examples/sugarscape_g1mt/sugarscape_g1mt/model.py b/examples/sugarscape_g1mt/sugarscape_g1mt/model.py index 2cba53d17..6055f526b 100644 --- a/examples/sugarscape_g1mt/sugarscape_g1mt/model.py +++ b/examples/sugarscape_g1mt/sugarscape_g1mt/model.py @@ -53,6 +53,7 @@ def __init__( vision_max=5, enable_trade=True, ): + super().__init__() # Initiate width and heigh of sugarscape self.width = width self.height = height diff --git a/examples/virus_on_network/virus_on_network/model.py b/examples/virus_on_network/virus_on_network/model.py index 961c56bcf..2cee39ccc 100644 --- a/examples/virus_on_network/virus_on_network/model.py +++ b/examples/virus_on_network/virus_on_network/model.py @@ -40,6 +40,7 @@ def __init__( recovery_chance=0.3, gain_resistance_chance=0.5, ): + super().__init__() self.num_nodes = num_nodes prob = avg_node_degree / self.num_nodes self.G = nx.erdos_renyi_graph(n=self.num_nodes, p=prob)