Commit 4bbd2143 authored by Sergey Kireev's avatar Sergey Kireev
Browse files

processing version fix

parent 484f2fad
......@@ -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";
......
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