random_events.variable
======================

.. py:module:: random_events.variable


Classes
-------

.. autoapisummary::

   random_events.variable.Variable
   random_events.variable.Continuous
   random_events.variable.Symbolic
   random_events.variable.Integer


Module Contents
---------------

.. py:class:: Variable(name: str, domain: random_events.sigma_algebra.AbstractCompositeSet)

   Bases: :py:obj:`random_events.utils.SubclassJSONSerializer`, :py:obj:`random_events.utils.CPPWrapper`


   Parent class for all random variables.


   .. py:attribute:: name
      :type:  str

      The name of the variable.



   .. py:attribute:: domain
      :type:  random_events.sigma_algebra.AbstractCompositeSet

      The domain of the variable.



   .. py:method:: __lt__(other: typing_extensions.Self) -> bool


   .. py:method:: __hash__() -> int


   .. py:method:: __eq__(other)


   .. py:method:: __str__()


   .. py:method:: __repr__()


   .. py:method:: to_json() -> typing_extensions.Dict[str, typing_extensions.Any]


   .. py:method:: _from_json(data: typing_extensions.Dict[str, typing_extensions.Any]) -> typing_extensions.Self
      :classmethod:


      Create a variable from a json dict.
      This method is called from the from_json method after the correct subclass is determined and should be
      overwritten by the respective subclass.

      :param data: The json dict
      :return: The deserialized object



   .. py:property:: is_numeric
      :abstractmethod:


      :return: Rather, this variable has a numeric domain or not.



   .. py:method:: _from_cpp(cpp_object)
      :classmethod:

      :abstractmethod:


      Create a variable from a C++ object.



   .. py:method:: make_value(value: typing_extensions.Any) -> random_events.sigma_algebra.AbstractCompositeSet
      :abstractmethod:


      Create a value of the domain from an arbitrary value.
      This method tries to parse the value and wrap it in a composite set.

      :param value: The value.
      :return: The value wrapped in a composite set.



.. py:class:: Continuous(name: str, *args, **kwargs)

   Bases: :py:obj:`Variable`


   Class for continuous random variables.

   The domain of a continuous variable is the real line.


   .. py:attribute:: _cpp_object

      The C++ object that this class wraps.



   .. py:property:: is_numeric

      :return: Rather, this variable has a numeric domain or not.



   .. py:method:: _from_cpp(cpp_object)

      Create a variable from a C++ object.



   .. py:method:: make_value(value: typing_extensions.Any) -> random_events.interval.Interval

      Create a value of the domain from an arbitrary value.
      This method tries to parse the value and wrap it in a composite set.

      :param value: The value.
      :return: The value wrapped in a composite set.



.. py:class:: Symbolic(name: typing_extensions.Optional[str], domain: random_events.set.Set)

   Bases: :py:obj:`Variable`


   Class for unordered, finite, discrete random variables.

   The domain of a symbolic variable is a set.


   .. py:attribute:: domain
      :type:  random_events.set.Set

      The domain of the variable.



   .. py:attribute:: _cpp_object

      The C++ object that this class wraps.



   .. py:property:: is_numeric

      :return: Rather, this variable has a numeric domain or not.



   .. py:method:: _from_cpp(cpp_object)

      Create a variable from a C++ object.



   .. py:method:: make_value(value) -> random_events.set.Set

      Create a value of the domain from an arbitrary value.
      This method tries to parse the value and wrap it in a composite set.

      :param value: The value.
      :return: The value wrapped in a composite set.



.. py:class:: Integer(name: str, domain: random_events.sigma_algebra.AbstractCompositeSet = reals())

   Bases: :py:obj:`Variable`


   Class for ordered, discrete random variables.

   The domain of an integer variable is the number line.


   .. py:attribute:: _cpp_object

      The C++ object that this class wraps.



   .. py:property:: is_numeric

      :return: Rather, this variable has a numeric domain or not.



   .. py:method:: _from_cpp(cpp_object)

      Create a variable from a C++ object.



   .. py:method:: make_value(value: typing_extensions.Any) -> random_events.interval.Interval

      Create a value of the domain from an arbitrary value.
      This method tries to parse the value and wrap it in a composite set.

      :param value: The value.
      :return: The value wrapped in a composite set.



