Example #1
0
 def growZweig(self, cLtPBk):
     assert cLtPBk <= 1
     if self.fGerm:
         self.becomeInact()
         dMnMx = self.dIA['dMinMax']
         # draw a value for the length of this "Zweig"
         lenZw = Fkt.drawVRel(self.dLenZw, self.nKZw, self.sDirN, self.cM,
                              dMnMx['LenZw'], dMnMx['NKZw'],
                              self.dFAd['LenZw'],
                              self.dITp['dDist']['NKZw'])
         # adjust the "Zweig" length according to the available light
         if self.dIA['lvlDbg'] > 0 and cLtPBk < 1:
             print('lenZw (before):', lenZw,
                   '- current light propagated in block:', cLtPBk)
         lenZw *= cLtPBk
         if self.dIA['lvlDbg'] > 0:
             print('lenZw (after):', lenZw)
         # TODO - change
         if lenZw < 10:
             return 0
         dInfo = {
             'VertZ': self.cAnVZ,
             'RelPZw': self.cAnRZ,
             'RelPKt': self.pKR,
             'LenZw': self.lenZ,
             'AgeZw': 1,
             'AgeBm': self.ageB
         }
         # draw a value for the number of "Knoten" on this "Zweig"
         nKZw = Fkt.drawDict(self.dITp, dInfo, dMnMx, 'dDist', 'NKZw',
                             'dNumNKZw', 'dBndAr', 'dCtWt', self.sDirN,
                             self.cM)
         #             # adjust the number of "Knoten" according to the available light
         #             nKZw = max(1, round(nKZw*cLtPBk))
         lFDstK = Fkt.drawLVRel(self.dFPKZw, nKZw, self.sDirN, self.cM,
                                dMnMx['FctPKZw'],
                                self.dITp['dDist']['NKZw'])
         return Zweig(self.dIA, self.dITp, self.cMk, self.dFAd, self.dFPEZw,
                      self.dAnEPlr, self.dAnEAzm, self.IDKs, self.pathID,
                      self.yrG, self.ageB, self.pKC, self.sDirN,
                      self.vDirZw, self.vDir, self.cAnVZ, self.cAnRZ, lenZw,
                      lFDstK)
Example #2
0
 def growKnoten(self, lKN, mxIDKt, iKN, cY):
     for k in range(len(self.lKC)):
         iKN += 1
         dInfo = {
             'VertZ': self.cAnVZ,
             'RelPZw': self.cAnRZ,
             'RelPKt': self.lFDsK[k],
             'LenZw': self.lenZ,
             'AgeZw': self.ageZ,
             'AgeBm': self.ageB
         }
         nKKt = Fkt.drawDict(self.dITp, dInfo, self.dIA['dMinMax'], 'dDist',
                             'NKKt', 'dNumNKKt', 'dBndAr', 'dCtWt',
                             self.sDir, self.cM)
         #             print('Growing Knoten with ID', mxIDKt + iKN, '.')
         lKN.append(
             Knoten(self.dIA, self.dITp, self.cMk, self.dFAd, mxIDKt + iKN,
                    self.pathID + [self.IDZ], k, cY, self.ageB, self.ageZ,
                    self.lenZ, self.lKC[k], self.lFDsK[k],
                    self.lKPS[k], self.sDir, self.vDirP, self.lKVD[k],
                    len(self.vDsK), nKKt))
     self.lKZw = [cKt for cKt in lKN[-len(self.lKC):]]
     return iKN