147 |
of variation of distances to nearest neighbors) is computed in this global |
of variation of distances to nearest neighbors) is computed in this global |

148 |
update, and if the result has converged sufficiently, the "stabilize" here |
update, and if the result has converged sufficiently, the "stabilize" here |

149 |
results in all active strands being stabilized (and all their stabilize{} |
results in all active strands being stabilized (and all their stabilize{} |

150 |
methods would be called). If it clear that the computation cannot converge, |
methods would be called). On the other hand, if it clear that the |

151 |
global update can also call "die". */ |
computation cannot converge, global update can also call "die". */ |

152 |
global { |
global { |

153 |
/* could test convergence based on movement */ |
/* Could test convergence based on movement */ |

154 |
//real mvmt = max { |P.step|/rad | P in particle.all}; |
//real mvmt = max { |P.step|/rad | P in particle.all}; |

155 |
/* testing convergence based on distance to closest neighbor */ |
/* Testing convergence based on distance to closest neighbor */ |

156 |
real meancl = mean { P.closest | P in particle.all}; |
real meancl = mean { P.closest | P in particle.all}; |

157 |
real varicl = mean { (P.closest - meancl)^2 | P in particle.all}; |
real varicl = mean { (P.closest - meancl)^2 | P in particle.all}; |

158 |
real covcl = sqrt(varicl) / meancl; |
real covcl = sqrt(varicl) / meancl; |