From 67c7a9d6c71fb37de006a96f1119262854dca5bf Mon Sep 17 00:00:00 2001 From: weixin_46229132 Date: Thu, 20 Mar 2025 14:05:15 +0800 Subject: [PATCH] =?UTF-8?q?DQN=E8=AE=A9=E5=AE=83=E5=85=88=E7=9C=8B?= =?UTF-8?q?=E7=AD=94=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Duel_Double_DQN/main.py | 10 ++++++---- env_dis.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Duel_Double_DQN/main.py b/Duel_Double_DQN/main.py index 693c9ba..a1fead5 100644 --- a/Duel_Double_DQN/main.py +++ b/Duel_Double_DQN/main.py @@ -123,10 +123,12 @@ def main(): while not done: # e-greedy exploration if total_steps < opt.random_steps: - if s[0] == 0: - a = np.random.randint(0, 10) - else: - a = np.random.randint(10, 14) + # if s[0] == 0: + # a = np.random.randint(0, 10) + # else: + # a = np.random.randint(10, 14) + action_series = [0, 0, 3, 0, 10] + a = action_series[total_steps % 5] else: a = agent.select_action(s, deterministic=False) s_next, r, dw, tr, info = env.step(a) diff --git a/env_dis.py b/env_dis.py index 9c7e811..b086510 100644 --- a/env_dis.py +++ b/env_dis.py @@ -275,7 +275,7 @@ class PartitionMazeEnv(gym.Env): # print(self.partition_values) # print(self.car_traj) reward += self.BASE_LINE / T * 1000 - print(reward) + # print(reward) elif done and self.step_count >= self.MAX_STEPS: reward += -1000