-
-
Notifications
You must be signed in to change notification settings - Fork 186
Progress on AntColony #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
requirements: Pin Mesa version to 1.x
add gis examples
"Fixed capitalization."
Fix Capitalization of File Names
…t of unnecessary dependencies
…e_tutorial_boltzmann Update outdated readme for Boltmann example + trim requirements.txt
* Use Pathlib Code by Phil Robare (versilimidude2) * Use pre-commit * Dropped unused imports * used pre-commit to run pyupgrade, trim whitespace * Remove pathlib changes These belong in a separate PR. * remove redundant black, move comment as per rht's suggestions --------- Co-authored-by: Catherine Devlin <[email protected]>
* Use Pathlib Code by Phil Robare (versilimidude2) * Add .pre-commit * ran black --------- Co-authored-by: Catherine Devlin <[email protected]>
Co-authored-by: Jeremy Silver <[email protected]>
* fix bug where agent gives money to itself in the boltzmann model example * [pre-commit.ci] auto fixes from pre-commit.com hooks --------- Co-authored-by: Houssam Kherraz <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
| y = self.random.randrange(self.height) | ||
| energy = self.red_starting_energy | ||
| ant = Ant(self.next_id(), (x, y), self, moore=True) | ||
| self.space.place_agent(ant, np.array((x, y))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be a tuple (x, y) instead of np.array, because the latter can't be cached.
| self.red_starting_energy = red_starting_energy | ||
| self.blue_starting_energy = blue_starting_energy | ||
| self.pheromone_evaporation_rate = pheromone_evaporation_rate | ||
| self.space = mesa.space.ContinuousSpace(width, height, True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.grid instead of self.space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Encountered AttributeError: 'ContinuousSpace' object has no attribute 'get_cell_list_contents'. As such, I switched this to MultiGrid.
|
|
||
| return portrayal | ||
|
|
||
| canvas_element = SimpleCanvas(ant_colony_portrayal, 500, 500) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reduced the canvas size to 50, 50. And was able to run the simulation just fine.
|
Reopening so that there is a reminder that there is a WIP on this model. |

No description provided.