
    sg	                     F    d dl mZ d dlmZ d dlmZmZmZ  G d de      Zy)    )Basic)ProductPSpace)ProductDomain_symbol_converterDistributionc                   h    e Zd ZdZd
dZed        Zed        Zed        Zed        Z	ddZ
dd	Zy)StochasticPSpacea  
    Represents probability space of stochastic processes
    and their random variables. Contains mechanics to do
    computations for queries of stochastic processes.

    Explanation
    ===========

    Initialized by symbol, the specific process and
    distribution(optional) if the random indexed symbols
    of the process follows any specific distribution, like,
    in Bernoulli Process, each random indexed symbol follows
    Bernoulli distribution. For processes with memory, this
    parameter should not be passed.
    Nc                     t        |      }ddlm} t        ||      st	        d      |
t               }t        j                  | |||      S )Nr   )StochasticProcessz3`process` must be an instance of StochasticProcess.)r   $sympy.stats.stochastic_process_typesr   
isinstance	TypeErrorr   r   __new__)clssymprocessdistributionr   s        Q/var/www/html/venv/lib/python3.12/site-packages/sympy/stats/stochastic_process.pyr   zStochasticPSpace.__new__   sH    $J'#45QRR'>L}}S#w==    c                      | j                   d   S )z4
        The associated stochastic process.
           argsselfs    r   r   zStochasticPSpace.process    s    
 yy|r   c                 j    t        | j                  j                  | j                  j                        S N)r   r   	index_setstate_spacer   s    r   domainzStochasticPSpace.domain'   s(    T\\33!\\557 	7r   c                      | j                   d   S )Nr   r   r   s    r   symbolzStochasticPSpace.symbol,       yy|r   c                      | j                   d   S )N   r   r   s    r   r   zStochasticPSpace.distribution0   r#   r   c                 @     | j                   j                  |||fi |S z
        Transfers the task of handling queries to the specific stochastic
        process because every process has their own logic of handling such
        queries.
        )r   probability)r   	conditiongiven_conditionevaluatekwargss        r   r(   zStochasticPSpace.probability4   s%     (t||''	?HWPVWWr   c                 @     | j                   j                  |||fi |S r'   )r   expectation)r   exprr)   r+   r,   s        r   compute_expectationz$StochasticPSpace.compute_expectation<   s$     (t||''iLVLLr   r   )NT)__name__
__module____qualname____doc__r   propertyr   r    r"   r   r(   r0    r   r   r	   r	      sh     >   7 7    XMr   r	   N)	sympy.core.basicr   sympy.stats.joint_rvr   sympy.stats.rvr   r   r   r	   r6   r   r   <module>r:      s    " . I I<M} <Mr   