Comments (4)
I was thinking about how this would integrate with the _PropertyGrid introduced in #1898. That currently offers separate functions for the selection of target cells, and then moving to the target cells.
def select_cells_by_properties():
def move_agent_to_cell_by_properties():
def select_extreme_value_cells():
def move_agent_to_extreme_value_cell():
If move_agent
would also take a list or mask of target cells, that could allow removing the two movement methods from #1898, and make the API more consistent. All movement goes through move_agents
, and any amount of custom methods can be written to select some target cells.
Currently, #1898 also include two mask functions which limit the number of candidate cells to cells empty or in a neighborhood.
def get_empty_mask():
def get_neighborhood_mask():
We might also want to integrate that into the move_agent
method. It could take a mask or a list of masks.
A utility method to combine a list of masks into a single mask could also be provided.
from mesa.
Maybe we can combine things:
def move_agent(agent, pos=None, empty=False, neighborhood=None, mask=None, selection="random"):
- pos: A single position or list of possible positions
- empty: False allows all cells, True only empty ones
- neighborhood: Optional neighborhood (#1900)
- mask: a mask or list of masks of allowed input cells
- selection: Can be "random" or "closest". Maybe something else in the future (in the _PropertyGrid it could be highest or lowest maybe).
from mesa.
@jackiekazil @tpike3 Same story as with #1905, I would like to discuss and potentially implement this before moving on the PropertyLayer (#1898), since this is a more generalized solution for a problem that I specifically solve in that PR. So if we can implement this, it would make especially the _PropertyGrid in #1898 a lot simpler.
So my specific questions are:
- Do you agree we should expand the built-in
move_agent()
movement method to allow moving to an empty, random or neighbouring cell? - What do you think of the current proposed API? Do you like the initial one better or the last one?
from mesa.
I went for a relatively simple implementation: The move_agent
method now can take a list of positions and choose either one randomly or the closest:
Selecting neighborhoods and empty cells can be done with other functions, and support for masks will be added in #1898.
from mesa.
Related Issues (20)
- JupyterViz: after changing parameters, play button does not work HOT 2
- JupyterViz: allow customizing the controls/display for a single model, e.g. to display status (running/converged) HOT 1
- Clean up HexSingleGrid(HexGrid) andHexGrid HOT 3
- phoneinfoga error: could not open requirements file: [errno 21] is a directory: 'requirements.txt' HOT 2
- JupyterViz / Solara visualisation doesn't work in JetBrains PyCharm/DataSpell Jupyter notebooks HOT 5
- mesa.visualization.chartmodule doesn't work HOT 6
- jupyterviz agent space and measures flash on mesa 2.1.4 HOT 2
- TyperError when model reporter is a partial function
- Proposal: Adding Cell Properties to Grids in Mesa HOT 22
- Latest Mesa build is failing on conda-forge HOT 7
- Enable DiscreteEventScheduler to handle system-level events and task interruptions
- Add Voronoi tessellation space
- Add Triangle mesh space
- Proposal: Formal neighborhood definition for grids HOT 42
- Proposal: Agent selection method HOT 7
- JupyterViz: disabled space drawer is ignored when rendering in the browser HOT 1
- jupyterviz: best practices for model layout HOT 1
- best practices / example for parameter sweep with batch runner HOT 15
- AttributeError: 'Model' object has no attribute 'agents' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mesa.