From f68a4052f9445530ea4683fe20ad34711ba50b02 Mon Sep 17 00:00:00 2001 From: sp Date: Mon, 15 Jan 2024 18:10:09 +0100 Subject: [PATCH] add expname suffix --- examples/shields/rl/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/shields/rl/utils.py b/examples/shields/rl/utils.py index 39e7338..9024c4d 100644 --- a/examples/shields/rl/utils.py +++ b/examples/shields/rl/utils.py @@ -134,7 +134,7 @@ class MiniGridShieldHandler(ShieldHandler): return self.__create_shield_dict() def expname(args): - return f"{datetime.datetime.now().strftime('%Y%m%dT%H%M%S')}_{args.env}_{args.shielding}_{args.shield_comparison}_{args.shield_value}_{next(tempfile._get_candidate_names())}" + return f"{datetime.datetime.now().strftime('%Y%m%dT%H%M%S')}_{args.env}_{args.shielding}_{args.shield_comparison}_{args.shield_value}_{args.expname_suffix}" def create_log_dir(args): log_dir = f"{args.log_dir}/{expname(args)}" @@ -170,6 +170,7 @@ def common_parser(): parser.add_argument("--shield_value", default=0.9, type=float) parser.add_argument("--shield_comparison", default='absolute', choices=['relative', 'absolute']) parser.add_argument("--nocleanup", action=argparse.BooleanOptionalAction) + parser.add_argument("--expname_suffix", default="") return parser class MiniWrapper(gym.Wrapper):