Skip to content

Commit

Permalink
Fixed Wrappers and changed tests to reflect on correct Wrapper behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
XyDrKRulof committed May 29, 2024
1 parent 35e1b30 commit dd33248
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ def _get_cos_sin(self, state):
return np.concatenate(
(
state,
[np.cos(state[self._angle_index]*np.pi), np.sin(state[self._angle_index])*np.pi],
[np.cos(state[self._angle_index]*np.pi), np.sin(state[self._angle_index]*np.pi)],
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def set_physical_system(self, physical_system):
super().set_physical_system(physical_system)
self._omega_index = physical_system.state_names.index('omega')
self._angle_index = physical_system.state_names.index(self._angle_name)
self._pole_pair_number = physical_system._electrical_motor.motor_parameter['p']
self._pole_pair_number = physical_system.electrical_motor.motor_parameter['p']
assert self._angle_name in physical_system.state_names, \
f'Angle {self._angle_name} not in the states of the physical system. ' \
f'Probably a flux observer is required.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ def test_simulate(self, processor, physical_system, action):
assert all(
state
== np.concatenate(
(ps_state, [np.cos(cos_sin_state), np.sin(cos_sin_state)])
(ps_state, [np.cos(cos_sin_state*np.pi), np.sin(cos_sin_state*np.pi)])
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ def test_action_space(self, processor, physical_system):
(
np.array([0.0, 1.0]),
np.array([12.8, 0.123, 0.0]),
np.array([-0.23752263, 0.96000281, -0.72248018]),
np.array([-0.45595422, 0.99874252, -0.54278829]),
),
(
np.array([0.0, 0.5]),
np.array([-10.0, 0.123, 0.0]),
np.array([-0.49324109, 0.31757774, 0.17566335]),
np.array([ 0.36929056, -0.47656712, 0.10727657]),
),
],
)
Expand Down

0 comments on commit dd33248

Please sign in to comment.