### what's the meaning of neighborAddress?

153
views
1
8 months ago by
Hi, everyone. I am just reading the CC3D code in Ph.D. thesis 'Modeling interactions between a tumor cell and its host epithelium', Eline Boghaert, Princeton University (2014).
There are some puzzles for me in the following code, what're the properties of  neighborAddress ?
diameters?

#for each LEP calculate the number of cells that are 2.5 cell diameters away (2nd order neighbors)
class ApoptosisSteppable(SteppableBasePy):
def __init__(self,_simulator,_frequency=1):
SteppableBasePy.__init__(self,_simulator,_frequency)
def step(self,mcs):
if mcs>10:
cell_apoptosis=[]
for cell in self.cellListByType(1):
neighbors=[]
a=cell.id
id=[cell.id]
cellNeighborList=self.getCellNeighbors(cell)
for neighbor in cellNeighborList:

for cell in neighbors:
cellNeighborList=self.getCellNeighbors(cell)
for neighbor in cellNeighborList:
pass
else:
#if there are more than 10 cells within a 2.5 cell diameter radius the LEP undergoes apoptosis with a given probability
#the randint function is used to specify this probability
if len(id)>10 and randint(1,1000)<=10:
cell_apoptosis.append(a)

for cell in self.cellListByType(1):
if cell.id in cell_apoptosis:
cell.targetVolume=0
cell.lambdaVolume=1000
​
Community: CompuCell3D

4
8 months ago by
strictly speaking neighborAddress is a C++ address of the neighbor cell object. In Python neighborAddress is simply a neighbor cell so if you type:

you will get id of th neighbor cell

if you type

you will get volume of the neighbor cell

etc..

One thing to keep in mind is that Medium can be a neighbor too and Medium is a zero pointer in C++ so the neighbor address of it will be 0 and you cannot as for id or volume of the Medium. This is why you often see the if statement that checks if neighbor address is NULL or not

Also , the new examples in 3.7.6 + use somewhat cleaner terminology w.r.t. iteration over neghbors

Oh，I see, thank you. I still have a puzzle, when I meet some commands which don't appear in the manuals, how can I know its usage and function, in addition to asking in the community?
written 8 months ago by Yuan
Usually the best thing is to ask people in this forum. We are working to fix the documentation but sometimes  code development cycle is ahead of the documentation cycle. Any questions you post here will get incorporated into the manuals. It also help us understand what aspects of CC3D are most confusing to people
written 8 months ago by Maciek Swat
0
8 months ago by
I found the new Python Scripting Manual helpful in this particular case http://pythonscriptingmanual.readthedocs.io/en/latest/SteppableBasePy_class.html .
Most of the simulation is done on self.cellList, and I was able to understand the Python scripting more once I knew more about the basic class.

I like the particular example you posted. I am also doing simulations involving logic based on cell neighbors.