p function
Syntax
bool p(probability)
Parameters
- probability (float)
Probability for true, in [0, 1].
Returns
true or false, depending on probability and the current shape's seedian. if probability < 0, false is returned, and if probability > 1, true is returned.
Description
This function returns true with probability probability, or in other words, it returns false with probability 1 - probability.
Related
Examples
p(0.5) # result = true with probability 0.5 # result = false with probability 0.5 p(0.3) # result = true with probability 0.3 # result = false with probability 0.7 p(1) # result = true p(0) # result = false p(2) # result = true p(-1) # result = false
Copyright ©2008-2023 Esri R&D Center Zurich. All rights reserved.