Repository navigation
document the duplicate coordinate - #3473
Conversation
|
Performance benchmarks:
|
…com/Krishsharma179/mesa into fix-duplicate-coordinate-validation
|
Hi @quaquel , please check this out when you get a chance! |
|
I’m not sure this should be treated as a bug. Right now Changing this to raise a ValueError would shift the behavior from replacement to a hard failure. That’s a significant behavioral change, especially since the current implementation doesn’t enforce any uniqueness checks and simply lets the new cell overwrite the old one. Also, modifying existing tests to enforce a new behavior is not the best way to handle this in my opinion. Given the comment that dynamically modifying DiscreteSpace isn’t really a primary supported workflow, I think enforcing validation here is the wrong direction. It is better to either document the overwrite behavior explicitly or discuss whether replacement vs. validation should actually be the intended API before locking it in with an exception and tests. |
|
@quaquel please check |
Hey @souro26 thanks for the feedback I understood that raising an error will be too extreme for this so I document this behavior explicitly |
|
Can you update the original description so it correctly reflects the actual implementation? |
| new cell (cell2). | ||
|
|
||
| - The original cell will vanish without any notification or error. | ||
| - All agents contained within the original cell will be permanently lost. |
| coordinates (e.g., cell1), it will be overwritten silently by the | ||
| new cell (cell2). | ||
|
|
||
| - The original cell will vanish without any notification or error. |
There was a problem hiding this comment.
not true perse. It has just been removed from the grid, but might stick around as a ghost cell depending on what holds references to it.
|
ok I will do it |
39a67cd to
84585ce
Compare
|
@quaquel Done! Updated the documentation to reflect the actual |
|
Please update the PR title and description |
(cherry picked from commit 62afb50)
Summary
In the current system in discrete_space.py in add_cell there is a probability that the user might initialize the new cell at the coordinate where there is already a cell then the previous cell will be overwritten by the new cell silently
Bug / Issue
#3469 This is the link to the related issue
Implementation
Just document this explicitly