random#

random(network, element, seed=None, num_range=[0, 1])[source]#

Create an array of random numbers of a specified size.

Parameters:
  • network (OpenPNM Network object) – The network object to which this model is associated (i.e. attached). This controls the length of the calculated array(s), and also provides access to other necessary properties.

  • seed (int) – The starting seed value to sent to numpy’s random number generator. A value of None means a different distribution is returned each time the model is (re)run.

  • num_range (list) – A two element list indicating the low and high end of the returned numbers. The default is [0, 1], but a value of [0.1, 0.9] may be useful if these values are to be used in subsequent distributions to prevent generating extreme values in the tails.