Randomizer

class mpf.core.randomizer.Randomizer(items, machine=None, template_type=None)

Bases: object

Generic list randomizer.

Methods & Attributes

The Randomizer has the following methods & attributes available. Note that methods & attributes inherited from the base class are not included here.

static generate_template(machine, template_type, value)

Convert a string with conditions into a conditional event template object.

get_current()

Return current item.

get_next(conditional_args=None)

Return next item.

loop

Return loop property.

static pick_weighted_random(items)

Pick a random item.

Parameters:items – Items to select from