def get_latest_save_folder(): files = glob.glob("%s/20*" % PNFCKPT_DIR) files.sort() ckptdir = "" for f in reversed(files): if os.path.isdir(f): foldername = f.split("/")[-1] ckptdir = foldername break return ckptdir
def simulate(dates): dates.sort() for i in range(1, len(dates)): startd = dates[i-1] endd = dates[i] files = glob.glob("%s/20*" % PNFCKPT_DIR) files.sort() ckptdir = "" for f in reversed(files): if os.path.isdir(f): foldername = f.split("/")[-1] if startd >= foldername: ckptdir = foldername break if ckptdir == "": f.log("No learned data") exit(1) meigaras = kf.get_goodmeigaras(endd, 20) s = Simulator3(meigaras, "BOTH", "%s.log" % ckptdir, ckptdir) s.simulate(startd, endd) s = None