egttools.distributions.TimingUncertainty

class TimingUncertainty

Bases: pybind11_object

Timing uncertainty distribution container.

This class provides methods to sample the final round of a game. By default, the timing uncertainty follows a geometric distribution.

Parameters:
  • p (float) – Probability that the game ends after the minimum number of rounds.

  • max_rounds (int, optional) – Maximum number of rounds allowed. If 0, no maximum is enforced.

Examples

>>> from egttools.numerical.distributions import TimingUncertainty
>>> tu = TimingUncertainty(0.2, 20)

Methods

calculate_end

Sample the final round, truncated by max_rounds.

calculate_full_end

Sample the final round without truncation.

Attributes

max_rounds

Maximum allowed number of rounds.

p

Probability that the game ends after the minimum number of rounds.

__init__()
__new__(**kwargs)
calculate_end()

Sample the final round, truncated by max_rounds.

The returned round lies in the interval [min_rounds, max_rounds] when max_rounds > 0.

Parameters:
  • min_rounds (int) – Minimum number of rounds.

  • random_generator (object) – Random number generator used internally.

Returns:

Sampled final round.

Return type:

int

calculate_full_end()

Sample the final round without truncation.

The returned round is at least min_rounds.

Parameters:
  • min_rounds (int) – Minimum number of rounds.

  • random_generator (object) – Random number generator used internally.

Returns:

Sampled final round.

Return type:

int

__annotations__ = {}
property max_rounds

Maximum allowed number of rounds. A value of 0 means no maximum.

property p

Probability that the game ends after the minimum number of rounds.