Exemplo n.º 1
0
        elif o == "--min-batches":
            min_batches = int(a)
        elif o == "--max-batches":
            max_batches = int(a)
        elif o == "--batch-size":
            batch_size = int(a)
        elif o == "--conf-perc":
            conf_perc = int(a)
            conf_fact = invstdnrmlcdf(1 - (100 - conf_perc) / 200)
        elif o == "--out":
            text_file = a

print("Output is written out to {}".format(text_file))

tic = perf_counter()
stateSpace = og.StateSpace(m1, n2, reduced=True)
toc = timedelta(seconds=perf_counter() - tic)

og.print_header("m1 = {}, n2 = {}".format(m1, n2), text_file)

f = open(text_file, 'a')
print("Generating the state space took {}".format(toc), file=f)
f.close()

#################################################
# Simulations
#################################################
policies = ['RA', 'LF', 'MF']

f = open(text_file, 'a')
print("SSA simulation with batch size {:,d},".format(batch_size) +
                    for _i in range(numrhos)
                ]
        elif o == "--method":
            if a == "lgmres":
                use_lgmres = True
        elif o == "--maxit":
            maxit = int(a)
        elif o == "--out":
            text_file = a
        elif o == "--repeat":
            reps = a

print("Output is written out to {}".format(text_file))

tic = perf_counter()
stateSpace = og.StateSpace(m1, n2, reduced=reduced_st_sp)
toc = timedelta(seconds=perf_counter() - tic)

f = open(text_file, 'a')
print("Generating the state space took {}".format(toc), file=f)
f.close()

og.print_header("m1 = {}, n2 = {}".format(m1, n2), text_file)

#################################################
# Actual computations
#################################################
f = open(text_file, 'a')
print("Using the precise chain", file=f)
print("Using the {} approximation method".format(
    'LGMRES' if use_lgmres else 'iterative'),