Ë
    þÍ:j®O  ã            	      ó°  — d dl mZ d dlZd dlZd dlmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dl	mZ d d	lmZ d d
lmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ erd dlmZ d dlmZ d dlm Z  d dlm!Z! d dlm"Z"  ejF                  e$«      Z%dZ& G d„ de«      Z'ejP                  ddddddddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Z)y)é    )ÚannotationsN)ÚAny)Úcast)Úoverload)ÚTYPE_CHECKING)Údistributions)Úlogging)Úconvert_positional_args)Údeprecated_func)Úoptuna_warn)Ú-_convert_old_distribution_to_new_distribution)ÚCategoricalDistribution)ÚFloatDistribution)ÚIntDistribution)Ú_SUGGEST_INT_POSITIONAL_ARGS)Ú	BaseTrial)Ú
TrialState)ÚMapping)ÚSequence)ÚJSONSerializable)ÚBaseDistribution)ÚCategoricalChoiceTypez Use suggest_float{args} instead.c                  óN  — e Zd ZdZddœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d<d„Zd=d„Zd=d„Zd=d„Zd>d„Zd?d	„Z	dd
dœ	 	 	 	 	 	 	 	 	 	 	 d@d„Z
 eddej                  d¬«      ¬«      dAd„«       Z eddej                  d¬«      ¬«      dAd„«       Z eddej                  d¬«      ¬«      dBd„«       Z eedd¬«      dd
dœ	 	 	 	 	 	 	 	 	 	 	 dCd„«       ZedDd„«       ZedEd„«       ZedFd„«       ZedGd„«       ZedHd „«       Ze	 	 	 	 	 	 dId!„«       Z	 	 	 	 	 	 dId"„ZdJd#„ZdKd$„ZdLd%„Z ed&d«      dLd'„«       ZdMd(„ZdNd)„Zed>d*„«       Zej<                  dOd+„«       ZedPd,„«       Zej<                  dQd-„«       ZdRd.„Z dSd/„Z! ee e!«      Z"edTd0„«       Z#e#j<                  dUd1„«       Z#edVd2„«       Z$e$j<                  dWd3„«       Z$edXd4„«       Z%e%j<                  dYd5„«       Z%edVd6„«       Z&e&j<                  dZd7„«       Z&edVd8„«       Z'e'j<                  d[d9„«       Z'ed\d:„«       Z(ed]d;„«       Z)y)^ÚFrozenTrialaÒ  Status and results of a :class:`~optuna.trial.Trial`.

    An object of this class has the same methods as :class:`~optuna.trial.Trial`, but is not
    associated with, nor has any references to a :class:`~optuna.study.Study`.

    It is therefore not possible to make persistent changes to a storage from this object by
    itself, for instance by using :func:`~optuna.trial.FrozenTrial.set_user_attr`.

    It will suggest the parameter values stored in :attr:`params` and will not sample values from
    any distributions.

    It can be passed to objective functions (see :func:`~optuna.study.Study.optimize`) and is
    useful for deploying optimization results.

    Example:

        Re-evaluate an objective function with parameter values optimized study.

        .. testcode::

            import optuna


            def objective(trial):
                x = trial.suggest_float("x", -1, 1)
                return x**2


            study = optuna.create_study()
            study.optimize(objective, n_trials=3)

            assert objective(study.best_trial) == study.best_value

    .. note::
        Instances are mutable, despite the name.
        For instance, :func:`~optuna.trial.FrozenTrial.set_user_attr` will update user attributes
        of objects in-place.


        Example:

            Overwritten attributes.

            .. testcode::

                import copy
                import datetime

                import optuna


                def objective(trial):
                    x = trial.suggest_float("x", -1, 1)

                    # this user attribute always differs
                    trial.set_user_attr("evaluation time", datetime.datetime.now())

                    return x**2


                study = optuna.create_study()
                study.optimize(objective, n_trials=3)

                best_trial = study.best_trial
                best_trial_copy = copy.deepcopy(best_trial)

                # re-evaluate
                objective(best_trial)

                # the user attribute is overwritten by re-evaluation
                assert best_trial.user_attrs != best_trial_copy.user_attrs

    .. note::
        Please refer to :class:`~optuna.trial.Trial` for details of methods and properties.


    Attributes:
        number:
            Unique and consecutive number of :class:`~optuna.trial.Trial` for each
            :class:`~optuna.study.Study`. Note that this field uses zero-based numbering.
        state:
            :class:`TrialState` of the :class:`~optuna.trial.Trial`.
        value:
            Objective value of the :class:`~optuna.trial.Trial`.
            ``value`` and ``values`` must not be specified at the same time.
        values:
            Sequence of objective values of the :class:`~optuna.trial.Trial`.
            The length is greater than 1 if the problem is multi-objective optimization.
            ``value`` and ``values`` must not be specified at the same time.
        datetime_start:
            Datetime where the :class:`~optuna.trial.Trial` started.
        datetime_complete:
            Datetime where the :class:`~optuna.trial.Trial` finished.
        params:
            Dictionary that contains suggested parameters.
        distributions:
            Dictionary that contains the distributions of :attr:`params`.
        user_attrs:
            Dictionary that contains the attributes of the :class:`~optuna.trial.Trial` set with
            :func:`optuna.trial.Trial.set_user_attr`.
        system_attrs:
            Dictionary that contains the attributes of the :class:`~optuna.trial.Trial` set with
            :func:`optuna.trial.Trial.set_system_attr`.
        intermediate_values:
            Intermediate objective values set with :func:`optuna.trial.Trial.report`.
    N)Úvaluesc               óö   — || _         || _        d | _        |�|�t        d«      ‚|�	|g| _        n|�t	        |«      | _        || _        || _        || _        || _        |	| _	        |
| _
        || _        || _        y )Nz)Specify only one of `value` and `values`.)Ú_numberÚstateÚ_valuesÚ
ValueErrorÚlistÚ_datetime_startÚdatetime_completeÚ_paramsÚ_user_attrsÚ_system_attrsÚintermediate_valuesÚ_distributionsÚ	_trial_id)ÚselfÚnumberr   ÚvalueÚdatetime_startr#   Úparamsr   Ú
user_attrsÚsystem_attrsr'   Útrial_idr   s                úi/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/optuna/trial/_frozen.pyÚ__init__zFrozenTrial.__init__‘   sŽ   € ð  ˆŒØˆŒ
Ø+/ˆŒØÐ Ð!3ÜÐHÓIÐIØÐØ!˜7ˆD�LØÐÜ ›<ˆDŒLØ-ˆÔØ!2ˆÔØˆŒØ%ˆÔØ)ˆÔØ#6ˆÔ Ø+ˆÔØ!ˆ�ó    c                ó`   — t        |t        «      st        S |j                  | j                  k(  S ©N)Ú
isinstancer   ÚNotImplementedÚ__dict__©r*   Úothers     r2   Ú__eq__zFrozenTrial.__eq__³   s%   € Ü˜%¤Ô-Ü!Ð!Ø�~‰~ §¡Ñ.Ð.r4   c                ó`   — t        |t        «      st        S | j                  |j                  k  S r6   ©r7   r   r8   r+   r:   s     r2   Ú__lt__zFrozenTrial.__lt__¸   s%   € Ü˜%¤Ô-Ü!Ð!à�{‰{˜UŸ\™\Ñ)Ð)r4   c                ó`   — t        |t        «      st        S | j                  |j                  k  S r6   r>   r:   s     r2   Ú__le__zFrozenTrial.__le__¾   s%   € Ü˜%¤Ô-Ü!Ð!à�{‰{˜eŸl™lÑ*Ð*r4   c                óR   ‡ — t        t        ˆ fd„‰ j                  D «       «      «      S )Nc              3  ó6   •K  — | ]  }t        ‰|«      –— Œ y ­wr6   )Úgetattr©Ú.0Úfieldr*   s     €r2   ú	<genexpr>z'FrozenTrial.__hash__.<locals>.<genexpr>Å   s   øè ø€ ÒJ°5œ' $¨×.ÑJùs   ƒ)ÚhashÚtupler9   ©r*   s   `r2   Ú__hash__zFrozenTrial.__hash__Ä   s   ø€ Ü”EÓJ¸D¿M¹MÔJÓJÓKÐKr4   c                óŽ   ‡ — ‰ j                   j                  }dj                  ˆ fd„‰ j                  D «       «      dz   }|› d|› d�S )Nz, c           	   3  ó~   •K  — | ]4  }|j                  d «      s|n|dd › dt        t        ‰|«      «      › �–— Œ6 y­w)Ú_é   Nú=)Ú
startswithÚreprrD   rE   s     €r2   rH   z'FrozenTrial.__repr__.<locals>.<genexpr>Ê   sI   øè ø€ ò àð !&× 0Ñ 0°Ô 5‘5¸5ÀÀ¸9ÐEÀQÄtÌGÐTXÐZ_ÓL`ÓGaÐFbÔcñùs   ƒ:=z, value=Noneú(ú))Ú	__class__Ú__name__Újoinr9   )r*   ÚclsÚkwargss   `  r2   Ú__repr__zFrozenTrial.__repr__Ç   sS   ø€ Ø�n‰n×%Ñ%ˆà�I‰Ió à!Ÿ]™]ôó ð ñ	ð 	ð ��a˜�x˜qÐ!Ð!r4   F)ÚstepÚlogc          	     ó@   — | j                  |t        ||||¬«      «      S ©N)r]   r\   )Ú_suggestr   ©r*   ÚnameÚlowÚhighr\   r]   s         r2   Úsuggest_floatzFrozenTrial.suggest_floatÒ   s!   € ð �}‰}˜TÔ#4°S¸$ÀCÈdÔ#SÓTÐTr4   z3.0.0z6.0.0Ú )Úargs)Útextc                ó(   — | j                  |||«      S r6   ©re   ©r*   rb   rc   rd   s       r2   Úsuggest_uniformzFrozenTrial.suggest_uniformÝ   s   € à×!Ñ! $¨¨TÓ2Ð2r4   z(..., log=True)c                ó,   — | j                  |||d¬«      S )NT)r]   rj   rk   s       r2   Úsuggest_loguniformzFrozenTrial.suggest_loguniformá   s   € à×!Ñ! $¨¨T°tÐ!Ó<Ð<r4   z(..., step=...)c                ó,   — | j                  ||||¬«      S )N)r\   rj   )r*   rb   rc   rd   Úqs        r2   Úsuggest_discrete_uniformz$FrozenTrial.suggest_discrete_uniformå   s   € à×!Ñ! $¨¨T¸Ð!Ó:Ð:r4   z3.5.0z5.0.0)Úprevious_positional_arg_namesÚdeprecated_versionÚremoved_versionrP   c               óR   — t        | j                  |t        ||||¬«      «      «      S r_   )Úintr`   r   ra   s         r2   Úsuggest_intzFrozenTrial.suggest_inté   s&   € ô �4—=‘= ¤°s¸DÀcÐPTÔ'UÓVÓWÐWr4   c                 ó   — y r6   © ©r*   rb   Úchoicess      r2   Úsuggest_categoricalzFrozenTrial.suggest_categoricaló   ó   € ØORr4   c                 ó   — y r6   ry   rz   s      r2   r|   zFrozenTrial.suggest_categoricalö   r}   r4   c                 ó   — y r6   ry   rz   s      r2   r|   zFrozenTrial.suggest_categoricalù   ó   € ØMPr4   c                 ó   — y r6   ry   rz   s      r2   r|   zFrozenTrial.suggest_categoricalü   s   € ØQTr4   c                 ó   — y r6   ry   rz   s      r2   r|   zFrozenTrial.suggest_categoricalÿ   r€   r4   c                 ó   — y r6   ry   rz   s      r2   r|   zFrozenTrial.suggest_categorical  s   € ð !$r4   c                ó:   — | j                  |t        |¬«      «      S )N)r{   )r`   r   rz   s      r2   r|   zFrozenTrial.suggest_categorical  s   € ð �}‰}˜TÔ#:À7Ô#KÓLÐLr4   c                 ó   — y)aŸ  Interface of report function.

        Since :class:`~optuna.trial.FrozenTrial` is not pruned,
        this report function does nothing.

        .. seealso::
            Please refer to :func:`~optuna.trial.FrozenTrial.should_prune`.

        Args:
            value:
                A value returned from the objective function.
            step:
                Step of the trial (e.g., Epoch of neural network training). Note that pruners
                assume that ``step`` starts at zero. For example,
                :class:`~optuna.pruners.MedianPruner` simply checks if ``step`` is less than
                ``n_warmup_steps`` as the warmup mechanism.
        Nry   )r*   r,   r\   s      r2   ÚreportzFrozenTrial.report  s   € ð& 	r4   c                 ó   — y)a'  Suggest whether the trial should be pruned or not.

        The suggestion is always :obj:`False` regardless of a pruning algorithm.

        .. note::
            :class:`~optuna.trial.FrozenTrial` only samples one combination of parameters.

        Returns:
            :obj:`False`.
        Fry   rK   s    r2   Úshould_prunezFrozenTrial.should_prune!  s   € ð r4   c                ó"   — || j                   |<   y r6   ©r%   ©r*   Úkeyr,   s      r2   Úset_user_attrzFrozenTrial.set_user_attr/  s   € Ø %ˆ×Ñ˜Òr4   z3.1.0c                ó"   — || j                   |<   y r6   ©r&   r‹   s      r2   Úset_system_attrzFrozenTrial.set_system_attr2  s   € à"'ˆ×Ñ˜3Òr4   c           
     ó<  — | j                   t        j                  k7  r| j                  €t	        d«      ‚| j                   j                  «       r| j                  €"t	        d«      ‚| j                  �t	        d«      ‚| j                   t        j                  k(  r%| j                  �t	        d| j                  › d�«      ‚| j                   t        j                  k(  r>| j                  €t	        d«      ‚t        d„ | j                  D «       «      rt	        d«      ‚t        | j                  j                  «       «      t        | j                  j                  «       «      k7  rTt	        d	t        | j                  j                  «       «      › d
t        | j                  j                  «       «      › d�«      ‚| j                  j                  «       D ]K  \  }}| j                  |   }|j!                  |«      }|j#                  |«      rŒ8t	        d|› d|› d|› d�«      ‚ y )NzK`datetime_start` is supposed to be set when the trial state is not waiting.z?`datetime_complete` is supposed to be set for a finished trial.zC`datetime_complete` is supposed to be None for an unfinished trial.z2values should be None for a failed trial, but got ú.z*values should be set for a complete trial.c              3  óF   K  — | ]  }t        j                  |«      –— Œ y ­wr6   )ÚmathÚisnan)rF   Úxs     r2   rH   z(FrozenTrial._validate.<locals>.<genexpr>J  s   è ø€ Ò9 q”T—Z‘Z —]Ñ9ùs   ‚!zvalues should not contain NaN.zInconsistent parameters z and distributions ú
The value z of parameter 'z&' isn't contained in the distribution )r   r   ÚWAITINGr-   r    Úis_finishedr#   ÚFAILr   ÚCOMPLETEÚanyÚsetr.   Úkeysr   ÚitemsÚto_internal_reprÚ	_contains)r*   Ú
param_nameÚparam_valueÚdistributionÚparam_value_in_internal_reprs        r2   Ú	_validatezFrozenTrial._validate6  sð  € Ø�:‰:œ×+Ñ+Ò+°×0CÑ0CÐ0KÜØ]óð ð �:‰:×!Ñ!Ô#Ø×%Ñ%Ð-Ü Ð!bÓcÐcà×%Ñ%Ð1Ü ØYóð ð �:‰:œŸ™Ò(¨T¯\©\Ð-EÜÐQÐRV×R^ÑR^ÐQ_Ð_`ÐaÓbÐbØ�:‰:œ×,Ñ,Ò,Ø�|‰|Ð#Ü Ð!MÓNÐNÜÑ9¨D¯L©LÔ9Ô9Ü Ð!AÓBÐBäˆt�{‰{×ÑÓ!Ó"¤c¨$×*<Ñ*<×*AÑ*AÓ*CÓ&DÒDÜØ*¬3¨t¯{©{×/?Ñ/?Ó/AÓ+BÐ*Cð D!Ü!$ T×%7Ñ%7×%<Ñ%<Ó%>Ó!?Ð @ÀðCóð ð
 (,§{¡{×'8Ñ'8Ó':ò 	Ñ#ˆJ˜Ø×-Ñ-¨jÑ9ˆLà+7×+HÑ+HÈÓ+UÐ(Ø×)Ñ)Ð*FÕGÜ Ø   ¨_¸Z¸Lð I(Ø(4 ~°Qð8óð ñ	r4   c           	     óL  — || j                   vrt        d|› d�«      ‚| j                   |   }|j                  |«      }|j                  |«      st	        d|› d|› d|› d�«       || j
                  v r#t        j                  | j
                  |   |«       || j
                  |<   |S )NzThe value of the parameter 'zL' is not found. Please set it at the construction of the FrozenTrial object.r—   z of the parameter 'z*' is out of the range of the distribution r’   )r$   r    r    r¡   r   r(   r   Ú check_distribution_compatibility)r*   rb   r¤   r,   r¥   s        r2   r`   zFrozenTrial._suggest]  sÇ   € Ø�t—|‘|Ñ#ÜØ.¨t¨fð 5Oð Póð ð
 —‘˜TÑ"ˆØ'3×'DÑ'DÀUÓ'KÐ$Ø×%Ñ%Ð&BÔCÜØ˜U˜GÐ#6°t°fð =1Ø1=°¸aðAôð
 �4×&Ñ&Ñ&Ü×:Ñ:¸4×;NÑ;NÈtÑ;TÐVbÔcà$0ˆ×Ñ˜DÑ!àˆr4   c                ó   — | j                   S r6   ©r   rK   s    r2   r+   zFrozenTrial.numbers  ó   € à�|‰|Ðr4   c                ó   — || _         y r6   rª   ©r*   r,   s     r2   r+   zFrozenTrial.numberw  s	   € àˆ�r4   c                ó€   — | j                   �2t        | j                   «      dkD  rt        d«      ‚| j                   d   S y )NrP   úDThis attribute is not available during multi-objective optimization.r   ©r   ÚlenÚRuntimeErrorrK   s    r2   r,   zFrozenTrial.value{  s@   € à�<‰<Ð#Ü�4—<‘<Ó  1Ò$Ü"ØZóð ð —<‘< ‘?Ð"Ør4   c                ó†   — | j                   �#t        | j                   «      dkD  rt        d«      ‚|�	|g| _         y d | _         y )NrP   r¯   r°   ©r*   Úvs     r2   r,   zFrozenTrial.value…  sD   € à�<‰<Ð#Ü�4—<‘<Ó  1Ò$Ü"ØZóð ð ˆ=Ø˜3ˆD�LàˆD�Lr4   c                ó   — | j                   S r6   )r   rK   s    r2   Ú_get_valueszFrozenTrial._get_values•  s   € Ø�|‰|Ðr4   c                ó8   — |�t        |«      | _        y d | _        y r6   )r!   r   r´   s     r2   Ú_set_valueszFrozenTrial._set_values˜  s   € Øˆ=Ü ›7ˆD�LàˆD�Lr4   c                ó   — | j                   S r6   ©r"   rK   s    r2   r-   zFrozenTrial.datetime_start   s   € à×#Ñ#Ð#r4   c                ó   — || _         y r6   r»   r­   s     r2   r-   zFrozenTrial.datetime_start¤  s
   € à$ˆÕr4   c                ó   — | j                   S r6   ©r$   rK   s    r2   r.   zFrozenTrial.params¨  r«   r4   c                ó   — || _         y r6   r¾   )r*   r.   s     r2   r.   zFrozenTrial.params¬  s	   € àˆ�r4   c                ó   — | j                   S r6   ©r(   rK   s    r2   r   zFrozenTrial.distributions°  s   € à×"Ñ"Ð"r4   c                ó   — || _         y r6   rÁ   r­   s     r2   r   zFrozenTrial.distributions´  s
   € à#ˆÕr4   c                ó   — | j                   S r6   rŠ   rK   s    r2   r/   zFrozenTrial.user_attrs¸  s   € à×ÑÐr4   c                ó   — || _         y r6   rŠ   r­   s     r2   r/   zFrozenTrial.user_attrs¼  s
   € à ˆÕr4   c                ó   — | j                   S r6   r�   rK   s    r2   r0   zFrozenTrial.system_attrsÀ  s   € à×!Ñ!Ð!r4   c                ó&   — t        d|«      | _        y )Núdict[str, Any])r   r&   r­   s     r2   r0   zFrozenTrial.system_attrsÄ  s   € ä!Ð"2°EÓ:ˆÕr4   c                óz   — t        | j                  «      dk(  ryt        | j                  j                  «       «      S )zŽReturn the maximum step of :attr:`intermediate_values` in the trial.

        Returns:
            The maximum step of intermediates.
        r   N)r±   r'   Úmaxrž   rK   s    r2   Ú	last_stepzFrozenTrial.last_stepÈ  s4   € ô ˆt×'Ñ'Ó(¨AÒ-Øä�t×/Ñ/×4Ñ4Ó6Ó7Ð7r4   c                óf   — | j                   r%| j                  r| j                  | j                   z
  S y)ziReturn the elapsed time taken to complete the trial.

        Returns:
            The duration.
        N)r-   r#   rK   s    r2   ÚdurationzFrozenTrial.durationÕ  s/   € ð ×Ò 4×#9Ò#9Ø×)Ñ)¨D×,?Ñ,?Ñ?Ð?àr4   )r+   rv   r   r   r,   úfloat | Noner-   údatetime.datetime | Noner#   rÎ   r.   rÇ   r   údict[str, BaseDistribution]r/   rÇ   r0   rÇ   r'   zdict[int, float]r1   rv   r   úSequence[float] | NoneÚreturnÚNone)r;   r   rÑ   Úbool)rÑ   rv   )rÑ   Ústr)rb   rÔ   rc   Úfloatrd   rÕ   r\   rÍ   r]   rÓ   rÑ   rÕ   )rb   rÔ   rc   rÕ   rd   rÕ   rÑ   rÕ   )
rb   rÔ   rc   rÕ   rd   rÕ   rp   rÕ   rÑ   rÕ   )rb   rÔ   rc   rv   rd   rv   r\   rv   r]   rÓ   rÑ   rv   )rb   rÔ   r{   zSequence[None]rÑ   rÒ   )rb   rÔ   r{   zSequence[bool]rÑ   rÓ   )rb   rÔ   r{   zSequence[int]rÑ   rv   )rb   rÔ   r{   zSequence[float]rÑ   rÕ   )rb   rÔ   r{   zSequence[str]rÑ   rÔ   )rb   rÔ   r{   zSequence[CategoricalChoiceType]rÑ   r   )r,   rÕ   r\   rv   rÑ   rÒ   )rÑ   rÓ   )rŒ   rÔ   r,   r   rÑ   rÒ   )rÑ   rÒ   )rb   rÔ   r¤   r   rÑ   r   )r,   rv   rÑ   rÒ   )rÑ   rÍ   )rµ   rÍ   rÑ   rÒ   )rÑ   zlist[float] | None)rµ   rÐ   rÑ   rÒ   )rÑ   rÎ   )r,   rÎ   rÑ   rÒ   )rÑ   rÇ   )r.   rÇ   rÑ   rÒ   )rÑ   rÏ   )r,   rÏ   rÑ   rÒ   )r,   rÇ   rÑ   rÒ   )r,   zMapping[str, JSONSerializable]rÑ   rÒ   )rÑ   z
int | None)rÑ   zdatetime.timedelta | None)*rW   Ú
__module__Ú__qualname__Ú__doc__r3   r<   r?   rA   rL   r[   re   r   Ú_suggest_deprecated_msgÚformatrl   rn   rq   r
   r   rw   r   r|   r†   rˆ   r�   r�   r¦   r`   Úpropertyr+   Úsetterr,   r·   r¹   r   r-   r.   r   r/   r0   rÊ   rÌ   ry   r4   r2   r   r   %   s)  „ ñiðr *.ñ "àð "ð ð "ð ð	 "ð
 1ð "ð 4ð "ð ð "ð 3ð "ð #ð "ð %ð "ð .ð "ð ð "ð 'ð "ð 
ó "óD/ó
*ó+óLó	"ð" "Øñ	Uàð	Uð ð	Uð ð		Uð ð	Uð ð	Uð 
ó	Uñ �W˜gÐ,C×,JÑ,JÐPRÐ,JÓ,SÔTò3ó Uð3ñ �W˜gÐ,C×,JÑ,JÐPaÐ,JÓ,bÔcò=ó dð=ñ �W˜gÐ,C×,JÑ,JÐPaÐ,JÓ,bÔcò;ó dð;ñ Ø&BØ"Øôð >?ÈEñXØðXØ!ðXØ),ðXØ7:ðXØEIðXà	òXóð
Xð
 ÚRó ØRàÚRó ØRàÚPó ØPàÚTó ØTàÚPó ØPàð$Øð$Ø"Að$à	ò$ó ð$ðMØðMØ"AðMà	óMó
ó*ó&ñ �W˜gÓ&ò(ó 'ð(ó%óNð, òó ðð ‡]�]òó ðð òó ðð ‡\�\ò
 ó ð
 óó ñ �k ;Ó/€Fàò$ó ð$ð ×Ñò%ó ð%ð òó ðð ‡]�]òó ðð ò#ó ð#ð ×Ñò$ó ð$ð ò ó ð ð ×Ñò!ó ð!ð ò"ó ð"ð ×Ñò;ó ð;ð ò
