import sys from konstruckt import * for seeds, g in konstruckt(sys.argv[1]): g.b.display() print g.b.w, 'x', g.b.h break
if pdl: print 'Started on:', started_on print 'Global dealine:', deadline seed_deadline = None fnum = 0 for fn in args.f: if witht: t = time.time() file_deadline = t + ((deadline - t) / (len(args.f) - fnum)) if pdl: print fn, 'deadline:', file_deadline snum = 0 for seeds, game in konstruckt(fn, args.nodebug): if witht: t = time.time() seed_deadline = t + ((file_deadline - t) / (seeds - snum)) if pdl: print fn, 'seed', game.lcg.seed, 'deadline:', seed_deadline s = game.solve(seed_deadline) sols.append({'problemId': game.id, 'seed': game.lcg.seed, 'tag': curTag + '-' + str(game.id) + '-' + str(game.lcg.seed) + '-' + str(time.time()), 'solution': s}) snum += 1 fnum += 1 print json.dumps(sols) if not args.nosave: fn = 'solutions/solution_' + str(game.id) + '.json' f = open(fn, 'w+')