Proposal
Currently, the __init__ function does not take the params argument, instead it takes the options argument
|
def __init__(self, options: dict[str, Any] | None = None): |
|
"""Initialize the environment constants.""" |
|
self.__dict__.update(options or {}) |
|
self.default_params = self.get_default_params() |
But the params of the environment are needed to initialize the object (such as to set observation_space member variable)
additional changes requirements:
get_default_params should be changed to not require the instantiation of the environment to be used as it will be required in __init__
|
def get_default_params(self, **kwargs) -> Params | None: |
|
"""Get the default params.""" |
|
return None |
to
def get_default_params(**kwargs) -> Params | None:
"""Get the default params."""
return None
and update FunctionalJaxEnv(gym.Env) with that change
@RedTachyon
Motivation
I have been developing the MJX based environments and this is a requirement
Pitch
No response
Alternatives
If there is no need to the `options' argument, remove it
Additional context
Here are 2 examples of params I need for MJX
-
xml_file indicates the file of the robot model to be used and sets up the internal MuJoCo model and everything else that depends on it like action and observation spaces
-
exclude_current_positions_from_observation changes, how much of the state space is observable, it is need in __init__() to observation_space and later in observation()
Checklist
Proposal
Currently, the
__init__function does not take theparamsargument, instead it takes theoptionsargumentGymnasium/gymnasium/functional.py
Lines 49 to 52 in f88a618
But the
paramsof the environment are needed to initialize the object (such as to setobservation_spacemember variable)additional changes requirements:
get_default_paramsshould be changed to not require the instantiation of the environment to be used as it will be required in__init__Gymnasium/gymnasium/functional.py
Lines 123 to 125 in de909da
to
and update
FunctionalJaxEnv(gym.Env)with that change@RedTachyon
Motivation
I have been developing the MJX based environments and this is a requirement
Pitch
No response
Alternatives
If there is no need to the `options' argument, remove it
Additional context
Here are 2 examples of
paramsI need for MJXxml_fileindicates the file of the robot model to be used and sets up the internal MuJoCo model and everything else that depends on it like action and observation spacesexclude_current_positions_from_observationchanges, how much of the state space is observable, it is need in__init__()toobservation_spaceand later inobservation()Checklist