diff --git a/run.py b/run.py index 436a722..8a24b72 100755 --- a/run.py +++ b/run.py @@ -14,8 +14,11 @@ def get_exp_cnt(path): def main(): parser = argparse.ArgumentParser('Run all the scripts so everything works fine.') - parser.add_argument('experiments', type=int, nargs='?', default=1, + parser.add_argument('experiments', type=int, nargs=1, default=1, help='The number of experiments to be run.') + parser.add_argument('utilization', type=float, nargs='?', default=1, + help='The utilization for the experiments to be run.', + default=None) args = parser.parse_args() cwd = os.getcwd() @@ -29,9 +32,16 @@ def main(): cnt = 0 remain = args.experiments while remain > 0: - subprocess.call(['./tasksetgen.py', '--microseconds', '--uniform', '5', - str(remain), 'experiments/ese2016_{}'.format(cnt), - 'experiment_data']) + if parser.utilization is not None: + subprocess.call(['./tasksetgen.py', '--microseconds', '--uniform', '5', + '--utilization {}:{}'.format(args.utilization - 0.25, args.utilization + 0.25), + str(remain), 'experiments/ese2016_{}'.format(cnt), + 'experiment_data']) + else: + subprocess.call(['./tasksetgen.py', '--microseconds', '--uniform', '5', + str(remain), 'experiments/ese2016_{}'.format(cnt), + 'experiment_data']) + for experiment in os.listdir('experiments/ese2016_{}'.format(cnt)): subprocess.call(['./generate.py', 'experiments/ese2016_{}'.format(cnt) + '/' + experiment])