Skip to content
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

Make connections in experiment cell spaces named #2060

Open
quaquel opened this issue Feb 28, 2024 · 0 comments
Open

Make connections in experiment cell spaces named #2060

quaquel opened this issue Feb 28, 2024 · 0 comments
Labels
feature Release notes label

Comments

@quaquel
Copy link
Contributor

quaquel commented Feb 28, 2024

What's the problem this feature will solve?
Currently the connections of Cell are stored as a list in _connections. While developing cell space, it was suggested to replace this with a dict with named connections. This would make it possible to get the cell to, e.g., the left or right, top or bottom in case of a von Neumann grid. Once connections are named, all kinds of other movements over the cell space are easily expressed.

For example, it becomes trivial to retrieve all cells on a diagonal in a Moore grid.

# within an agent class
startcell = self.cell
cell = None
diagonal = []
while cell is not startcell:
    cell = cell.connections['top_left']
    diagonal.append(cell)

Describe the solution you'd like
The largest challenge is to come to a clear naming of the connections. This is likely to be different across OrthogonalMooreGrid, OrthogonalVonNeumannGrid, and HexGrid. Moreover, it might not work for Network, and become tricky for n-dimensional grids

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Release notes label
Projects
None yet
Development

No branches or pull requests

1 participant