
    &`in                        d dl Z d dlmZ d dlmZ d dlmZmZmZ d dl	m
Z
 d dlmZ d dlmZ d dlmZmZ d d	lmZmZ e ed
           G d d                                  Zee G d d                                  ZdS )    N)	dataclass)Enum)CallableOptionalUnion)_DEPRECATED_VALUE)Trial)TrialScheduler)SearchAlgorithmSearcher)DeveloperAPI	PublicAPIbeta)	stabilityc                   ^   e Zd ZU dZdZee         ed<   dZee         ed<   dZ	ee
eef                  ed<   dZee         ed<   dZeed<   dZee         ed	<   dZee
eeej        f                  ed
<   dZeed<   dZeeegef                  ed<   dZeeegef                  ed<   eZeed<   dS )
TuneConfiga  Tune specific configs.

    Args:
        metric: Metric to optimize. This metric should be reported
            with `tune.report()`. If set, will be passed to the search
            algorithm and scheduler.
        mode: Must be one of [min, max]. Determines whether objective is
            minimizing or maximizing the metric attribute. If set, will be
            passed to the search algorithm and scheduler.
        search_alg: Search algorithm for optimization. Default to
            random search.
        scheduler: Scheduler for executing the experiment.
            Choose among FIFO (default), MedianStopping,
            AsyncHyperBand, HyperBand and PopulationBasedTraining. Refer to
            ray.tune.schedulers for more options.
        num_samples: Number of times to sample from the
            hyperparameter space. Defaults to 1. If `grid_search` is
            provided as an argument, the grid will be repeated
            `num_samples` of times. If this is -1, (virtually) infinite
            samples are generated until a stopping condition is met.
        max_concurrent_trials: Maximum number of trials to run
            concurrently. Must be non-negative. If None or 0, no limit will
            be applied. This is achieved by wrapping the ``search_alg`` in
            a :class:`ConcurrencyLimiter`, and thus setting this argument
            will raise an exception if the ``search_alg`` is already a
            :class:`ConcurrencyLimiter`. Defaults to None.
        time_budget_s: Global time budget in
            seconds after which all trials are stopped. Can also be a
            ``datetime.timedelta`` object.
        reuse_actors: Whether to reuse actors between different trials
            when possible. This can drastically speed up experiments that start
            and stop actors often (e.g., PBT in time-multiplexing mode). This
            requires trials to have the same resource requirements.
            Defaults to ``False``.
        trial_name_creator: Optional function that takes in a Trial and returns
            its name (i.e. its string representation). Be sure to include some unique
            identifier (such as `Trial.trial_id`) in each trial's name.
            NOTE: This API is in alpha and subject to change.
        trial_dirname_creator: Optional function that takes in a trial and
            generates its trial directory name as a string. Be sure to include some
            unique identifier (such as `Trial.trial_id`) is used in each trial's
            directory name. Otherwise, trials could overwrite artifacts and checkpoints
            of other trials. The return value cannot be a path.
            NOTE: This API is in alpha and subject to change.
        chdir_to_trial_dir: Deprecated. Set the `RAY_CHDIR_TO_TRIAL_DIR` env var instead
    Nmodemetric
search_alg	scheduler   num_samplesmax_concurrent_trialstime_budget_sFreuse_actorstrial_name_creatortrial_dirname_creatorchdir_to_trial_dir)__name__
__module____qualname____doc__r   r   str__annotations__r   r   r   r   r   r   r
   r   intr   r   floatdatetime	timedeltar   boolr   r   r	   r   r   r        h/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/tune/tune_config.pyr   r      s'        - -d D(3- FHSM   =AJx89:AAA*.Ix'...K+/8C=///EIM8E#uh.@"@ABIIIL$;?5'3,!78???>B8HeWc\$:;BBB000000r+   r   c                   x    e Zd ZU dZ G d de          Zej        Zee	d<   ej
        Zee	d<   ej        Zee	d<   dS )ResumeConfigzH[Experimental] This config is used to specify how to resume Tune trials.c                       e Zd ZdZdZdZdZdS )ResumeConfig.ResumeTypea%  An enumeration to define resume types for various trial states.

        Members:
            RESUME: Resume from the latest checkpoint.
            RESTART: Restart from the beginning (with no checkpoint).
            SKIP: Skip this trial when resuming by treating it as terminated.
        resumerestartskipN)r   r    r!   r"   RESUMERESTARTSKIPr*   r+   r,   
ResumeTyper0   T   s)        	 	 r+   r7   finished
unfinishederroredN)r   r    r!   r"   r   r7   r6   r8   r#   r$   r4   r9   r:   r*   r+   r,   r.   r.   O   s~          SR    T    OHc### 'J'''?GS"""""r+   r.   )r'   dataclassesr   enumr   typingr   r   r   ray.train.constantsr   ray.tune.experiment.trialr	   ray.tune.schedulersr
   ray.tune.searchr   r   ray.util.annotationsr   r   r   r.   r*   r+   r,   <module>rC      sK    ! ! ! ! ! !       , , , , , , , , , , 1 1 1 1 1 1 + + + + + + . . . . . . 5 5 5 5 5 5 5 5 8 8 8 8 8 8 8 8 
V=1 =1 =1 =1 =1 =1 =1  =1@ 
# # # # # # #  # # #r+   