We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[MAINTAIN] Set environment factory function based on executor or evaluator.
### Please describe what needs to be maintained?
Set `evaluation` variable in environment factory based on if an executor or evaluator is in use.

### Describe the outcome you'd like
Set `evaluation` variable in environment factory based on `store.executor_environment`. 

### How do we know when maintenance is complete?
`evaluation` variable in environment factory will be set based on if an executor or evaluator is us use.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mava/components/building/environments.py`
Content:
```
1 # python3
2 # Copyright 2021 InstaDeep Ltd. All rights reserved.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 
16 """Execution components for system builders"""
17 import abc
18 import os
19 from dataclasses import dataclass
20 from typing import Callable, List, Optional, Tuple, Type, Union
21 
22 import acme
23 
24 from mava import specs
25 from mava.callbacks import Callback
26 from mava.components import Component
27 from mava.components.building.loggers import Logger
28 from mava.core_jax import SystemBuilder
29 from mava.environment_loop import ParallelEnvironmentLoop
30 from mava.utils.sort_utils import sort_str_num
31 from mava.wrappers.environment_loop_wrappers import (
32     DetailedPerAgentStatistics,
33     EnvironmentLoopStatisticsBase,
34     MonitorParallelEnvironmentLoop,
35 )
36 
37 
38 @dataclass
39 class EnvironmentSpecConfig:
40     environment_factory: Optional[Callable[[bool], acme.core.Worker]] = None
41 
42 
43 class EnvironmentSpec(Component):
44     def __init__(self, config: EnvironmentSpecConfig = EnvironmentSpecConfig()):
45         """Component creates a multi-agent environment spec.
46 
47         Args:
48             config: EnvironmentSpecConfig.
49         """
50         self.config = config
51 
52     def on_building_init_start(self, builder: SystemBuilder) -> None:
53         """Using the env factory in config, create and store the env spec and agents.
54 
55         Args:
56             builder: SystemBuilder.
57 
58         Returns:
59             None.
60         """
61         builder.store.manager_pid = os.getpid()
62         builder.store.ma_environment_spec = specs.MAEnvironmentSpec(
63             self.config.environment_factory()
64         )
65 
66         builder.store.agents = sort_str_num(
67             builder.store.ma_environment_spec.get_agent_ids()
68         )
69         builder.store.extras_spec = {}
70 
71     @staticmethod
72     def name() -> str:
73         """Static method that returns component name."""
74         return "environment_spec"
75 
76     @staticmethod
77     def required_components() -> List[Type[Callback]]:
78         """List of other Components required in the system for this Component to function.
79 
80         None required.
81 
82         Returns:
83             List of required component classes.
84         """
85         return []
86 
87 
88 @dataclass
89 class ExecutorEnvironmentLoopConfig:
90     should_update: bool = True
91     executor_stats_wrapper_class: Optional[
92         Type[EnvironmentLoopStatisticsBase]
93     ] = DetailedPerAgentStatistics
94 
95 
96 class ExecutorEnvironmentLoop(Component):
97     def __init__(
98         self, config: ExecutorEnvironmentLoopConfig = ExecutorEnvironmentLoopConfig()
99     ):
100         """Component creates an executor environment loop.
101 
102         Args:
103             config: ExecutorEnvironmentLoopConfig.
104         """
105         self.config = config
106 
107     def on_building_executor_environment(self, builder: SystemBuilder) -> None:
108         """Create and store the executor environment from the factory in config.
109 
110         Args:
111             builder: SystemBuilder.
112 
113         Returns:
114             None.
115         """
116         # Global config set by EnvironmentSpec component
117         builder.store.executor_environment = (
118             builder.store.global_config.environment_factory(evaluation=False)
119         )  # type: ignore
120 
121     @abc.abstractmethod
122     def on_building_executor_environment_loop(self, builder: SystemBuilder) -> None:
123         """Abstract method for overriding: should create executor environment loop.
124 
125         Args:
126             builder: SystemBuilder.
127 
128         Returns:
129             None.
130         """
131 
132     @staticmethod
133     def name() -> str:
134         """Static method that returns component name."""
135         return "executor_environment_loop"
136 
137     @staticmethod
138     def required_components() -> List[Type[Callback]]:
139         """List of other Components required in the system for this Component to function.
140 
141         Logger required to set up builder.store.executor_logger.
142         EnvironmentSpec required for config environment_factory.
143 
144         Returns:
145             List of required component classes.
146         """
147         return [Logger, EnvironmentSpec]
148 
149 
150 class ParallelExecutorEnvironmentLoop(ExecutorEnvironmentLoop):
151     def on_building_executor_environment_loop(self, builder: SystemBuilder) -> None:
152         """Create and store a parallel environment loop.
153 
154         Args:
155             builder: SystemBuilder.
156 
157         Returns:
158             None.
159         """
160         executor_environment_loop = ParallelEnvironmentLoop(
161             environment=builder.store.executor_environment,
162             executor=builder.store.executor,  # Set up by builder
163             logger=builder.store.executor_logger,
164             should_update=self.config.should_update,
165         )
166         del builder.store.executor_logger
167 
168         if self.config.executor_stats_wrapper_class:
169             executor_environment_loop = self.config.executor_stats_wrapper_class(
170                 executor_environment_loop
171             )
172         builder.store.system_executor = executor_environment_loop
173 
174 
175 @dataclass
176 class MonitorExecutorEnvironmentLoopConfig(ExecutorEnvironmentLoopConfig):
177     filename: str = "agents"
178     label: str = "parallel_environment_loop"
179     record_every: int = 1000
180     fps: int = 15
181     counter_str: str = "evaluator_episodes"
182     format: str = "video"
183     figsize: Union[float, Tuple[int, int]] = (360, 640)
184 
185 
186 class MonitorExecutorEnvironmentLoop(ExecutorEnvironmentLoop):
187     def __init__(
188         self,
189         config: MonitorExecutorEnvironmentLoopConfig = MonitorExecutorEnvironmentLoopConfig(),  # noqa
190     ):
191         """Component for visualising environment progress."""
192         super().__init__(config=config)
193         self.config = config
194 
195     def on_building_executor_environment_loop(self, builder: SystemBuilder) -> None:
196         """Monitors environments and produces videos of episodes.
197 
198         Builds a `ParallelEnvironmentLoop` on the evaluator and a
199         `MonitorParallelEnvironmentLoop` on all executors and stores it
200         in the `builder.store.system_executor`.
201 
202         Args:
203             builder: SystemBuilder
204         """
205         if builder.store.is_evaluator:
206             executor_environment_loop = MonitorParallelEnvironmentLoop(
207                 environment=builder.store.executor_environment,
208                 executor=builder.store.executor,
209                 logger=builder.store.executor_logger,
210                 should_update=self.config.should_update,
211                 filename=self.config.filename,
212                 label=self.config.label,
213                 record_every=self.config.record_every,
214                 path=builder.store.global_config.experiment_path,
215                 fps=self.config.fps,
216                 counter_str=self.config.counter_str,
217                 format=self.config.format,
218                 figsize=self.config.figsize,
219             )
220         else:
221             executor_environment_loop = ParallelEnvironmentLoop(
222                 environment=builder.store.executor_environment,
223                 executor=builder.store.executor,
224                 logger=builder.store.executor_logger,
225                 should_update=self.config.should_update,
226             )
227 
228         del builder.store.executor_logger
229 
230         if self.config.executor_stats_wrapper_class:
231             executor_environment_loop = self.config.executor_stats_wrapper_class(
232                 executor_environment_loop
233             )
234 
235         builder.store.system_executor = executor_environment_loop
236
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mava/components/building/environments.py b/mava/components/building/environments.py
--- a/mava/components/building/environments.py
+++ b/mava/components/building/environments.py
@@ -115,7 +115,9 @@
         """
         # Global config set by EnvironmentSpec component
         builder.store.executor_environment = (
-            builder.store.global_config.environment_factory(evaluation=False)
+            builder.store.global_config.environment_factory(
+                evaluation=builder.store.is_evaluator
+            )
         )  # type: ignore
 
     @abc.abstractmethod

{"golden_diff": "diff --git a/mava/components/building/environments.py b/mava/components/building/environments.py\n--- a/mava/components/building/environments.py\n+++ b/mava/components/building/environments.py\n@@ -115,7 +115,9 @@\n         \"\"\"\n         # Global config set by EnvironmentSpec component\n         builder.store.executor_environment = (\n-            builder.store.global_config.environment_factory(evaluation=False)\n+            builder.store.global_config.environment_factory(\n+                evaluation=builder.store.is_evaluator\n+            )\n         )  # type: ignore\n \n     @abc.abstractmethod\n", "issue": "[MAINTAIN] Set environment factory function based on executor or evaluator.\n### Please describe what needs to be maintained?\r\nSet `evaluation` variable in environment factory based on if an executor or evaluator is in use.\r\n\r\n### Describe the outcome you'd like\r\nSet `evaluation` variable in environment factory based on `store.executor_environment`. \r\n\r\n### How do we know when maintenance is complete?\r\n`evaluation` variable in environment factory will be set based on if an executor or evaluator is us use.\r\n\n", "before_files": [{"content": "# python3\n# Copyright 2021 InstaDeep Ltd. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Execution components for system builders\"\"\"\nimport abc\nimport os\nfrom dataclasses import dataclass\nfrom typing import Callable, List, Optional, Tuple, Type, Union\n\nimport acme\n\nfrom mava import specs\nfrom mava.callbacks import Callback\nfrom mava.components import Component\nfrom mava.components.building.loggers import Logger\nfrom mava.core_jax import SystemBuilder\nfrom mava.environment_loop import ParallelEnvironmentLoop\nfrom mava.utils.sort_utils import sort_str_num\nfrom mava.wrappers.environment_loop_wrappers import (\n    DetailedPerAgentStatistics,\n    EnvironmentLoopStatisticsBase,\n    MonitorParallelEnvironmentLoop,\n)\n\n\n@dataclass\nclass EnvironmentSpecConfig:\n    environment_factory: Optional[Callable[[bool], acme.core.Worker]] = None\n\n\nclass EnvironmentSpec(Component):\n    def __init__(self, config: EnvironmentSpecConfig = EnvironmentSpecConfig()):\n        \"\"\"Component creates a multi-agent environment spec.\n\n        Args:\n            config: EnvironmentSpecConfig.\n        \"\"\"\n        self.config = config\n\n    def on_building_init_start(self, builder: SystemBuilder) -> None:\n        \"\"\"Using the env factory in config, create and store the env spec and agents.\n\n        Args:\n            builder: SystemBuilder.\n\n        Returns:\n            None.\n        \"\"\"\n        builder.store.manager_pid = os.getpid()\n        builder.store.ma_environment_spec = specs.MAEnvironmentSpec(\n            self.config.environment_factory()\n        )\n\n        builder.store.agents = sort_str_num(\n            builder.store.ma_environment_spec.get_agent_ids()\n        )\n        builder.store.extras_spec = {}\n\n    @staticmethod\n    def name() -> str:\n        \"\"\"Static method that returns component name.\"\"\"\n        return \"environment_spec\"\n\n    @staticmethod\n    def required_components() -> List[Type[Callback]]:\n        \"\"\"List of other Components required in the system for this Component to function.\n\n        None required.\n\n        Returns:\n            List of required component classes.\n        \"\"\"\n        return []\n\n\n@dataclass\nclass ExecutorEnvironmentLoopConfig:\n    should_update: bool = True\n    executor_stats_wrapper_class: Optional[\n        Type[EnvironmentLoopStatisticsBase]\n    ] = DetailedPerAgentStatistics\n\n\nclass ExecutorEnvironmentLoop(Component):\n    def __init__(\n        self, config: ExecutorEnvironmentLoopConfig = ExecutorEnvironmentLoopConfig()\n    ):\n        \"\"\"Component creates an executor environment loop.\n\n        Args:\n            config: ExecutorEnvironmentLoopConfig.\n        \"\"\"\n        self.config = config\n\n    def on_building_executor_environment(self, builder: SystemBuilder) -> None:\n        \"\"\"Create and store the executor environment from the factory in config.\n\n        Args:\n            builder: SystemBuilder.\n\n        Returns:\n            None.\n        \"\"\"\n        # Global config set by EnvironmentSpec component\n        builder.store.executor_environment = (\n            builder.store.global_config.environment_factory(evaluation=False)\n        )  # type: ignore\n\n    @abc.abstractmethod\n    def on_building_executor_environment_loop(self, builder: SystemBuilder) -> None:\n        \"\"\"Abstract method for overriding: should create executor environment loop.\n\n        Args:\n            builder: SystemBuilder.\n\n        Returns:\n            None.\n        \"\"\"\n\n    @staticmethod\n    def name() -> str:\n        \"\"\"Static method that returns component name.\"\"\"\n        return \"executor_environment_loop\"\n\n    @staticmethod\n    def required_components() -> List[Type[Callback]]:\n        \"\"\"List of other Components required in the system for this Component to function.\n\n        Logger required to set up builder.store.executor_logger.\n        EnvironmentSpec required for config environment_factory.\n\n        Returns:\n            List of required component classes.\n        \"\"\"\n        return [Logger, EnvironmentSpec]\n\n\nclass ParallelExecutorEnvironmentLoop(ExecutorEnvironmentLoop):\n    def on_building_executor_environment_loop(self, builder: SystemBuilder) -> None:\n        \"\"\"Create and store a parallel environment loop.\n\n        Args:\n            builder: SystemBuilder.\n\n        Returns:\n            None.\n        \"\"\"\n        executor_environment_loop = ParallelEnvironmentLoop(\n            environment=builder.store.executor_environment,\n            executor=builder.store.executor,  # Set up by builder\n            logger=builder.store.executor_logger,\n            should_update=self.config.should_update,\n        )\n        del builder.store.executor_logger\n\n        if self.config.executor_stats_wrapper_class:\n            executor_environment_loop = self.config.executor_stats_wrapper_class(\n                executor_environment_loop\n            )\n        builder.store.system_executor = executor_environment_loop\n\n\n@dataclass\nclass MonitorExecutorEnvironmentLoopConfig(ExecutorEnvironmentLoopConfig):\n    filename: str = \"agents\"\n    label: str = \"parallel_environment_loop\"\n    record_every: int = 1000\n    fps: int = 15\n    counter_str: str = \"evaluator_episodes\"\n    format: str = \"video\"\n    figsize: Union[float, Tuple[int, int]] = (360, 640)\n\n\nclass MonitorExecutorEnvironmentLoop(ExecutorEnvironmentLoop):\n    def __init__(\n        self,\n        config: MonitorExecutorEnvironmentLoopConfig = MonitorExecutorEnvironmentLoopConfig(),  # noqa\n    ):\n        \"\"\"Component for visualising environment progress.\"\"\"\n        super().__init__(config=config)\n        self.config = config\n\n    def on_building_executor_environment_loop(self, builder: SystemBuilder) -> None:\n        \"\"\"Monitors environments and produces videos of episodes.\n\n        Builds a `ParallelEnvironmentLoop` on the evaluator and a\n        `MonitorParallelEnvironmentLoop` on all executors and stores it\n        in the `builder.store.system_executor`.\n\n        Args:\n            builder: SystemBuilder\n        \"\"\"\n        if builder.store.is_evaluator:\n            executor_environment_loop = MonitorParallelEnvironmentLoop(\n                environment=builder.store.executor_environment,\n                executor=builder.store.executor,\n                logger=builder.store.executor_logger,\n                should_update=self.config.should_update,\n                filename=self.config.filename,\n                label=self.config.label,\n                record_every=self.config.record_every,\n                path=builder.store.global_config.experiment_path,\n                fps=self.config.fps,\n                counter_str=self.config.counter_str,\n                format=self.config.format,\n                figsize=self.config.figsize,\n            )\n        else:\n            executor_environment_loop = ParallelEnvironmentLoop(\n                environment=builder.store.executor_environment,\n                executor=builder.store.executor,\n                logger=builder.store.executor_logger,\n                should_update=self.config.should_update,\n            )\n\n        del builder.store.executor_logger\n\n        if self.config.executor_stats_wrapper_class:\n            executor_environment_loop = self.config.executor_stats_wrapper_class(\n                executor_environment_loop\n            )\n\n        builder.store.system_executor = executor_environment_loop\n", "path": "mava/components/building/environments.py"}], "after_files": [{"content": "# python3\n# Copyright 2021 InstaDeep Ltd. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\n\"\"\"Execution components for system builders\"\"\"\nimport abc\nimport os\nfrom dataclasses import dataclass\nfrom typing import Callable, List, Optional, Tuple, Type, Union\n\nimport acme\n\nfrom mava import specs\nfrom mava.callbacks import Callback\nfrom mava.components import Component\nfrom mava.components.building.loggers import Logger\nfrom mava.core_jax import SystemBuilder\nfrom mava.environment_loop import ParallelEnvironmentLoop\nfrom mava.utils.sort_utils import sort_str_num\nfrom mava.wrappers.environment_loop_wrappers import (\n    DetailedPerAgentStatistics,\n    EnvironmentLoopStatisticsBase,\n    MonitorParallelEnvironmentLoop,\n)\n\n\n@dataclass\nclass EnvironmentSpecConfig:\n    environment_factory: Optional[Callable[[bool], acme.core.Worker]] = None\n\n\nclass EnvironmentSpec(Component):\n    def __init__(self, config: EnvironmentSpecConfig = EnvironmentSpecConfig()):\n        \"\"\"Component creates a multi-agent environment spec.\n\n        Args:\n            config: EnvironmentSpecConfig.\n        \"\"\"\n        self.config = config\n\n    def on_building_init_start(self, builder: SystemBuilder) -> None:\n        \"\"\"Using the env factory in config, create and store the env spec and agents.\n\n        Args:\n            builder: SystemBuilder.\n\n        Returns:\n            None.\n        \"\"\"\n        builder.store.manager_pid = os.getpid()\n        builder.store.ma_environment_spec = specs.MAEnvironmentSpec(\n            self.config.environment_factory()\n        )\n\n        builder.store.agents = sort_str_num(\n            builder.store.ma_environment_spec.get_agent_ids()\n        )\n        builder.store.extras_spec = {}\n\n    @staticmethod\n    def name() -> str:\n        \"\"\"Static method that returns component name.\"\"\"\n        return \"environment_spec\"\n\n    @staticmethod\n    def required_components() -> List[Type[Callback]]:\n        \"\"\"List of other Components required in the system for this Component to function.\n\n        None required.\n\n        Returns:\n            List of required component classes.\n        \"\"\"\n        return []\n\n\n@dataclass\nclass ExecutorEnvironmentLoopConfig:\n    should_update: bool = True\n    executor_stats_wrapper_class: Optional[\n        Type[EnvironmentLoopStatisticsBase]\n    ] = DetailedPerAgentStatistics\n\n\nclass ExecutorEnvironmentLoop(Component):\n    def __init__(\n        self, config: ExecutorEnvironmentLoopConfig = ExecutorEnvironmentLoopConfig()\n    ):\n        \"\"\"Component creates an executor environment loop.\n\n        Args:\n            config: ExecutorEnvironmentLoopConfig.\n        \"\"\"\n        self.config = config\n\n    def on_building_executor_environment(self, builder: SystemBuilder) -> None:\n        \"\"\"Create and store the executor environment from the factory in config.\n\n        Args:\n            builder: SystemBuilder.\n\n        Returns:\n            None.\n        \"\"\"\n        # Global config set by EnvironmentSpec component\n        builder.store.executor_environment = (\n            builder.store.global_config.environment_factory(\n                evaluation=builder.store.is_evaluator\n            )\n        )  # type: ignore\n\n    @abc.abstractmethod\n    def on_building_executor_environment_loop(self, builder: SystemBuilder) -> None:\n        \"\"\"Abstract method for overriding: should create executor environment loop.\n\n        Args:\n            builder: SystemBuilder.\n\n        Returns:\n            None.\n        \"\"\"\n\n    @staticmethod\n    def name() -> str:\n        \"\"\"Static method that returns component name.\"\"\"\n        return \"executor_environment_loop\"\n\n    @staticmethod\n    def required_components() -> List[Type[Callback]]:\n        \"\"\"List of other Components required in the system for this Component to function.\n\n        Logger required to set up builder.store.executor_logger.\n        EnvironmentSpec required for config environment_factory.\n\n        Returns:\n            List of required component classes.\n        \"\"\"\n        return [Logger, EnvironmentSpec]\n\n\nclass ParallelExecutorEnvironmentLoop(ExecutorEnvironmentLoop):\n    def on_building_executor_environment_loop(self, builder: SystemBuilder) -> None:\n        \"\"\"Create and store a parallel environment loop.\n\n        Args:\n            builder: SystemBuilder.\n\n        Returns:\n            None.\n        \"\"\"\n        executor_environment_loop = ParallelEnvironmentLoop(\n            environment=builder.store.executor_environment,\n            executor=builder.store.executor,  # Set up by builder\n            logger=builder.store.executor_logger,\n            should_update=self.config.should_update,\n        )\n        del builder.store.executor_logger\n\n        if self.config.executor_stats_wrapper_class:\n            executor_environment_loop = self.config.executor_stats_wrapper_class(\n                executor_environment_loop\n            )\n        builder.store.system_executor = executor_environment_loop\n\n\n@dataclass\nclass MonitorExecutorEnvironmentLoopConfig(ExecutorEnvironmentLoopConfig):\n    filename: str = \"agents\"\n    label: str = \"parallel_environment_loop\"\n    record_every: int = 1000\n    fps: int = 15\n    counter_str: str = \"evaluator_episodes\"\n    format: str = \"video\"\n    figsize: Union[float, Tuple[int, int]] = (360, 640)\n\n\nclass MonitorExecutorEnvironmentLoop(ExecutorEnvironmentLoop):\n    def __init__(\n        self,\n        config: MonitorExecutorEnvironmentLoopConfig = MonitorExecutorEnvironmentLoopConfig(),  # noqa\n    ):\n        \"\"\"Component for visualising environment progress.\"\"\"\n        super().__init__(config=config)\n        self.config = config\n\n    def on_building_executor_environment_loop(self, builder: SystemBuilder) -> None:\n        \"\"\"Monitors environments and produces videos of episodes.\n\n        Builds a `ParallelEnvironmentLoop` on the evaluator and a\n        `MonitorParallelEnvironmentLoop` on all executors and stores it\n        in the `builder.store.system_executor`.\n\n        Args:\n            builder: SystemBuilder\n        \"\"\"\n        if builder.store.is_evaluator:\n            executor_environment_loop = MonitorParallelEnvironmentLoop(\n                environment=builder.store.executor_environment,\n                executor=builder.store.executor,\n                logger=builder.store.executor_logger,\n                should_update=self.config.should_update,\n                filename=self.config.filename,\n                label=self.config.label,\n                record_every=self.config.record_every,\n                path=builder.store.global_config.experiment_path,\n                fps=self.config.fps,\n                counter_str=self.config.counter_str,\n                format=self.config.format,\n                figsize=self.config.figsize,\n            )\n        else:\n            executor_environment_loop = ParallelEnvironmentLoop(\n                environment=builder.store.executor_environment,\n                executor=builder.store.executor,\n                logger=builder.store.executor_logger,\n                should_update=self.config.should_update,\n            )\n\n        del builder.store.executor_logger\n\n        if self.config.executor_stats_wrapper_class:\n            executor_environment_loop = self.config.executor_stats_wrapper_class(\n                executor_environment_loop\n            )\n\n        builder.store.system_executor = executor_environment_loop\n", "path": "mava/components/building/environments.py"}]}