Skip to content
Snippets Groups Projects
Commit 539b86c7 authored by Armin Co's avatar Armin Co
Browse files

Prevent conf.name to be : None

parent 89853126
Branches main
No related tags found
No related merge requests found
......@@ -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:
......
......@@ -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:
......
......@@ -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]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment