You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I designed the component wrapper to transform points from one space to another and back. So the interface has check_space, wrap_space,wrap_point, and unwrap_point. However, not all wrappers do this. Here's an example:
classDriftMoveActor(ActorWrapper):
def__init__(self, component, **kwargs):
assertisinstance(component, CrossMoveActor), "DriftMove only works with CrossMove."defcheck_space(self, *args):
""" DriftMoveActor does not change the agent's space, so we just return True. """returnTruedefwrap_space(self, space):
""" DriftMoveActor does not change the agent's space, so we just return the space. """returnspacedefwrap_point(self, space, point, **kwargs):
# converting "stay" to a movement is the point wrap! BUT: can we unwrap it? And if not ,then# should we use the wrap/unwrap approach?returnpointdefunwrap_point(self, space, point):
returnsuper().unwrap_point(space, point)()
defprocess_action(self, agent, action_dict, **kwargs):
ifisinstance(agent, OrientationAgent): # Extra assertion, resolveable with #423ifaction_dict[self.wrapped_component.key] ==0: # Stay was issued
...
This wrapper leverages the logic the cross move actor without transforming the data in a bijection (0 is transformed to the agent's orientation, but we can't go back). The four api functions are unnecessary for this use case.
I designed the component wrapper to transform points from one space to another and back. So the interface has
check_space
,wrap_space,
wrap_point
, andunwrap_point
. However, not all wrappers do this. Here's an example:This wrapper leverages the logic the cross move actor without transforming the data in a bijection (0 is transformed to the agent's orientation, but we can't go back). The four api functions are unnecessary for this use case.
Related to #306
Comes out of #470
The text was updated successfully, but these errors were encountered: