briandconnelly / seeds

Stochastic Cellular Artificial Life Simulator
Other
20 stars 4 forks source link

Topology.get_neighbors() should take a cell instead of a node #9

Closed zamanlh closed 13 years ago

zamanlh commented 13 years ago

It would be nice to ignore nodes entirely in the code, and if people need to get neighbors of a cell, for infection, or game theory stuffs, then you have to pass the node in. Instead we should pass a cell, and since the base Cell class knows its node, it can reliably access this variable and abstract the whole node business away.

briandconnelly commented 13 years ago

Getting neighboring cells is now a little different. A Cell's update() method no longer takes a list of neighbors as argument. Instead, a Cell object can call get_neighbors (a method defined in Cell) to get a list of its neighboring Cells. This should address this issue as well as make it so neighbor lists only need to be found on demand.

Will be pushed to here soon...