private static String code_XR_S="0000000000000101111110100"; private static String code_XR_O="1000110011000000000000001"; private static String code_XU_S="1000000000000010011001011111"; private static String code_XU_O="0010001110011010000000000000"; private static String code_RL_S="111011000000000000000011110100"; private static String code_RL_O="000000010100011100001000000001"; private static String code_RD_S="100000010000000000000001101111110100"; private static String code_RD_O="001000110100111000110000000000000001"; private static String code_OR_S="00000"; private static String code_OR_O="10000"; private static String code_OD_S="0000"; private static String code_OD_O="1010"; private static String code_OL_S="0000"; private static String code_OL_O="1011"; private static String code_OU_S="00000"; private static String code_OU_O="10001"; private static String code_SR_S="0000"; private static String code_SR_O="1100"; private static String code_SD_S="0000"; private static String code_SD_O="1110"; private static String code_SL_S="0000"; private static String code_SL_O="1001"; private static String code_SU_S="0000"; private static String code_SU_O="1101"; private static String code_CN_S="0000"; private static String code_CN_O="1111"; private static String code_IT_S="00000"; private static String code_IT_O="10001"; private static String code_FT_S="1101110000000"; private static String code_FT_O="0000000110000"; public static void pathh(int fromx, int tox, int y, int typ, Lattice l){ int dir_x = 1; int dir_y = 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_x = dir_x; s.mystate.dir_y = dir_y; s.mystate.typ = typ; s.mystate.excited = false; } } public static void pathv(int x, int fromy, int toy, int typ, Lattice l){ int dir_x = 0; int dir_y = 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_x = dir_x; s.mystate.dir_y = dir_y; 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(); int dir_x = 0; int dir_y = 1; pathh(x, x+len+1, y+2, 1, l); pathh(x, x+len-2, y, 1, l); for (int i=0; i>C>C>>C>v "+ ">C ^Cv^ v "+ " v ^^C^ C>"+ " >>C>>C>^ "+ " Cv^ ^Cv "+ " ^C^C>^^C "+ " ^ "; int dir_x = 0; int dir_y = 1; for (int i=0; i<10; i++){ for (int j=0; j<10; j++){ vonNeumann s = (vonNeumann)l.getState(x+i,y+j,0); switch(code.charAt((9-j)*10+i)){ case '^': s.mystate.typ = 1; s.mystate.dir_x = 0; s.mystate.dir_y = 1; break; case 'v': s.mystate.typ = 1; s.mystate.dir_x = 0; s.mystate.dir_y = -1; break; case '>': s.mystate.typ = 1; s.mystate.dir_x = 1; s.mystate.dir_y = 0; break; case '<': s.mystate.typ = 1; s.mystate.dir_x = -1; s.mystate.dir_y = 0; break; case 'C': s.mystate.typ = 3; s.mystate.dir_x = 0; s.mystate.dir_y = 0; break; default: break; } } } //vonNeumann s3 = (vonNeumann)l.getState(x-3,y,0); //s3.mystate.excited = true; //s3 = (vonNeumann)l.getState(x-2,y,0); //s3.mystate.excited = true; } public static void initialize(Lattice l, int option){ int lx = l.getX(); int ly = l.getY(); int lz = l.getZ(); colorInit(); iconInit(); for (int x=0; x