|
| | low = float(low) |
| | high = float(high) |
Definition at line 57 of file samplers.py.
◆ result
◆ __init__()
| python.samplers.ModUniformSampler.__init__ |
( |
| self, |
|
|
| low, |
|
|
| high ) |
Definition at line 60 of file samplers.py.
60 def __init__(self, low, high):
61 assert(low == abs(low) and high == abs(high))
62 assert(low <= high)
63 self.low = float(low)
64 self.high = float(high)
65
◆ __call__()
| python.samplers.Sampler.__call__ |
( |
| self | ) |
|
|
inherited |
This is the call method that will actually be used (so that normal
functions can also be passed in as samplers).
Definition at line 17 of file samplers.py.
17 def __call__(self):
18 """This is the call method that will actually be used (so that normal
19 functions can also be passed in as samplers)."""
20 return self.shoot()
21
◆ shoot()
| python.samplers.ModUniformSampler.shoot |
( |
| self | ) |
|
Reimplemented from python.samplers.Sampler.
Definition at line 66 of file samplers.py.
66 def shoot(self):
67 val = random.uniform(self.low, self.high)
68 if random.random() > 0.5:
69 val *= -1
70 return val
71
72
◆ high
| python.samplers.ModUniformSampler.high = float(high) |
◆ low
| python.samplers.ModUniformSampler.low = float(low) |
The documentation for this class was generated from the following file: