-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathData_Gather_Helper.py
More file actions
26 lines (21 loc) · 994 Bytes
/
Data_Gather_Helper.py
File metadata and controls
26 lines (21 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
import argparse
from Data_Gather import ZGame
parser = argparse.ArgumentParser(description='CLI Argument Parser for Machine Playback.')
parser.add_argument('--outfile', help='Data logging file name.', default='data_log.json')
parser.add_argument('--creation', help='Allow creation of output file.', default=False, action='store_true')
def validate_data(out_file, allow_creation=False):
if allow_creation and not os.path.exists(out_file):
f = open(out_file, 'w+')
f.close()
if not os.path.isfile(out_file):
raise EnvironmentError('Bad filename provided in CLI arguments.')
if __name__ == '__main__':
args = parser.parse_args()
validate_data(args.outfile, allow_creation=args.creation)
model_name = "rl_agent_v1" ##########
data_log_file = args.outfile
os.system('mode con: cols=125 lines=50')
for _ in range(100): ###
zgame_env = ZGame(model_filename=model_name, data_log_file=data_log_file)
zgame_env.run()