From 539b86c7bd7145da335b1daef67a2f9d347b3b7b Mon Sep 17 00:00:00 2001
From: Armin <armin.co@hs-bochum.de>
Date: Tue, 9 Mar 2021 08:02:30 +0100
Subject: [PATCH] Prevent conf.name to be : None

---
 agents.py                 | 2 +-
 environment_wrapper.py    | 4 ++--
 run_scripts/benchmarks.py | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/agents.py b/agents.py
index 49d0c69..ce4d367 100644
--- a/agents.py
+++ b/agents.py
@@ -75,7 +75,7 @@ class DQAgent(QAgent):
     def __init__(self, conf):
         super().__init__(conf)
         self.q2 = QNet(conf)
-        self.name = 'D_' + self.name
+        self.name = 'D_' + str(self.name)
 
     def get_action(self, state):
         if np.random.rand() <= self.epsilon:
diff --git a/environment_wrapper.py b/environment_wrapper.py
index e55058b..2c8317b 100644
--- a/environment_wrapper.py
+++ b/environment_wrapper.py
@@ -31,7 +31,7 @@ class Config:
 
 
     def conf_to_name(self):
-        self.name = self.env_type + '_' + self.name
+        self.name = str(self.env_type) + '_' + str(self.name)
         for layer in self.net_layout:
             self.name += '_' + str(layer) + '_'
         self.name += str(self.eps_decay) + '_'
@@ -102,7 +102,7 @@ def learn_offline(agent, conf):
 
 def run(environment, agent, episodes, render=True, learn=True, conf=None):
     """ Run an agent """
-    conf.name += 'on'
+    conf.name = str(conf.name) + 'on'
     # Set the exploring rate to its minimum.
     # (epsilon *greedy*)
     if not learn:
diff --git a/run_scripts/benchmarks.py b/run_scripts/benchmarks.py
index 83fa817..a374ffd 100644
--- a/run_scripts/benchmarks.py
+++ b/run_scripts/benchmarks.py
@@ -123,8 +123,8 @@ configuration = c
 # configuration = lun
 # configuration = ThisHasToBeTooBig
 
-print(configuration.name)
-configuration.agent = DQAgent(configuration)
+configuration.conf_to_name()
+configuration.agent = QAgent(configuration)
 main.run(configuration)
 
 # configurations = [smallNet, smallNetDeep, normalNet, normalSlowDecay, normalSlowLearn, largeNet, deepNet, verryLittleNet, littleNet, verryLittleNetDeep, smallNetDeepSlowLearn, deepNetSlowLearn]
-- 
GitLab