# Path: creamas/math.py
# def gaus_pdf(x, mean, std):
#     """Gaussian distribution's probability density function.
# 
#     See, e.g. `Wikipedia page for normal distribution <https://en.wikipedia.org/wiki/Normal_distribution>`_.
# 
#     :param x: point in x-axis
#     :type x: float or numpy.ndarray
#     :param float mean: mean or expectation
#     :param float str: standard deviation
#     :returns: pdf(s) in point **x**
#     :rtype: float or numpy.ndarray
#     """
#     return exp(-((x - mean) / std)**2 / 2) / sqrt(2 * pi) / std
# 
# def logistic(x, x0, k, L):
#     """Logistic function.
# 
#     See, e.g `Wikipedia page for logistic function <https://en.wikipedia.org/wiki/Logistic_function>`_.
# 
#     :param x: point in x-axis
#     :type x: float or numpy.ndarray
#     :param float x0: sigmoid's midpoint
#     :param float k: steepness of the curve
#     :param float L: maximum value of the curve
#     :returns: function's value(s) in point **x**
#     :rtype: float or numpy.ndarray
#     """
#     return L / (1 + exp(-k * (x - x0)))
# 
# Path: creamas/rules/mapper.py
# class Mapper():
#     """Base implementation of mapper, serves as identity function for ``int``
#     and ``float`` types.
# 
#     Mappers, as rules and features, are callable after initialization.
#     """
# 
#     def __init__(self):
#         self._value_set = {int, float}
# 
#     @property
#     def value_set(self):
#         """Acceptable input types for the mapper."""
#         return self._value_set
# 
#     def __call__(self, value):
#         """Calling mapper object will first check that the given value is in
#         accepted :attr:`value_set` and then calls :py:meth:`map`.
# 
#         :returns: Value mapped to the interval [-1, 1]
#         :raises TypeError: if value's type is not in :attr:`value_set`
#         """
#         if type(value) not in self._value_set:
#             raise TypeError('Value should be one of the accepted types ({}), '
#                             'now got {}.'.format(self._value_set, type(value)))
# 
#         return self.map(value)
# 
#     def map(self, value):
#         """Map given value to the interval [-1, 1].
# 
#         This base implementation maps each value to itself, capping to [-1, 1].
# 
#         :param value: Value to map
#         :returns: Value mapped to the interval [-1, 1]
#         :rtype float:
#         """
#         if value > 1.0:
#             return 1.0
#         if value < -1.0:
#             return -1.0
#         return float(value)


from creamas.math import gaus_pdf, logistic
from creamas.rules.mapper import Mapper
    def __str__(self):
        return "{}({})".format(self.__class__.__name__, self._mode)

    @property
    def mode(self):
        """Mode of the mapper."""
        return self._mode

    @mode.setter
    def mode(self, value):
        if value not in self.modes:
            raise ValueError('Value ({}) not found from modes.'.format(value))
        self._mode = value

    def map(self, value):
        return self._mode_maps[self._mode](value)

    def _map10(self, value):
        return 1.0 if value else 0.0

    def _map01(self, value):
        return 0.0 if value else 1.0

    def _map1_1(self, value):
        return 1.0 if value else -1.0

    def _map_11(self, value):
        return -1.0 if value else 1.0



# Path: creamas/math.py
# def gaus_pdf(x, mean, std):
#     """Gaussian distribution's probability density function.
# 
#     See, e.g. `Wikipedia page for normal distribution <https://en.wikipedia.org/wiki/Normal_distribution>`_.
# 
#     :param x: point in x-axis
#     :type x: float or numpy.ndarray
#     :param float mean: mean or expectation
#     :param float str: standard deviation
#     :returns: pdf(s) in point **x**
#     :rtype: float or numpy.ndarray
#     """
#     return exp(-((x - mean) / std)**2 / 2) / sqrt(2 * pi) / std
# 
# def logistic(x, x0, k, L):
#     """Logistic function.
# 
#     See, e.g `Wikipedia page for logistic function <https://en.wikipedia.org/wiki/Logistic_function>`_.
# 
#     :param x: point in x-axis
#     :type x: float or numpy.ndarray
#     :param float x0: sigmoid's midpoint
#     :param float k: steepness of the curve
#     :param float L: maximum value of the curve
#     :returns: function's value(s) in point **x**
#     :rtype: float or numpy.ndarray
#     """
#     return L / (1 + exp(-k * (x - x0)))
# 
# Path: creamas/rules/mapper.py
# class Mapper():
#     """Base implementation of mapper, serves as identity function for ``int``
#     and ``float`` types.
# 
#     Mappers, as rules and features, are callable after initialization.
#     """
# 
#     def __init__(self):
#         self._value_set = {int, float}
# 
#     @property
#     def value_set(self):
#         """Acceptable input types for the mapper."""
#         return self._value_set
# 
#     def __call__(self, value):
#         """Calling mapper object will first check that the given value is in
#         accepted :attr:`value_set` and then calls :py:meth:`map`.
# 
#         :returns: Value mapped to the interval [-1, 1]
#         :raises TypeError: if value's type is not in :attr:`value_set`
#         """
#         if type(value) not in self._value_set:
#             raise TypeError('Value should be one of the accepted types ({}), '
#                             'now got {}.'.format(self._value_set, type(value)))
# 
#         return self.map(value)
# 
#     def map(self, value):
#         """Map given value to the interval [-1, 1].
# 
#         This base implementation maps each value to itself, capping to [-1, 1].
# 
#         :param value: Value to map
#         :returns: Value mapped to the interval [-1, 1]
#         :rtype float:
#         """
#         if value > 1.0:
#             return 1.0
#         if value < -1.0:
#             return -1.0
#         return float(value)


# Path: creamas/mappers.py
from creamas.math import gaus_pdf, logistic
from creamas.rules.mapper import Mapper

    def __str__(self):
        return "{}({})".format(self.__class__.__name__, self._mode)

    @property
    def mode(self):
        """Mode of the mapper."""
        return self._mode

    @mode.setter
    def mode(self, value):
        if value not in self.modes:
            raise ValueError('Value ({}) not found from modes.'.format(value))
        self._mode = value

    def map(self, value):
        return self._mode_maps[self._mode](value)

    def _map10(self, value):
        return 1.0 if value else 0.0

    def _map01(self, value):
        return 0.0 if value else 1.0

    def _map1_1(self, value):
        return 1.0 if value else -1.0

    def _map_11(self, value):
        return -1.0 if value else 1.0



class LinearMapper(Mapper):