Skip to content

Commit

Permalink
remove duplicated env instance
Browse files Browse the repository at this point in the history
  • Loading branch information
qhuang-pnl committed May 24, 2020
1 parent 97b728f commit 925ab5b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/py/trainKundur2areaGenBrakingAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,11 @@ def callback(lcl, glb):



def main(learning_rate):
def main(learning_rate, env):

tf.reset_default_graph() # to avoid the conflict with the existing parameters, but this is not suggested for reuse parameters
graph = tf.get_default_graph()
#print(graph.get_operations())
env = PowerDynSimEnv(case_files_array,dyn_config_file,rl_config_file,jar_path, java_port)
#print(graph.get_operations()


act = deepq.learn(
Expand Down Expand Up @@ -129,7 +128,7 @@ def main(learning_rate):
step_starttime = list()
step_durationtime = list()

main(ll)
main(ll, env)

np.save(os.path.join(storedData, "step_rewards_lr_%s_" % str(ll) + dataname), np.array(step_rewards))
np.save(os.path.join(storedData, "step_actions_lr_%s_" % str(ll) + dataname), np.array(step_actions))
Expand Down

0 comments on commit 925ab5b

Please sign in to comment.