Skip to content

Commit

Permalink
Merge pull request #67 from jerryz123/decouple_rendering
Browse files Browse the repository at this point in the history
Decouple rendering
  • Loading branch information
jerryz123 committed Jul 10, 2018
2 parents b21d3b5 + c14e145 commit 5ec659c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion .coverage

This file was deleted.

1 change: 1 addition & 0 deletions examples/fluids_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
# actions = {k:fluids.KeyboardAction() for k in controlled_keys}
rew = simulator.step(actions)
obs = simulator.get_observations(controlled_keys)
simulator.render()
1 change: 1 addition & 0 deletions fluids/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@
actions = {k: fluids.KeyboardAction() for k in simulator.get_control_keys()}
rew = simulator.step(actions)
obs = simulator.get_observations(simulator.get_control_keys())
simulator.render()
t = t + 1

4 changes: 0 additions & 4 deletions fluids/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class FluidSim(object):
def __init__(self,
state =STATE_CITY,
visualization_level =1,
render_on =True,
controlled_cars =1,
background_cars =0,
background_peds =0,
Expand Down Expand Up @@ -82,7 +81,6 @@ def __init__(self,
REWARD_NONE : lambda s : 0}[reward_fn]
self.background_control = background_control
self.vis_level = visualization_level
self.render_on = render_on
self.fps = fps
self.last_keys_pressed = None
self.render()
Expand Down Expand Up @@ -178,8 +176,6 @@ def step(self, actions={}):

reward_step = self.reward_fn(self.state)
#print(reward_step)
if self.render_on:
self.render()
return reward_step
def get_observations(self, keys={}):
"""
Expand Down

0 comments on commit 5ec659c

Please sign in to comment.