def simulate(user, password, url, maxwaves, edges, simulate, workers, start_hosts):
    global rans
    start_time = time()
    rans = ransomulator(user, password, url, maxwaves, edges, simulate, start_hosts, workers)
    if rans.connect():
        (sorted_waves, max_wavelen, avg_wavelen, max_total, total_comps, num_of_computers, score) = rans.somulate()
        if outfile:
            output_csv(outfile, sorted_waves, max_wavelen)
    else:
        print('Error during connection...')
    elapsed = time_to_str((time() - start_time))
    print('Ransomulator done: {}'.format(elapsed))
    print('-----------------------------')
    print('Fragility score:\t{}%'.format(score))
    print('Max number of computers:\t{}'.format(num_of_computers))
    print('Total computers with paths:\t{}'.format(total_comps))
    print('Max compromised :\t{}'.format(max_total))
    print('Avg wave length:\t{}'.format(round(avg_wavelen, 1)))
    print('Max wave length:\t{}'.format(max_wavelen))
def simulate(user, password, url, maxwaves, edges, simulate, workers, start_hosts):
    global rans
    start_time = time()
    rans = ransomulator(user, password, url, maxwaves, edges, simulate, start_hosts, workers)
    if rans.connect():
        (sorted_waves, max_wavelen, avg_wavelen, max_total, total_comps, num_of_computers, score) = rans.somulate()
        if outfile:
            output_csv(outfile, sorted_waves, max_wavelen)
    else:
        print('Error during connection...')
    elapsed = time_to_str((time() - start_time))
    print('Ransomulator done: {}'.format(elapsed))
    print('-----------------------------')
    print('Fragility score:\t{}%'.format(score))
    print('Max number of computers:\t{}'.format(num_of_computers))
    print('Total computers with paths:\t{}'.format(total_comps))
    print('Max compromised :\t{}'.format(max_total))
    print('Avg wave length:\t{}'.format(round(avg_wavelen, 1)))
    print('Max wave length:\t{}'.format(max_wavelen))