mendozacortesgroup/chinampas

In a branch, does the label of the vertex needs to be consecutive?

Closed this issue · 2 comments

Hi,

Do we require that the vertices on a branch have consecutive labels?
To test this, I run

tree = ch.Tree_Chinampa(0,{0:{'activations':[[3,0],[5,0]],'branches':[1,2]},
                           1:{'activations':[[0,0],[4,0]],'branches':[]},
                           2:{'activations':[[1,2],[2,2]],'branches':[]}
                           }
                       )
print(f" will the vertex 5 be activated at time 5? {tree.will_vertex_be_activated(5,5)}, how about at time 6? {tree.will_vertex_be_activated(5,6)}") ```
And it returned 

> ---------------------------------------------------------------------------
RecursionError                            Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_10060\329558848.py in <module>
      6                        )
      7 print(f"if we activate the vertices 0,1, 4, 5 at time 0, the vertices 2,3 at time 2, ")
----> 8 print(f" will the vertex 5 be activated at time 5? {tree.will_vertex_be_activated(5,5)}, how about at time 6? {tree.will_vertex_be_activated(5,6)}") #The node index is global i.e, node 0 is in branch 1, node 2 in branch 2, etc. -Luke

~\Documents\GitHub\chinampas\chinampas\chinampa.py in will_vertex_be_activated(self, n, t_0)
    271         '''
    272         if self.chain.lV <= n and n<= self.chain.rV:
--> 273             self.extend_chain()
    274             return self.chain.will_vertex_be_activated(n,t_0)
    275 

~\Documents\GitHub\chinampas\chinampas\chinampa.py in extend_chain(self)
    251             branch_times = []
    252             for branch in self.branches:
--> 253                 times = self.when_will_vertex_be_activated(branch.chain.rV)
    254 
    255                 for time in times:

~\Documents\GitHub\chinampas\chinampas\chinampa.py in when_will_vertex_be_activated(self, n)
    285         '''
    286         if self.chain.lV <= n and n<= self.chain.rV:
--> 287             self.extend_chain()
    288             return list(set(self.chain.when_will_vertex_be_activated(n)))
    289 

... last 2 frames repeated, from the frame below ...

~\Documents\GitHub\chinampas\chinampas\chinampa.py in extend_chain(self)
    251             branch_times = []
    252             for branch in self.branches:
--> 253                 times = self.when_will_vertex_be_activated(branch.chain.rV)
    254 
    255                 for time in times:

RecursionError: maximum recursion depth exceeded while calling a Python object

Yes, we assume that the vertex labels decrease as we traverse down the tree. Is this
causing problems?

I see, I think I just need to add it to the description. Ill close this Issue then.