python类paretovariate()的实例源码

crv_types.py 文件源码 项目:zippy 作者: securesystemslab 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def sample(self):
        return random.paretovariate(self.alpha)
crv_types.py 文件源码 项目:Python-iBeacon-Scan 作者: NikNitro 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def sample(self):
        return random.paretovariate(self.alpha)
2017-06-20_v1.0.0.py 文件源码 项目:HyperStream 作者: IRC-SPHERE 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
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))
automata.py 文件源码 项目:shellcraft 作者: maebert 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
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 > .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 = .5 / (angle - dr + .5)
            v = paretovariate(2) / (distance + 1) * diff
            return v if v > .4 else 0


问题


面经


文章

微信
公众号

扫码关注公众号