diff --git a/learn.py b/learn.py index 19268b2..d58de34 100644 --- a/learn.py +++ b/learn.py @@ -10,6 +10,7 @@ from utils.sc_wrapper import single_net_sc2env from smac.env import StarCraft2Env from model import QMIX_agent +import time, datetime def qmix_learning( args=None @@ -19,6 +20,9 @@ def qmix_learning( ''' assert args.save_model_freq % args.target_update_freq == 0 last_test_t, num_test = -args.test_freq - 1, 0 + if args.seed == None: + time.sleep(3) + args.seed = int(''.join(reversed(datetime.datetime.now().strftime("%m%d%H%M%S")))) np.random.seed(args.seed) torch.manual_seed(args.seed) # Initialize Env diff --git a/main.py b/main.py index e615083..bd09178 100644 --- a/main.py +++ b/main.py @@ -17,7 +17,7 @@ def get_args(): parser.add_argument('--learning-rate', type=float, default=5e-4) parser.add_argument('--grad-norm-clip', type=float, default=10) # seed - parser.add_argument('--seed', type=int, default=0) + parser.add_argument('--seed', type=int, default=None) # ddqn parser.add_argument('--is-ddqn', type=int, default=True) # per