Commit 67c2fb3a authored by Sergey Kireev's avatar Sergey Kireev
Browse files

small optimization

parent 36c7b46f
......@@ -523,12 +523,12 @@ class NLE_CA extends CellularAutomaton {
}
else if (rndN < desn + pgroup) { // group movement: N <-> L
find_groupsN();
int dir = int(random(dirs.ndirs()));
int label = gN[c.x][c.y];
if (may_move_group_NL(label,dir)) {
int size = gsN[label];
float p = 1.0/size;
if (random(1.0) < p) {
int size = gsN[label];
float p = 1.0/size;
if (random(1.0) < p) {
int dir = int(random(dirs.ndirs()));
if (may_move_group_NL(label,dir)) {
do_move_group_NL(label,dir);
moved_nlg += size;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment