
    &`i	                     |    d dl Z d dlmZmZ d dlmZ erd dlmZ d dlm	Z	 d dl
mZ e G d d                      ZdS )	    N)TYPE_CHECKINGOptional)	PublicAPIAlgorithmConfig)RolloutWorker)SamplerInputc                       e Zd ZdZe	 	 	 	 ddee         ded         deded	         fd
            Zeded         fd            Z	e
ed                         Ze
ed                         ZdS )	IOContextzClass containing attributes to pass to input/output class constructors.

    RLlib auto-sets these attributes when constructing input/output classes,
    such as InputReaders and OutputWriters.
    Nr   log_dirconfigr   worker_indexworkerr   c                     ddl m} |pt          j                    | _        |p3 |                                |du                               d          | _        || _        || _	        dS )a  Initializes a IOContext object.

        Args:
            log_dir: The logging directory to read from/write to.
            config: The (main) AlgorithmConfig object.
            worker_index: When there are multiple workers created, this
                uniquely identifies the current worker. 0 for the local
                worker, >0 for any of the remote workers.
            worker: The RolloutWorker object reference.
        r   r   N)actions_in_input_normalized   )train_batch_size)
%ray.rllib.algorithms.algorithm_configr   osgetcwdr   offline_datatrainingr   r   r   )selfr   r   r   r   r   s         p/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/rllib/offline/io_context.py__init__zIOContext.__init__   s    $ 	JIIIII-")++
  ' 1 1 > >(.$ !? !
 !

(A(
&
& 	 )    returnr	   c                     | j         j        S )ai  Returns the RolloutWorker's SamplerInput object, if any.

        Returns None if the RolloutWorker has no SamplerInput. Note that local
        workers in case there are also one or more remote workers by default
        do not create a SamplerInput object.

        Returns:
            The RolloutWorkers' SamplerInput object or None if none exists.
        )r   samplerr   s    r   default_sampler_inputzIOContext.default_sampler_input3   s     {""r   c                 8    | j                             di           S )Ninput_configr   getr    s    r   r#   zIOContext.input_config@   s     {~r222r   c                 8    | j                             di           S )Noutput_configr$   r    s    r   r'   zIOContext.output_configE   s     {333r   )NNr   N)__name__
__module____qualname____doc__r   r   strintr   r!   propertyr#   r'    r   r   r   r      s           "&.2,0 # *+ 	
 )   Y< 
#x'? 
# 
# 
# Y
# 3 3 Y X3 4 4 Y X4 4 4r   r   )r   typingr   r   ray.rllib.utils.annotationsr   r   r   #ray.rllib.evaluation.rollout_workerr   ray.rllib.evaluation.samplerr	   r   r/   r   r   <module>r4      s    				 * * * * * * * * 1 1 1 1 1 1 :EEEEEEAAAAAA999999 ;4 ;4 ;4 ;4 ;4 ;4 ;4 ;4 ;4 ;4r   