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
4bbd2143
Commit
4bbd2143
authored
Nov 12, 2021
by
Sergey Kireev
Browse files
processing version fix
parent
484f2fad
Changes
1
Hide whitespace changes
Inline
Side-by-side
nle_processing/sketch_NLE_CA/NLE_CA.pde
View file @
4bbd2143
...
...
@@ -344,7 +344,7 @@ class NLE_CA extends CellularAutomaton {
return
count
;
}
int
[]
neighborhood
(
int
x
,
int
y
)
{
// error here!
int
[]
neighborhood
(
int
x
,
int
y
)
{
int
count_n
=
0
;
int
count_l
=
0
;
int
count_e
=
0
;
...
...
@@ -479,9 +479,8 @@ class NLE_CA extends CellularAutomaton {
void
do_move_group_NL
(
int
label
,
int
dir
)
{
exit
();
}
int
count_neighbors_N
(
int
bx
,
int
by
)
{
println
(
"TODO!!!"
);
exit
();
return
0
;
}
// TODO
boolean
may_absorb
(
int
bx
,
int
by
)
{
return
is_filled_L
(
bx
,
by
);
}
boolean
may_desorb
(
int
bx
,
int
by
)
{
return
count_neighbors
_N
(
bx
,
by
)
<
minndes
;
}
boolean
may_desorb
(
int
bx
,
int
by
)
{
return
count_
N_
neighbors
(
bx
,
by
)
<
minndes
;
}
boolean
applyRule
(
int
[][]
cell
,
int
[][]
newcell
,
int
i
,
int
j
)
{
XY
c
=
new
XY
(
i
,
j
);
...
...
@@ -1484,10 +1483,10 @@ class NLE_squ8_CA extends NLE_squ_CA {
final
int
[]
c2
=
test_count_nle_on_line
(
bx
-
1
,
by
+
nsize
,
1
,
0
,
nsize
+
2
,
sLT
,
sRT
);
final
int
[]
c3
=
test_count_nle_on_line
(
bx
-
1
,
by
-
1
,
0
,
1
,
nsize
+
2
,
sRT
,
sRB
);
int
snn
=
c0
[
0
]
+
c1
[
0
]
+
c2
[
0
]
+
c3
[
0
];
{
int
s
=
state_clear_id
(
getfix
(
bx
-
1
,
by
-
1
));
if
(
isN
(
s
))
snn
--
;
}
{
int
s
=
state_clear_id
(
getfix
(
bx
+
nsize
,
by
-
1
));
if
(
isN
(
s
))
snn
--
;
}
{
int
s
=
state_clear_id
(
getfix
(
bx
-
1
,
by
+
nsize
));
if
(
isN
(
s
))
snn
--
;
}
{
int
s
=
state_clear_id
(
getfix
(
bx
+
nsize
,
by
+
nsize
));
if
(
isN
(
s
))
snn
--
;
}
{
final
int
s
=
state_clear_id
(
getfix
(
bx
-
1
,
by
-
1
));
if
(
isN
(
s
))
snn
--
;
}
{
final
int
s
=
state_clear_id
(
getfix
(
bx
+
nsize
,
by
-
1
));
if
(
isN
(
s
))
snn
--
;
}
{
final
int
s
=
state_clear_id
(
getfix
(
bx
-
1
,
by
+
nsize
));
if
(
isN
(
s
))
snn
--
;
}
{
final
int
s
=
state_clear_id
(
getfix
(
bx
+
nsize
,
by
+
nsize
));
if
(
isN
(
s
))
snn
--
;
}
return
snn
;
}
...
...
@@ -2405,22 +2404,22 @@ class NLE_hex_CA extends NLE_CA {
int
snn
=
c0
[
0
]
+
c1
[
0
]
+
c2
[
0
]
+
c3
[
0
]
+
c4
[
0
]
+
c5
[
0
];
if
(
debug_output
)
debug_message
+=
"Test: nn: "
+
str
(
c0
[
0
])
+
" "
+
str
(
c1
[
0
])
+
" "
+
str
(
c2
[
0
])
+
" "
+
str
(
c3
[
0
])
+
" "
+
str
(
c4
[
0
])
+
" "
+
str
(
c5
[
0
])
+
"
\n
"
;
{
int
s
=
state_clear_id
(
getfix
(
bx
+
ns
-
1
,
by
-
1
));
{
final
int
s
=
state_clear_id
(
getfix
(
bx
+
ns
-
1
,
by
-
1
));
if
(
isN
(
s
))
{
snn
--
;
if
(
debug_output
)
debug_message
+=
"(TL) "
+
str
(
ns
-
1
)
+
" "
+
str
(
-
1
)
+
" N: nn--
\n
"
;
}
}
{
int
s
=
state_clear_id
(
getfix
(
bx
+
2
*
ns
-
1
,
by
-
1
));
{
final
int
s
=
state_clear_id
(
getfix
(
bx
+
2
*
ns
-
1
,
by
-
1
));
if
(
isN
(
s
))
{
snn
--
;
if
(
debug_output
)
debug_message
+=
"(TR) "
+
str
(
2
*
ns
-
1
)
+
" "
+
str
(
-
1
)
+
" N: nn--
\n
"
;
}
}
{
int
s
=
state_clear_id
(
getfix
(
bx
+
2
*
ns
-
1
,
by
+
ns
-
1
));
{
final
int
s
=
state_clear_id
(
getfix
(
bx
+
2
*
ns
-
1
,
by
+
ns
-
1
));
if
(
isN
(
s
))
{
snn
--
;
if
(
debug_output
)
debug_message
+=
"(RR) "
+
str
(
2
*
ns
-
1
)
+
" "
+
str
(
ns
-
1
)
+
" N: nn--
\n
"
;
}
}
{
int
s
=
state_clear_id
(
getfix
(
bx
+
ns
-
1
,
by
+
2
*
ns
-
1
));
{
final
int
s
=
state_clear_id
(
getfix
(
bx
+
ns
-
1
,
by
+
2
*
ns
-
1
));
if
(
isN
(
s
))
{
snn
--
;
if
(
debug_output
)
debug_message
+=
"(BR) "
+
str
(
ns
-
1
)
+
" "
+
str
(
2
*
ns
-
1
)
+
" N: nn--
\n
"
;
}
}
{
int
s
=
state_clear_id
(
getfix
(
bx
-
1
,
by
+
2
*
ns
-
1
));
{
final
int
s
=
state_clear_id
(
getfix
(
bx
-
1
,
by
+
2
*
ns
-
1
));
if
(
isN
(
s
))
{
snn
--
;
if
(
debug_output
)
debug_message
+=
"(BL) "
+
str
(
-
1
)
+
" "
+
str
(
2
*
ns
-
1
)
+
" N: nn--
\n
"
;
}
}
{
int
s
=
state_clear_id
(
getfix
(
bx
-
1
,
by
+
ns
-
1
));
{
final
int
s
=
state_clear_id
(
getfix
(
bx
-
1
,
by
+
ns
-
1
));
if
(
isN
(
s
))
{
snn
--
;
if
(
debug_output
)
debug_message
+=
"(LL) "
+
str
(
-
1
)
+
" "
+
str
(
ns
-
1
)
+
" N: nn--
\n
"
;
}
}
if
(
debug_output
)
debug_message
+=
"Final: "
+
str
(
snn
)
+
"
\n
"
;
...
...
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