Python random.paretovariate() Examples

The following are code examples for showing how to use random.paretovariate(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: HyperStream   Author: IRC-SPHERE   File: 2017-06-20_v1.0.0.py    MIT License 5 votes vote down vote up
def _execute(self, sources, alignment_stream, interval):
        if alignment_stream is None:
            raise ToolExecutionError("Alignment stream expected")

        for ti, _ in alignment_stream.window(interval, force_calculation=True):
            yield StreamInstance(ti, random.paretovariate(alpha=self.alpha)) 
Example 2
Project: HackZurich   Author: RefugeeMatchmaking   File: random_sequence.py    MIT License 5 votes vote down vote up
def pareto_sequence(n,exponent=1.0):
    """
    Return sample sequence of length n from a Pareto distribution.
    """
    return [random.paretovariate(exponent) for i in range(n)] 
Example 3
Project: HackZurich   Author: RefugeeMatchmaking   File: random_sequence.py    MIT License 5 votes vote down vote up
def powerlaw_sequence(n,exponent=2.0):
    """
    Return sample sequence of length n from a power law distribution.
    """
    return [random.paretovariate(exponent-1) for i in range(n)] 
Example 4
Project: vwoptimize   Author: denik   File: random_sequence.py    MIT License 5 votes vote down vote up
def pareto_sequence(n,exponent=1.0):
    """
    Return sample sequence of length n from a Pareto distribution.
    """
    return [random.paretovariate(exponent) for i in range(n)] 
Example 5
Project: vwoptimize   Author: denik   File: random_sequence.py    MIT License 5 votes vote down vote up
def powerlaw_sequence(n,exponent=2.0):
    """
    Return sample sequence of length n from a power law distribution.
    """
    return [random.paretovariate(exponent-1) for i in range(n)] 
Example 6
Project: shellcraft   Author: maebert   File: automata.py    MIT License 5 votes vote down vote up
def _resource_pr(self, resource, x, y, distance, deposit):
        seed("{}.{}".format(x, y))
        if resource == "clay":
            v = paretovariate(2) / (distance + 1)
            return v if v > 0.2 else 0
        if resource == "elevation":
            return paretovariate(4) / (distance + 1)
        if resource == "ore":
            dx, dy, dr = deposit
            angle = math.atan2(dy - y, dx - x) % math.pi
            diff = 0.5 / (angle - dr + 0.5)
            v = paretovariate(2) / (distance + 1) * diff
            return v if v > 0.4 else 0 
Example 7
Project: graph-partition   Author: valiantljk   File: random_sequence.py    GNU General Public License v2.0 5 votes vote down vote up
def pareto_sequence(n,exponent=1.0):
    """
    Return sample sequence of length n from a Pareto distribution.
    """
    return [random.paretovariate(exponent) for i in range(n)] 
Example 8
Project: graph-partition   Author: valiantljk   File: random_sequence.py    GNU General Public License v2.0 5 votes vote down vote up
def powerlaw_sequence(n,exponent=2.0):
    """
    Return sample sequence of length n from a power law distribution.
    """
    return [random.paretovariate(exponent-1) for i in range(n)] 
Example 9
Project: Python-iBeacon-Scan   Author: NikNitro   File: crv_types.py    GNU General Public License v3.0 5 votes vote down vote up
def sample(self):
        return random.paretovariate(self.alpha) 
Example 10
Project: morpheo-plugin   Author: MorphoCity   File: random_sequence.py    GNU General Public License v3.0 5 votes vote down vote up
def powerlaw_sequence(n, exponent=2.0):
    """
    Return sample sequence of length n from a power law distribution.
    """
    return [random.paretovariate(exponent - 1) for i in range(n)] 
Example 11
Project: uv-align-distribute   Author: c30ra   File: random_sequence.py    GNU General Public License v3.0 5 votes vote down vote up
def pareto_sequence(n,exponent=1.0):
    """
    Return sample sequence of length n from a Pareto distribution.
    """
    return [random.paretovariate(exponent) for i in range(n)] 
Example 12
Project: uv-align-distribute   Author: c30ra   File: random_sequence.py    GNU General Public License v3.0 5 votes vote down vote up
def powerlaw_sequence(n,exponent=2.0):
    """
    Return sample sequence of length n from a power law distribution.
    """
    return [random.paretovariate(exponent-1) for i in range(n)] 
Example 13
Project: honours_project   Author: JFriel   File: random_sequence.py    GNU General Public License v3.0 5 votes vote down vote up
def pareto_sequence(n,exponent=1.0):
    """
    Return sample sequence of length n from a Pareto distribution.
    """
    return [random.paretovariate(exponent) for i in range(n)] 
Example 14
Project: honours_project   Author: JFriel   File: random_sequence.py    GNU General Public License v3.0 5 votes vote down vote up
def powerlaw_sequence(n,exponent=2.0):
    """
    Return sample sequence of length n from a power law distribution.
    """
    return [random.paretovariate(exponent-1) for i in range(n)] 
Example 15
Project: honours_project   Author: JFriel   File: random_sequence.py    GNU General Public License v3.0 5 votes vote down vote up
def pareto_sequence(n,exponent=1.0):
    """
    Return sample sequence of length n from a Pareto distribution.
    """
    return [random.paretovariate(exponent) for i in range(n)] 
Example 16
Project: honours_project   Author: JFriel   File: random_sequence.py    GNU General Public License v3.0 5 votes vote down vote up
def powerlaw_sequence(n,exponent=2.0):
    """
    Return sample sequence of length n from a power law distribution.
    """
    return [random.paretovariate(exponent-1) for i in range(n)] 
Example 17
Project: DiffQue   Author: DiffQueDifficultyEsti   File: random_sequence.py    MIT License 5 votes vote down vote up
def powerlaw_sequence(n, exponent=2.0):
    """
    Return sample sequence of length n from a power law distribution.
    """
    return [random.paretovariate(exponent - 1) for i in range(n)] 
Example 18
Project: aop-helpFinder   Author: jecarvaill   File: random_sequence.py    GNU General Public License v3.0 5 votes vote down vote up
def powerlaw_sequence(n, exponent=2.0):
    """
    Return sample sequence of length n from a power law distribution.
    """
    return [random.paretovariate(exponent - 1) for i in range(n)] 
Example 19
Project: voteswap   Author: sbuss   File: random_sequence.py    MIT License 5 votes vote down vote up
def pareto_sequence(n,exponent=1.0):
    """
    Return sample sequence of length n from a Pareto distribution.
    """
    return [random.paretovariate(exponent) for i in range(n)] 
Example 20
Project: voteswap   Author: sbuss   File: random_sequence.py    MIT License 5 votes vote down vote up
def powerlaw_sequence(n,exponent=2.0):
    """
    Return sample sequence of length n from a power law distribution.
    """
    return [random.paretovariate(exponent-1) for i in range(n)]