コード例 #1
0
ファイル: test_srds.py プロジェクト: thrau/srds
    def test_sampling(self):
        # FIXME: bogotest, extend tests!
        dist = PDist.lognorm(0.25)
        sampler = BoundRejectionSampler(dist, 0.5, 2)

        x = sampler.sample(10000)
        self.assertGreater(x.min(), 0.5)
        self.assertLess(x.max(), 2)
コード例 #2
0
 def __init__(self, execution_times: Dict[Tuple[str, str],
                                          Tuple[float, float, PDist]]):
     self.execution_times = execution_times
     self.execution_time_samplers = {
         k: BoundRejectionSampler(BufferedSampler(dist), xmin, xmax)
         for k, (xmin, xmax, dist) in execution_times.items()
     }
コード例 #3
0
ファイル: oracle.py プロジェクト: keniack/faas-sim
 def __init__(self) -> None:
     super().__init__()
     self.execution_time_samplers = {
         k: BoundRejectionSampler(BufferedSampler(dist), xmin, xmax)
         for k, (xmin, xmax, dist) in execution_time_distributions.items()
     }