up Inquisit Language Reference

itemProbabilities attribute

The itemProbabilities attribute specifies the probabilities with which the items in a list should be selected.

Member of

<list>

Syntax

/ itemProbabilities = (value, value, value, ...]

or

/ itemProbabilities = [expression; expression; expression; ...]

or

/ itemProbabilities = distribution

Parameters

Name Type Description
value value Any property or constant that can be converted to a decimal value.
expression expression Any valid expression that evaluates to a decimal value.
distribution distributionenum
ValueDescription
constantSingle value
exponentialExponential distribution
normalGaussian distribution
poissonPoisson distribution
uniformUniform distribution

Remarks

The itemProbabilities attribute is used to build a selection pool in which the specified items occur with the given probabilities. To build the selection pool with the given probabilities, the poolSize attribute must also be specified. Each probability must be a decimal value between 0 and 1, with the sum of all probabilities listed equal to 1. By default, items are selected with uniform probability. That is, items are added to the pool in proportion to their occurrence in the items attribute.

Random selection is done on the fly, so if additional selection constraints such as maxrunsize or replace are in place, it may not be possible to satisfy them all on a give trial, especially if there are only a few remaining items in the selection pool. In that case, the list will suspend one of the constraints and try again. If it still can not satisfy the remaining constraints, it suspends another and tries again, and so forth. By default, the maxRunSize constraint is suspended first, then replace, and finally the not constraints. If a procedure requires that the constraints always be satisfied, pregenerate a set of selection sequences that satisfy the constraints and then randomly select one of the pregenerated sequences to use for a given session.

Examples

The following list randomly creates a selection pool consisting of 25 instances of "A", 25 instances of "B", and 50 instances of "C", and randomly selects from this pool according to a uniform distribution.

<list mylist>
/ items=["A"; "B"; "C";]
/ itemProbabilities=[.25; .25; .5;]
/ poolSize=100
/ selectionMode=random
</list>

Copyright Millisecond Software, LLC. All rights reserved.