diff --git a/example/high_action_random_agent.py b/example/high_action_random_agent.py index 4eb5721bb136512f976f82a80a21a646817caba0..1ffa92e586e11a9ec8586e8cbc1199b30e65067f 100755 --- a/example/high_action_random_agent.py +++ b/example/high_action_random_agent.py @@ -23,7 +23,9 @@ def main(): help="Python randomization seed; uses python default if 0 or not given") parser.add_argument('--no-reorient', action='store_true', help="Do not use the new Reorient action") - parser.add_argument('--record-dir', type=str, default='log/', + parser.add_argument('--record', action='store_true', + help="Doing HFO --record") + parser.add_argument('--rdir', type=str, default='log/', help="Set directory to use if doing HFO --record") args=parser.parse_args() if args.seed: @@ -32,10 +34,15 @@ def main(): hfo_env = hfo.HFOEnvironment() # Connect to the server with the specified # feature set. See feature sets in hfo.py/hfo.hpp. - hfo_env.connectToServer(hfo.LOW_LEVEL_FEATURE_SET, - 'bin/teams/base/config/formations-dt', args.port, - 'localhost', 'base_left', False, - record_dir=args.record_dir) + if args.record: + hfo_env.connectToServer(hfo.LOW_LEVEL_FEATURE_SET, + 'bin/teams/base/config/formations-dt', args.port, + 'localhost', 'base_left', False, + record_dir=args.rdir) + else: + hfo_env.connectToServer(hfo.LOW_LEVEL_FEATURE_SET, + 'bin/teams/base/config/formations-dt', args.port, + 'localhost', 'base_left', False) if args.seed: print("Python randomization seed: {0:d}".format(args.seed)) for episode in itertools.count(): diff --git a/example/high_level_random_agent.py b/example/high_level_random_agent.py index 6721e9c722053755b41474875ac3fa55529648cb..a2cc68dce9d7eef05460a8624e60a3d0e848a1e2 100755 --- a/example/high_level_random_agent.py +++ b/example/high_level_random_agent.py @@ -21,7 +21,9 @@ def main(): help="Server port") parser.add_argument('--seed', type=int, default=None, help="Python randomization seed; uses python default if 0 or not given") - parser.add_argument('--record-dir', type=str, default='log/', + parser.add_argument('--record', action='store_true', + help="Doing HFO --record") + parser.add_argument('--rdir', type=str, default='log/', help="Set directory to use if doing HFO --record") args=parser.parse_args() if args.seed: @@ -30,10 +32,15 @@ def main(): hfo_env = hfo.HFOEnvironment() # Connect to the server with the specified # feature set. See feature sets in hfo.py/hfo.hpp. - hfo_env.connectToServer(hfo.HIGH_LEVEL_FEATURE_SET, - 'bin/teams/base/config/formations-dt', args.port, - 'localhost', 'base_left', False, - record_dir=args.record_dir) + if args.record: + hfo_env.connectToServer(hfo.HIGH_LEVEL_FEATURE_SET, + 'bin/teams/base/config/formations-dt', args.port, + 'localhost', 'base_left', False, + record_dir=args.rdir) + else: + hfo_env.connectToServer(hfo.HIGH_LEVEL_FEATURE_SET, + 'bin/teams/base/config/formations-dt', args.port, + 'localhost', 'base_left', False) if args.seed: print("Python randomization seed: {0:d}".format(args.seed)) for episode in itertools.count():