Skip to content

bernoulli

Syntax

bernoulli(p)

Parameters

p
a probability value between 0 and 1.0.

Returns

Returns 1 with probability p; 0 otherwise.

Description

Returns the result of a bernoulli trial with probability of success p.

Examples

~30% of agents can be sent to state Selection with the following:

if(bernoulli(0.3)==1) then next(Selection)

See Also