mirror of
https://github.com/illiumst/marl-factory-grid.git
synced 2025-07-05 17:11:35 +02:00
added documentation for environment entity and factory
This commit is contained in:
@ -24,47 +24,48 @@ class Factory(gym.Env):
|
||||
@property
|
||||
def action_space(self):
|
||||
"""
|
||||
TODO
|
||||
The action space defines the set of all possible actions that an agent can take in the environment.
|
||||
|
||||
|
||||
:return:
|
||||
:return: Action space
|
||||
:rtype: gym.Space
|
||||
"""
|
||||
return self.state[c.AGENT].action_space
|
||||
|
||||
@property
|
||||
def named_action_space(self):
|
||||
"""
|
||||
TODO
|
||||
Returns the named action space for agents.
|
||||
|
||||
|
||||
:return:
|
||||
:return: Named action space
|
||||
:rtype: dict[str, dict[str, list[int]]]
|
||||
"""
|
||||
return self.state[c.AGENT].named_action_space
|
||||
|
||||
@property
|
||||
def observation_space(self):
|
||||
"""
|
||||
TODO
|
||||
The observation space represents all the information that an agent can receive from the environment at a given
|
||||
time step.
|
||||
|
||||
|
||||
:return:
|
||||
:return: Observation space.
|
||||
:rtype: gym.Space
|
||||
"""
|
||||
return self.obs_builder.observation_space(self.state)
|
||||
|
||||
@property
|
||||
def named_observation_space(self):
|
||||
"""
|
||||
TODO
|
||||
Returns the named observation space for the environment.
|
||||
|
||||
|
||||
:return:
|
||||
:return: Named observation space.
|
||||
:rtype: (dict, dict)
|
||||
"""
|
||||
return self.obs_builder.named_observation_space(self.state)
|
||||
|
||||
@property
|
||||
def params(self) -> dict:
|
||||
"""
|
||||
FIXME LAGEGY
|
||||
FIXME LEGACY
|
||||
|
||||
|
||||
:return:
|
||||
@ -80,10 +81,14 @@ class Factory(gym.Env):
|
||||
def __init__(self, config_file: Union[str, PathLike], custom_modules_path: Union[None, PathLike] = None,
|
||||
custom_level_path: Union[None, PathLike] = None):
|
||||
"""
|
||||
TODO
|
||||
Initializes the marl-factory-grid as Gym environment.
|
||||
|
||||
|
||||
:return:
|
||||
:param config_file: Path to the configuration file.
|
||||
:type config_file: Union[str, PathLike]
|
||||
:param custom_modules_path: Path to custom modules directory. (Default: None)
|
||||
:type custom_modules_path: Union[None, PathLike]
|
||||
:param custom_level_path: Path to custom level file. (Default: None)
|
||||
:type custom_level_path: Union[None, PathLike]
|
||||
"""
|
||||
self._config_file = config_file
|
||||
self.conf = FactoryConfigParser(self._config_file, custom_modules_path)
|
||||
|
Reference in New Issue
Block a user