static vonNeumann s_static = new vonNeumann(); private static celladdress makecelladdress(int x, int y){ celladdress ca = s_static.new celladdress(); ca.x = x; ca.y = y; return ca; } private static celladdress makecelladdress(celladdress cb){ celladdress ca = s_static.new celladdress(); ca.x = cb.x; ca.y = cb.y; return ca; } public static void pathh(int fromx, int tox, int y, int typ, Lattice l){ celladdress dir = makecelladdress(1,0); if (fromx < tox){ dir.x = 1; }else{ int temp = fromx; fromx = tox; tox = temp; dir.x = -1; } for (int x=fromx; x<=tox; x++){ vonNeumann s = (vonNeumann)l.getState(x,y,0); s.mystate.dir = makecelladdress(dir); s.mystate.typ = typ; s.mystate.excited = false; } } public static void pathv(int x, int fromy, int toy, int typ, Lattice l){ celladdress dir = makecelladdress(0,1); if (fromy < toy){ dir.y = 1; }else{ int temp = fromy; fromy = toy; toy = temp; dir.y = -1; } for (int y=fromy; y<=toy; y++){ vonNeumann s = (vonNeumann)l.getState(x,y,0); s.mystate.dir = makecelladdress(dir); s.mystate.typ = typ; s.mystate.excited = false; } } public static void pulser(int x, int y, String code, Lattice l){ int len = 2*code.length(); celladdress dir = makecelladdress(0,1); pathh(x, x+len+1, y+2, 1, l); pathh(x, x+len-2, y, 1, l); for (int i=0; i