Skip to content

Commit

Permalink
Sort modules in the package, add newline at EOF and defaults
Browse files Browse the repository at this point in the history
The changes in this commit include:
- The modules in the __ini__.py file were sorted alphabetically.
- The new line at the end of file was added in randomized_env.py.
- Default values were assigned for VariationSpec, specifically for
fields method, distribution, mean_std and var_range. Fields xpath,
attrib, elem and default are specific to the model in the XML file
provided by the user, so they cannot be default parameters. Further
more, elem and default are obtained by parsing the XML file, so the user
won't set them.
  • Loading branch information
Angel Gonzalez committed Jun 8, 2018
1 parent a1b9f2a commit ac0d449
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
7 changes: 3 additions & 4 deletions rllab/envs/mujoco/dynamics_randomization/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from rllab.envs.mujoco.dynamics_randomization.variation import Variations
from rllab.envs.mujoco.dynamics_randomization.variation import Method
from rllab.envs.mujoco.dynamics_randomization.variation import Distribution
from rllab.envs.mujoco.dynamics_randomization.mujoco_model_generator import MujocoModelGenerator
from rllab.envs.mujoco.dynamics_randomization.randomized_env import randomize
from rllab.envs.mujoco.dynamics_randomization.variation import Distribution
from rllab.envs.mujoco.dynamics_randomization.variation import Method
from rllab.envs.mujoco.dynamics_randomization.variation import Variations
2 changes: 1 addition & 1 deletion rllab/envs/mujoco/dynamics_randomization/randomized_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ def horizon(self):
return self._wrapped_env.horizon


randomize = RandomizedEnv
randomize = RandomizedEnv
20 changes: 10 additions & 10 deletions rllab/envs/mujoco/dynamics_randomization/variation.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ class works more like a data structure to store the data fields required
"""

def __init__(self,
xpath=None,
attrib=None,
method=None,
distribution=None,
var_range=None,
mean_std=None,
xpath,
attrib,
method,
distribution,
var_range,
mean_std,
elem=None,
default=None):

Expand Down Expand Up @@ -209,10 +209,10 @@ def __init__(self, variations):
self._variations = variations
self._xpath = None
self._attrib = None
self._method = None
self._distribution = None
self._mean_std = None
self._var_range = None
self._method = Method.ABSOLUTE
self._distribution = Distribution.UNIFORM
self._mean_std = (0.0, 1.0)
self._var_range = (0.0, 1.0)
self._elem = None
self._default = None

Expand Down

0 comments on commit ac0d449

Please sign in to comment.