|
294 | 294 | " super().__init__(seed=seed)\n",
|
295 | 295 | " self.num_agents = n\n",
|
296 | 296 | "\n",
|
297 |
| - " # Create agents\n", |
298 |
| - " MoneyAgent.create_agents(\n", |
299 |
| - " model=self, n=n\n", |
300 |
| - " ) # This calls the agent class parameter n number of times\n", |
| 297 | + " # Create n agents\n", |
| 298 | + " MoneyAgent.create_agents(model=self, n=n)\n", |
301 | 299 | "\n",
|
302 | 300 | " def step(self):\n",
|
303 | 301 | " \"\"\"Advance the model by one step.\"\"\"\n",
|
|
476 | 474 | " self.num_agents = n\n",
|
477 | 475 | "\n",
|
478 | 476 | " # Create agents\n",
|
479 |
| - " MoneyAgent.create_agents(\n", |
480 |
| - " model=self, n=n\n", |
481 |
| - " ) # This calls the agent class parameter n number of times\n", |
| 477 | + " MoneyAgent.create_agents(model=self, n=n)\n", |
482 | 478 | "\n",
|
483 | 479 | " def step(self):\n",
|
484 | 480 | " \"\"\"Advance the model by one step.\"\"\"\n",
|
|
1319 | 1315 | " ethnicities = [\"Green\", \"Blue\", \"Mixed\"]\n",
|
1320 | 1316 | "\n",
|
1321 | 1317 | " # Create agents\n",
|
1322 |
| - " MoneyAgent.create_agents(self, n, self.random.choice(ethnicities))\n", |
| 1318 | + " MoneyAgent.create_agents(model=self, n=n, ethnicity=self.random.choice(ethnicities))\n", |
1323 | 1319 | "\n",
|
1324 | 1320 | " self.datacollector = mesa.DataCollector(\n",
|
1325 | 1321 | " model_reporters={\"Gini\": compute_gini},\n",
|
|
0 commit comments