(self, low=0.0, high=1.0, mode=None)
return low + (high - low) * (u * c) ** 0.5
Triangular distribution.

        Continuous distribution bounded by given lower and upper limits,
        and having a given mode value in-between.

        http://en.wikipedia.org/wiki/Triangular_distribution
Triangular distribution.
Triangular distribution .
def triangular(self, low=0.0, high=1.0, mode=None):
        """Triangular distribution.

        Continuous distribution bounded by given lower and upper limits,
        and having a given mode value in-between.

        http://en.wikipedia.org/wiki/Triangular_distribution

        """
        u = self.random()
        c = 0.5 if mode is None else (mode - low) / (high - low)
        if u > c:
            u = 1.0 - u
            c = 1.0 - c
            low, high = high, low
        return low + (high - low) * (u * c) ** 0.5
def triangular ( self , low = 0.0 , high = 1.0 , mode = None ) : u = self . random ( ) c = 0.5 if mode is None else ( mode - low ) / ( high - low ) if u > c : u = 1.0 - u c = 1.0 - c low , high = high , low return low + ( high - low ) * ( u * c ) ** 0.5