Skip to content

Commit

Permalink
Make connections in experiment cell space named projectmesa#2060
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhijit1102 committed Feb 28, 2024
1 parent ca748d7 commit 4156489
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mesa/experimental/cell_space/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Cell:

__slots__ = [
"coordinate",
"_connections",
"connections",
"agents",
"capacity",
"properties",
Expand Down Expand Up @@ -56,7 +56,7 @@ def __init__(
"""
super().__init__()
self.coordinate = coordinate
self._connections: list[Cell] = [] # TODO: change to CellCollection?
self.connections: dict[str, Cell] = {} # TODO: change to CellCollection?
self.agents = [] # TODO:: change to AgentSet or weakrefs? (neither is very performant, )
self.capacity = capacity
self.properties: dict[str, object] = {}
Expand All @@ -69,7 +69,7 @@ def connect(self, other: Cell) -> None:
other (Cell): other cell to connect to
"""
self._connections.append(other)
self.connections.append(other)

def disconnect(self, other: Cell) -> None:
"""Disconnects this cell from another cell.
Expand All @@ -78,7 +78,7 @@ def disconnect(self, other: Cell) -> None:
other (Cell): other cell to remove from connections
"""
self._connections.remove(other)
self.connections.remove(other)

def add_agent(self, agent: CellAgent) -> None:
"""Adds an agent to the cell.
Expand Down

0 comments on commit 4156489

Please sign in to comment.