else
return ZERO;
}
private short[][] calculate() {
AbstractRandomGenerator randGen = new MarsagliaRandomGenerator();
int centre = buffer_size / 2;
double pi2 = 2.0 * Math.PI;
int size2 = buffer_size - 2;
short q[][] = new short[buffer_size][buffer_size];
randGen.randomize(seed);
q[centre][centre] = 1;
double r1 = 3.0;
double r2 = 3.0 * r1;
for (int i = 0; i < _max_iter; i++) {
double phi = pi2 * randGen.random();
double ri = r1 * Math.cos(phi);
double rj = r1 * Math.sin(phi);
int ci = centre + (int) (ri + 0.5);
int cj = centre + (int) (rj + 0.5);
short qt = 0;
while (qt == 0) {
double rr = randGen.random();
rr += rr;
rr += rr;
int rd = (int) rr;
switch (rd) {
case 0: