
    -ji                        S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	  \(       a  S SKJ
r
  S SKJr  S SKJr  S S	KJr  S S
KJr   " S S\5      rg)    )annotations)TYPE_CHECKING)_SearchSpaceTransform)BaseSampler)LazyRandomState)Any)distributions)BaseDistribution)Study)FrozenTrialc                  ~    \ rS rSrSrS
SS jjrSS jr      SS jr        SS jr          SS jr	S	r
g)RandomSampler   a  Sampler using random sampling.

This sampler is based on *independent sampling*.
See also :class:`~optuna.samplers.BaseSampler` for more details of 'independent sampling'.

Example:

    .. testcode::

        import optuna
        from optuna.samplers import RandomSampler


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


        study = optuna.create_study(sampler=RandomSampler())
        study.optimize(objective, n_trials=10)

Args:
    seed: Seed for random number generator.
Nc                $    [        U5      U l        g N)r   _rng)selfseeds     Q/home/james-whalen/.local/lib/python3.13/site-packages/optuna/samplers/_random.py__init__RandomSampler.__init__-   s    #D)	    c                L    U R                   R                  R                  5         g r   )r   rngr   )r   s    r   
reseed_rngRandomSampler.reseed_rng0   s    		r   c                    0 $ r    )r   studytrials      r   infer_relative_search_space)RandomSampler.infer_relative_search_space3   	     	r   c                    0 $ r   r   )r   r   r    search_spaces       r   sample_relativeRandomSampler.sample_relative8   r#   r   c                    X40n[        U5      nU R                  R                  R                  UR                  S S 2S4   UR                  S S 2S4   5      nUR                  U5      U   $ )Nr      )r   r   r   uniformboundsuntransform)r   r   r    
param_nameparam_distributionr%   transtrans_paramss           r   sample_independent RandomSampler.sample_independent=   sa     #7%l3yy}},,U\\!Q$-?aQRdAST  .z::r   )r   r   )r   z
int | NonereturnNone)r3   r4   )r   r   r    r   r3   dict[str, BaseDistribution])r   r   r    r   r%   r5   r3   zdict[str, Any])
r   r   r    r   r-   strr.   zdistributions.BaseDistributionr3   r   )__name__
__module____qualname____firstlineno____doc__r   r   r!   r&   r1   __static_attributes__r   r   r   r   r      s    2*#.	$
#.>Y	
;; ; 	;
 ;; 
;r   r   N)
__future__r   typingr   optuna._transformr   optuna.samplersr   "optuna.samplers._lazy_random_stater   r   optunar	   optuna.distributionsr
   optuna.studyr   optuna.trialr   r   r   r   r   <module>rF      s4    "   3 ' > $5"(5;K 5;r   