Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sergey Kireev
nle
Commits
67c2fb3a
Commit
67c2fb3a
authored
Oct 14, 2021
by
Sergey Kireev
Browse files
small optimization
parent
36c7b46f
Changes
1
Hide whitespace changes
Inline
Side-by-side
nle_processing/sketch_NLE_CA/NLE_CA.pde
View file @
67c2fb3a
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment