CompuCell3D / cc3d-player5

CC3D Player 5
GNU Lesser General Public License v3.0
4 stars 4 forks source link

Reassigning a cell's clusterId erases the cell's dictionary. #30

Open jpsluka opened 1 year ago

jpsluka commented 1 year ago

CC3D 4.4.0 (Windows 11) Cluster_dictionary_bug.zip

Reassigning a cell to a new cluster erases the dictionary associated with the cell.

The attached sim starts with 13 cells. Each gets a dictionary assigned to it ('info').

The 13 cells are then collapsed into one cluster with self.reassign_cluster_id(cell, cell1.clusterId)

The cells have lost there dictionaries after they are merged into the same cluster. Only the cell that was originally in the cluster keeps its dictionary.

Console output:

Before cluster reasssign
1: cell.clusterId,cell.id,cell.dict: 1 1 {'info': '1 1'}
1: cell.clusterId,cell.id,cell.dict: 2 2 {'info': '2 1'}
1: cell.clusterId,cell.id,cell.dict: 3 3 {'info': '3 1'}
1: cell.clusterId,cell.id,cell.dict: 4 4 {'info': '4 2'}
1: cell.clusterId,cell.id,cell.dict: 5 5 {'info': '5 1'}
1: cell.clusterId,cell.id,cell.dict: 6 6 {'info': '6 2'}
1: cell.clusterId,cell.id,cell.dict: 7 7 {'info': '7 2'}
1: cell.clusterId,cell.id,cell.dict: 8 8 {'info': '8 1'}
1: cell.clusterId,cell.id,cell.dict: 9 9 {'info': '9 2'}
1: cell.clusterId,cell.id,cell.dict: 10 10 {'info': '10 1'}
1: cell.clusterId,cell.id,cell.dict: 11 11 {'info': '11 1'}
1: cell.clusterId,cell.id,cell.dict: 12 12 {'info': '12 2'}
1: cell.clusterId,cell.id,cell.dict: 13 13 {'info': '13 1'}

After cluster reasssign
2: cell.clusterId,cell.id,cell.dict: 1 1 {'info': '1 1'}
2: cell.clusterId,cell.id,cell.dict: 1 2 {}
2: cell.clusterId,cell.id,cell.dict: 1 3 {}
2: cell.clusterId,cell.id,cell.dict: 1 4 {}
2: cell.clusterId,cell.id,cell.dict: 1 5 {}
2: cell.clusterId,cell.id,cell.dict: 1 6 {}
2: cell.clusterId,cell.id,cell.dict: 1 7 {}
2: cell.clusterId,cell.id,cell.dict: 1 8 {}
2: cell.clusterId,cell.id,cell.dict: 1 9 {}
2: cell.clusterId,cell.id,cell.dict: 1 10 {}
2: cell.clusterId,cell.id,cell.dict: 1 11 {}
2: cell.clusterId,cell.id,cell.dict: 1 12 {}
2: cell.clusterId,cell.id,cell.dict: 1 13 {}