Difference between revisions of "Designer Primitive Operator Guide"
Line 22: | Line 22: | ||
;<kbd>Integer binomial(Integer N, Double prob)<kbd> | ;<kbd>Integer binomial(Integer N, Double prob)<kbd> | ||
:Returns a binomial RN with number of observations <kbd>N</kbd> and probability of success <kbd>prob</kbd>. | :Returns a binomial RN with number of observations <kbd>N</kbd> and probability of success <kbd>prob</kbd>. | ||
;<kbd>Integer[] multinomial(Integer N, Double... probs)<kbd> | |||
:Returns a list containing the results of a multinomial sorting of <kbd>N</kbd> observations, with probabilities given by the list <kbd>probs</kbd>. If the probabilities sum to less than 1, the list of outcomes will be 1 element longer than the number of probabilities to account for the missing slot. | |||
;<kbd>Integer poisson(Double lambda)<kbd> | ;<kbd>Integer poisson(Double lambda)<kbd> | ||
:Returns a Poisson RN with density <kbd>lambda</kbd>. | :Returns a Poisson RN with density <kbd>lambda</kbd>. |
Revision as of 19:27, 19 June 2022
Primop Index
On this page the primops are grouped either as universally applicable, or according to the Components in which they are meaningful. Primops used outside their designated purview will return empty answers (such as 0 or nil).
Each primop in these lists has a short description. Those that require further elaboration contain a link to a section with more information. Use this index to find the primop that you need, and follow the link for greater detail if you need it.
Universal Primops
These primops will return meaningful results when used in any context.
Math Primops
Most mathematical operations use the Java java.lang.Math class. These include Math.abs, Math.sin, Math.cos, Math.pow (for powers), etc. The complete list is contained here.
Designer implements certain primops associated with random number generation (RNG) using an instance of the java.util.Random class. This RNG can be seeded from the platform so that the random sequences obtained from these operators will be fixed. These primops are as follows:
- Double random(), Double random(Number y), Double random(Number x, Number y)
- Returns a random Double selected respectively from [0, 1), [0, y), [x, y).
- Integer irandom(), Integer irandom(Number y), Integer irandom(Number x, Number y)
- Returns a random Integer selected respectively from [0, 1), [0, y), [x, y).
- Double normal(Double mu, Double sigma)
- Returns a Gaussian-distributed RN with mean mu and standard deviation sigma.
- Integer binomial(Integer N, Double prob)
- Returns a binomial RN with number of observations N and probability of success prob.
- Integer[] multinomial(Integer N, Double... probs)
- Returns a list containing the results of a multinomial sorting of N observations, with probabilities given by the list probs. If the probabilities sum to less than 1, the list of outcomes will be 1 element longer than the number of probabilities to account for the missing slot.
- Integer poisson(Double lambda)
- Returns a Poisson RN with density lambda.