
    -ji                    p    S SK Jr  S SKrS SKJr  S SKr\(       a  S SKJr   " S S\R                  5      r
g)    )annotationsN)TYPE_CHECKING)Studyc                      \ rS rSrSrSS jr\\R                  S	S j5       5       r	\R                            S
S j5       r
Srg)BaseCrossover   a  Base class for crossovers.

A crossover operation is used by :class:`~optuna.samplers.NSGAIISampler`
to create new parameter combination from parameters of ``n`` parent individuals.

.. note::
    Concrete implementations of this class are expected to only accept parameters
    from numerical distributions. At the moment, only crossover operation for categorical
    parameters (uniform crossover) is built-in into :class:`~optuna.samplers.NSGAIISampler`.
c                .    U R                   R                  $ )N)	__class____name__selfs    b/home/james-whalen/.local/lib/python3.13/site-packages/optuna/samplers/nsgaii/_crossovers/_base.py__str__BaseCrossover.__str__   s    ~~&&&    c                    [         e)z;Number of parent individuals required to perform crossover.NotImplementedErrorr   s    r   	n_parentsBaseCrossover.n_parents   s
    
 "!r   c                    [         e)a  Perform crossover of selected parent individuals.

This method is called in :func:`~optuna.samplers.NSGAIISampler.sample_relative`.

Args:
    parents_params:
        A ``numpy.ndarray`` with dimensions ``num_parents x num_parameters``.
        Represents a parameter space for each parent individual. This space is
        continuous for numerical parameters.
    rng:
        An instance of ``numpy.random.RandomState``.
    study:
        Target study object.
    search_space_bounds:
        A ``numpy.ndarray`` with dimensions ``len_search_space x 2`` representing
        numerical distribution bounds constructed from transformed search space.

Returns:
    A 1-dimensional ``numpy.ndarray`` containing new parameter combination.
r   )r   parents_paramsrngstudysearch_space_boundss        r   	crossoverBaseCrossover.crossover#   s
    : "!r    N)returnstr)r   int)
r   
np.ndarrayr   znp.random.RandomStater   r   r   r"   r   r"   )r   
__module____qualname____firstlineno____doc__r   propertyabcabstractmethodr   r   __static_attributes__r   r   r   r   r      sx    	' "  "
 	""" #" 	"
 (" 
" "r   r   )
__future__r   r(   typingr   numpynpoptuna.studyr   ABCr   r   r   r   <module>r1      s)    " 
    "3"CGG 3"r   