public void Singlerun(IsingStructure Ising, int R, int L, double Tq, int steplimit, double q) { int run = 0; double dilution = Ising.percent; String path = "/Users/liukang2002507/Desktop/simulation/LRDIP/singlerun-R=" + fmt.format(R) + "-L=" + fmt.format(L) + "-q=0." + qmt.format(dilution * 1000000) + ".txt"; String overall = "/Users/liukang2002507/Desktop/simulation/LRDIP/L=" + fmt.format(L) + ".txt"; for (run = 1; run <= 1; run++) { Ising.Dinitialization(run, run, R, R); params.set("copies", run); params.set("deadsites", Ising.deadsites); Ising.Sinitialization(0, run); Istemp = Ising.clone(); double mag = 0; int positive = 0; int negative = 0; Job.animate(); int presteplimit = 50; params.set("T", 99); Random heat = new Random(run); Random flip = new Random(run); for (int prestep = 0; prestep < presteplimit; prestep++) { T = params.fget("T"); H = params.fget("H"); Istemp.MCS(T, H, heat, 1); params.set("MCS", prestep - presteplimit); Job.animate(); mag = Istemp.Magnetization(); reducedM = mag / (1 - Istemp.percent); PrintUtil.printlnToFile(path, prestep - presteplimit, mag, reducedM); params.set("magnetization", mag); params.set("reduced M", reducedM); } params.set("T", Tq); for (int step = 0; step < steplimit; step++) { T = params.fget("T"); H = params.fget("H"); Istemp.MCS(T, H, flip, 1); params.set("MCS", step); mag = Istemp.Magnetization(); reducedM = mag / (1 - Istemp.percent); params.set("magnetization", mag); params.set("reduced M", reducedM); Job.animate(); PrintUtil.printlnToFile(path, step, mag, reducedM); if (steplimit - step <= (steplimit / 2)) { if (reducedM < 0) negative++; if (reducedM > 0) positive++; } } PrintUtil.printlnToFile(overall, q, mag, Math.abs(reducedM), positive, negative); } }