Package topo :: Package pattern :: Module random :: Class BinaryUniformRandom
[hide private]
[frames] | no frames]

Class BinaryUniformRandom

source code


2D binary uniform random noise pattern generator.

Generates an array of random numbers that are 1.0 with the given on_probability, or else 0.0, then scales it and adds the offset as for other patterns. For the default scale and offset, the result is a binary mask where some elements are on at random.

Nested Classes [hide private]

Inherited from param.parameterized.Parameterized: __metaclass__

Instance Methods [hide private]
 
_distrib(self, shape, p)
Method for subclasses to override with a particular random distribution.
source code

Inherited from RandomGenerator: __call__

Inherited from base.patterngenerator.PatternGenerator: function

Inherited from param.parameterized.Parameterized: __getstate__, __init__, __repr__, __setstate__, __str__, debug, defaults, force_new_dynamic_value, get_param_values, get_value_generator, inspect_value, message, print_param_values, script_repr, set_default, set_dynamic_time_fn, set_param, state_pop, state_push, verbose, warning

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]

Inherited from param.parameterized.Parameterized: params, print_param_defaults

Class Variables [hide private]
  on_probability = param.Number(default= 0.5, bounds= [0.0, 1.0]...
Probability (in the range 0.0 to 1.0) that the binary value (before scaling) is on rather than off (1.0 rather than 0.0).
  name = <param.parameterized.String object at 0xb589c2c>
String identifier for this object.

Inherited from RandomGenerator: orientation, random_generator

Inherited from base.patterngenerator.PatternGenerator: bounds, mask, mask_shape, offset, output_fns, position, scale, size, x, xdensity, y, ydensity

Inherited from param.parameterized.Parameterized: print_level

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_distrib(self, shape, p)

source code 
Method for subclasses to override with a particular random distribution.
Overrides: RandomGenerator._distrib
(inherited documentation)

Class Variable Details [hide private]

on_probability

Probability (in the range 0.0 to 1.0) that the binary value (before scaling) is on rather than off (1.0 rather than 0.0).
Value:
param.Number(default= 0.5, bounds= [0.0, 1.0], doc= """
        Probability (in the range 0.0 to 1.0) that the binary value
        (before scaling) is on rather than off (1.0 rather than 0.0).""")