o
    }o™ib  ã                   @  sv   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r2d dlmZ G d	d
„ d
ƒZdS )é    )Úannotations)ÚCallable)ÚSequence)ÚTYPE_CHECKING)Ú _process_constraints_after_trial)ÚFrozenTrial)Ú
TrialState)ÚStudyc                   @  s*   e Zd Zddœddd„Z	dddd„ZdS )ÚNSGAIIAfterTrialStrategyN)Úconstraints_funcr   ú/Callable[[FrozenTrial], Sequence[float]] | NoneÚreturnÚNonec                C  s
   || _ d S ©N)Ú_constraints_func)Úselfr   © r   ú`/home/ubuntu/.local/lib/python3.10/site-packages/optuna/samplers/nsgaii/_after_trial_strategy.pyÚ__init__   s   
z!NSGAIIAfterTrialStrategy.__init__Ústudyr	   Útrialr   Ústater   ÚvaluesúSequence[float] | Nonec                 C  s"   | j durt| j |||ƒ dS dS )züCarry out the after trial process of default NSGA-II.

        This method is called after each trial of the study, examines whether the trial result is
        valid in terms of constraints, and store the results in system_attrs of the study.
        N)r   r   )r   r   r   r   r   r   r   r   Ú__call__   s   
ÿz!NSGAIIAfterTrialStrategy.__call__)r   r   r   r   r   )
r   r	   r   r   r   r   r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r
      s
    ÿ
ûr
   N)Ú
__future__r   Úcollections.abcr   r   Útypingr   Úoptuna.samplers._baser   Úoptuna.trialr   r   Úoptuna.studyr	   r
   r   r   r   r   Ú<module>   s    