def __init__(
      self,
      agent_name: str,
      act_component: entity_component.ActingComponent,
      context_processor: (
          entity_component.ContextProcessorComponent | None
      ) = None,
      context_components: Mapping[str, entity_component.ContextComponent] = (
          types.MappingProxyType({})
      ),
      component_logging: measurements_lib.Measurements | None = None,
      config: formative_memories.AgentConfig | None = None,
  ):
    """Initializes the agent.

    The passed components will be owned by this entity agent (i.e. their
    `set_entity` method will be called with this entity as the argument).

    Whenever `get_last_log` is called, the latest values published in all the
    channels in the given measurements object will be returned as a mapping of
    channel name to value.

    Args:
      agent_name: The name of the agent.
      act_component: The component that will be used to act.
      context_processor: The component that will be used to process contexts. If
        None, a NoOpContextProcessor will be used.
      context_components: The ContextComponents that will be used by the agent.
      component_logging: The channels where components publish events.
      config: The agent configuration, used for checkpointing and debug.
    """
    super().__init__(agent_name=agent_name,
                     act_component=act_component,
                     context_processor=context_processor,
                     context_components=context_components)
    self._log: Mapping[str, Any] = {}
    self._tick = rx.subject.Subject()
    self._component_logging = component_logging
    if self._component_logging is not None:
      self._channel_names = list(self._component_logging.available_channels())
      channels = [
          self._component_logging.get_channel(channel)  # pylint: disable=attribute-error  pytype mistakenly forgets that `_component_logging` is not None.
          for channel in self._channel_names
      ]
      rx.with_latest_from(self._tick, *channels).subscribe(
          self._set_log,
          on_error=lambda e: logging.error('Error in component logging: %s', e))
    else:
      self._channel_names = []
    self._config = copy.deepcopy(config)
Initializes the agent.

    The passed components will be owned by this entity agent (i.e. their
    `set_entity` method will be called with this entity as the argument).

    Whenever `get_last_log` is called, the latest values published in all the
    channels in the given measurements object will be returned as a mapping of
    channel name to value.

    Args:
      agent_name: The name of the agent.
      act_component: The component that will be used to act.
      context_processor: The component that will be used to process contexts. If
        None, a NoOpContextProcessor will be used.
      context_components: The ContextComponents that will be used by the agent.
      component_logging: The channels where components publish events.
      config: The agent configuration, used for checkpointing and debug.
    
concordia/agents/deprecated/entity_agent_with_logging.py