8ó ð
8ð ò
ó ñ
r4   r   )r   r,   r   r.   r   r/   r0   r'   c                óˆ  — |xs i }|xs i } |j                   «       D ��	ci c]  \  }}	|t        |	«      “Œ }}}	|xs i }|xs i }|xs i }| t        j                  k(  rd}
nt        j                  j                  «       }
| j                  «       r|
}nd}t        dd| |||
||||||¬«      }|j                  «        |S c c}	}w )aæ  Create a new :class:`~optuna.trial.FrozenTrial`.

    Example:

        .. testcode::

            import optuna
            from optuna.distributions import CategoricalDistribution
            from optuna.distributions import FloatDistribution

            trial = optuna.trial.create_trial(
                params={"x": 1.0, "y": 0},
                distributions={
                    "x": FloatDistribution(0, 10),
                    "y": CategoricalDistribution([-1, 0, 1]),
                },
                value=5.0,
            )

            assert isinstance(trial, optuna.trial.FrozenTrial)
            assert trial.value == 5.0
            assert trial.params == {"x": 1.0, "y": 0}

    .. seealso::

        See :func:`~optuna.study.Study.add_trial` for how this function can be used to create a
        study from existing trials.

    .. note::

        Please note that this is a low-level API. In general, trials that are passed to objective
        functions are created inside :func:`~optuna.study.Study.optimize`.

    .. note::
        When ``state`` is :class:`TrialState.COMPLETE`, the following parameters are
        required:

        * ``params``
        * ``distributions``
        * ``value`` or ``values``

    Args:
        state:
            Trial state.
        value:
            Trial objective value. Must be specified if ``state`` is :class:`TrialState.COMPLETE`.
            ``value`` and ``values`` must not be specified at the same time.
        values:
            Sequence of the trial objective values. The length is greater than 1 if the problem is
            multi-objective optimization.
            Must be specified if ``state`` is :class:`TrialState.COMPLETE`.
            ``value`` and ``values`` must not be specified at the same time.
        params:
            Dictionary with suggested parameters of the trial.
        distributions:
            Dictionary with parameter distributions of the trial.
        user_attrs:
            Dictionary with user attributes.
        system_attrs:
            Dictionary with system attributes. Should not have to be used for most users.
        intermediate_values:
            Dictionary with intermediate objective values of the trial.

    Returns:
        Created trial.
    Néÿÿÿÿ)r+   r1   r   r,   r   r-   r#   r.   r   r/   r0   r'   )	rŸ   r   r   r˜   ÚdatetimeÚnowr™   r   r¦   )r   r,   r   r.   r   r/   r0   r'   rŒ   Údistr-   r#   Útrials                r2   Úcreate_trialrã   ã  sö   € ð\ Š\�r€FØ!Ò' R€Mð -˜×,Ñ,Ó.÷áˆC�ð 	Ô:¸4Ó@Ñ@ð€Mñ ð Ò!˜r€JØÒ% 2€LØ-Ò3°Ðà”
