Skip to main content
. 2022 Mar 2;19(188):20210824. doi: 10.1098/rsif.2021.0824
Algorithm 2. Computational implementation of the neurite growth algorithm.
1: Initialize: user chooses the number of neurites simulated (N) and, assuming the starting time is (t = 0), the duration (tend).
2: All N neurites at t = 0 are distributed randomly across the distal cross section of the NRC
3: while t < tend do
4:  Build the array LN of nodes (m) at a distance < 10± δ μm.
5:  Remove all the nodes that are occupied by neurites as well as the ones belonging to matrix O, which are outside the geometry of the NRC.
6: if ɛ neurites detected the same node do
7:   Generate random variable X between 0 and 1 with each neurite having probability 1ε of being chosen.
8:   The first neurite that has [0,1/ε,2/εε/ε]X>0 is chosen.
9:  end if
10:  Calculate θ between neurite consecutive segments.
11:  Get the value of the cues at the nodes detected (Pwi(t).)
12:  Normalize both M(θwi) and Pwi(t), respectively, and calculate F(wi) = M(θw) + Pw(t).
13:  Create the cumulative array CN=[F(1),F(1)+F(2),F(1)+F(2)+F(3),F(w1)++F(ϑ)],
14:  Generate random variables 0XN<i=1mF(w)
15:  Find the node at γ which is the index of the first true value for TN = CNX > 0.
16:  Perform step 14 and 15 NR times.
17:  The next position of the neurite is the node that has been most frequently chosen.
18:  t = t + τ, where τ is the time step considered.
19:   end while