docstr: Sets the parameters that are environment dependent. As a side effect, initializes all the components that are
  dependent on those values, by calling init_environment_dependent_modules
  
  :param spaces: the environment spaces definition
  :return: None
docstr_tok: ["Sets","the","parameters","that","are","environment","dependent",".","As","a","side","effect",",","initializes","all","the","components","that","are","dependent","on","those","values",",","by","calling","init_environment_dependent_modules",":","param","spaces",":","the","environment","spaces","definition",":","return",":","None"]
code: def set_environment_parameters(self, spaces: SpacesDefinition):
      """
      Sets the parameters that are environment dependent. As a side effect, initializes all the components that are
      dependent on those values, by calling init_environment_dependent_modules
  
      :param spaces: the environment spaces definition
      :return: None
      """
      self.spaces = copy.deepcopy(spaces)
  
      if self.ap.algorithm.use_accumulated_reward_as_measurement:
          if "measurements" in self.spaces.state.sub_spaces:
              self.spaces.state["measurements"].shape += 1
              self.spaces.state["measurements"].measurements_names += [
                  "accumulated_reward"
              ]
          else:
              self.spaces.state[
                  "measurements"
              ] = VectorObservationSpace(
                  1, measurements_names=["accumulated_reward"]
              )
  
      for observation_name in self.spaces.state.sub_spaces.keys():
          self.spaces.state[
              observation_name
          ] = self.pre_network_filter.get_filtered_observation_space(
              observation_name,
              self.input_filter.get_filtered_observation_space(
                  observation_name, self.spaces.state[observation_name]
              ),
          )
  
      self.spaces.reward = (
          self.pre_network_filter.get_filtered_reward_space(
              self.input_filter.get_filtered_reward_space(
                  self.spaces.reward
              )
          )
      )
  
      self.spaces.action = (
          self.output_filter.get_unfiltered_action_space(
              self.spaces.action
          )
      )
  
      if isinstance(self.in_action_space, GoalsSpace):
          # TODO: what if the goal type is an embedding / embedding change?
          self.spaces.goal = self.in_action_space
          self.spaces.goal.set_target_space(
              self.spaces.state[self.spaces.goal.goal_name]
          )
  
      self.init_environment_dependent_modules()
  
imports: import copy
  import random
  from collections import OrderedDict
  from typing import Dict, List, Union, Tuple
  import numpy
  from six.moves import range
  from rl_coach.agents.agent_interface import AgentInterface
  from rl_coach.architectures.network_wrapper import NetworkWrapper
  from rl_coach.base_parameters import AgentParameters, Device, DeviceType, DistributedTaskParameters, Frameworks
  from rl_coach.core_types import RunPhase, PredictionType, EnvironmentEpisodes, ActionType, Batch, Episode, StateType
  from rl_coach.core_types import Transition, ActionInfo, TrainingSteps, EnvironmentSteps, EnvResponse
  from rl_coach.logger import screen, Logger, EpisodeLogger
  from rl_coach.memories.episodic.episodic_experience_replay import EpisodicExperienceReplay
  from rl_coach.saver import SaverCollection
  from rl_coach.spaces import SpacesDefinition, VectorObservationSpace, GoalsSpace, AttentionActionSpace
  from rl_coach.utils import Signal, force_list
  from rl_coach.utils import dynamic_import_and_instantiate_module_from_params
  from rl_coach.memories.backend.memory_impl import get_memory_backend
  from rl_coach.core_types import TimeTypes
  from rl_coach.off_policy_evaluators.ope_manager import OpeManager
  from rl_coach.core_types import PickledReplayBuffer, CsvDataset
label_desc: Use image node_id 9 for calling the Agent obj's underlying member method code with example usage: obj.set_environment_parameters(spaces) without return types