| 323 | |
| 324 | |
| 325 | class RandNumExpo(RandNum): |
| 326 | def __init__(self, lambd, base=0): |
| 327 | # type: (float, int) -> None |
| 328 | self.lambd = lambd |
| 329 | self.base = base |
| 330 | |
| 331 | def _command_args(self): |
| 332 | # type: () -> str |
| 333 | ret = "lambd=%r" % self.lambd |
| 334 | if self.base != 0: |
| 335 | ret += ", base=%r" % self.base |
| 336 | return ret |
| 337 | |
| 338 | def _fix(self): |
| 339 | # type: () -> int |
| 340 | return self.base + int(round(random.expovariate(self.lambd))) |
| 341 | |
| 342 | |
| 343 | class RandEnum(RandNum): |