Skip to content
Snippets Groups Projects
Commit 144b7460 authored by hagrid67's avatar hagrid67
Browse files

initial commit for reintroducing PyQT rendering

parent c45b164d
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ import torch
import random
import numpy as np
import matplotlib.pyplot as plt
import redis
def main():
......@@ -32,6 +33,8 @@ def main():
number_of_agents=1)
env_renderer = RenderTool(env)
plt.figure(figsize=(5,5))
# fRedis = redis.Redis()
handle = env.get_agent_handles()
state_size = 105
......@@ -98,6 +101,7 @@ def main():
score += all_rewards[a]
env_renderer.renderEnv(show=True, frames=True, iEpisode=trials, iStep=step)
sEnv = fR.set("RailEnv0")
obs = next_obs.copy()
if done['__all__']:
......@@ -115,10 +119,8 @@ def main():
'\tEpsilon: {:.2f} \t Action Probabilities: \t {}'.format(
env.number_of_agents,
trials,
np.mean(
scores_window),
100 * np.mean(
done_window),
np.mean(scores_window),
100 * np.mean(done_window),
eps, action_prob/np.sum(action_prob)),
end=" ")
if trials % 100 == 0:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment