Skip to content

Commit

Permalink
review comments fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
praneeth-b committed Jul 20, 2020
1 parent d5d1300 commit a892405
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/ddpg_pmsm_dq_current_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def reset(self, **kwargs):
env = gem.make(
'emotor-pmsm-cont-v1',
# Pass a class with extra parameters
visualization=MotorDashboard(plots=['i_sq', 'i_sd', 'action_1', 'mean_reward']), visu_period=1,
visualization=MotorDashboard(plots=['i_sq', 'i_sd', 'action_0', 'action_1', 'mean_reward']), visu_period=1,
load=ConstantSpeedLoad(omega_fixed=1000 * np.pi / 30),
control_space='dq',
# Pass a string (with extra parameters)
Expand Down
2 changes: 1 addition & 1 deletion examples/pi_series_omega_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
'DcSeriesCont-v1', # replace with 'DcSeriesDisc-v1' for discrete controllers
# Pass an instance
#visualization=MotorDashboard(plotted_variables='all', visu_period=1),
visualization=MotorDashboard(plots=['i', 'reward', 'mean_reward'], dark_mode=False),
visualization=MotorDashboard(plots=['i', 'reward', 'action_0', 'mean_reward'], dark_mode=False),
motor_parameter=dict(r_a=15e-3, r_e=15e-3, l_a=1e-3, l_e=1e-3),
# Take standard class and pass parameters (Load)
load_parameter=dict(a=0.01, b=.1, c=0.1, j_load=.06),
Expand Down
12 changes: 6 additions & 6 deletions gym_electric_motor/visualization/motor_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,19 @@ def _initialize(self):
plt.style.use('dark_background')
# create seperate figures for time based and episode based plots
self._figure, axes = plt.subplots(len(self._plots), sharex=True)
self._figure_ep, axes_ep = plt.subplots(len(self._episode_plots))

self._figure.subplots_adjust(wspace=0.0, hspace=0.2)
self._figure_ep.subplots_adjust(wspace=0.0, hspace=0.02)
if self._episode_plots:
self._figure_ep, axes_ep = plt.subplots(len(self._episode_plots))
self._figure_ep.subplots_adjust(wspace=0.0, hspace=0.02)
self._figure.subplots_adjust(wspace=0.0, hspace=0.2)
self._figure_ep.text(0.5, 0.04, 'episode_number', va='center', ha='center')

# adding a common x-label to all the subplots in each figure
self._figure.text(0.5, 0.04, 't/s', va='center', ha='center')
self._figure_ep.text(0.5, 0.04, 'episode_number', va='center', ha='center')

# plt.subplot() does not return an iterable var when the number of subplots==1
if len(self._plots) == 1:
axes = [axes]
if len(self._episode_plots) == 1:
if len(self._episode_plots) == 1:
axis_ep = [axes_ep]
for plot, axis in zip(self._plots, axes):
plot.initialize(axis)
Expand Down
2 changes: 1 addition & 1 deletion gym_electric_motor/visualization/motor_dashboard_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class to plot the mean episode reward
'linewidth': 0.75,
'marker': 'o',
'markersize': 1,
'label': 'mean_reward'
'label': 'mean episodic reward'
}

def __init__(self):
Expand Down

0 comments on commit a892405

Please sign in to comment.