×"Ñ"Ò"Ø‰ä!×*Ñ*×.Ñ.Ó0ˆà×ÑÔØ6DÑà ÐäØØØØØØ%Ø+ØØ#ØØ!Ø/ô€Eð 
‡O�OÔà€LùóGs   ¡B>)r   r   r,   rÍ   r   rÐ   r.   údict[str, Any] | Noner   z"dict[str, BaseDistribution] | Noner/   rä   r0   rä   r'   zdict[int, float] | NonerÑ   r   )*Ú
__future__r   rß   r”   Útypingr   r   r   r   Úoptunar   r	   Úoptuna._convert_positional_argsr
   Úoptuna._deprecatedr   Úoptuna._warningsr   Úoptuna.distributionsr   r   r   r   Úoptuna.trial._baser   r   Úoptuna.trial._stater   Úcollections.abcr   r   Úoptuna._typingr   r   r   Ú
get_loggerrW   Ú_loggerrÙ   r   r›   rã   ry   r4   r2   ú<module>rò      s  ðÝ "ã Û Ý Ý Ý Ý  å  Ý Ý CÝ .Ý (Ý NÝ 8Ý 2Ý 0Ý ;Ý (Ý *ñ Ý'Ý(å/Ý5Ý:ð ˆ'×
Ñ
˜XÓ
&€Ø<Ð ô{�)ô {ð@ #×+Ñ+ØØ%)Ø$(Ø8<Ø(,Ø*.Ø37ñsàðsð ðsð #ð	sð
 "ðsð 6ðsð &ðsð (ðsð 1ðsð ôsr4   