simulation::random(3tcl)

๐Ÿ“ฆ
version 2.0 ยท 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– simulation::random โ€” the pseudo-random number generator glow-up ๐Ÿ’–

okay bestie, sit down, hydrate, because this is the manual page for simulation::random, a Tcl Simulation Tools situation, and it is genuinely iconic. no cap.


โœจ NAME โœจ

simulation::random โ€” pseudo-random number generators. yes that's the whole name. short, sweet, main character energy. ๐ŸŽ€


๐ŸŒˆ SYNOPSIS ๐ŸŒˆ

package require Tcl ?8.5 9?

package require simulation::random 0.4

::simulation::random::prng_Bernoulli p

::simulation::random::prng_Discrete n

::simulation::random::prng_Poisson lambda

::simulation::random::prng_Uniform min max

::simulation::random::prng_Triangular min max

::simulation::random::prng_SymmTriangular min max

::simulation::random::prng_Exponential min mean

::simulation::random::prng_Normal mean stdev

::simulation::random::prng_Pareto min steep

::simulation::random::prng_Gumbel min f

::simulation::random::prng_chiSquared df

::simulation::random::prng_Disk rad

::simulation::random::prng_Sphere rad

::simulation::random::prng_Ball rad

::simulation::random::prng_Rectangle length width

::simulation::random::prng_Block length width depth

like. look at that list. seventeen little baddies and every single one of them is a factory. we love to see it. ๐Ÿซถ


๐Ÿ’… DESCRIPTION ๐Ÿ’…

so this package is a whole collection of commands that generate pseudo-random number generators. like, generators that make generators. inception but make it statistics. ๐Ÿงš

these new commands deliver:

  • numbers that are distributed normally, uniformly, according to a Pareto or Gumbel distribution and so on
  • coordinates of points uniformly spread inside a sphere or a rectangle

for example:

set p [::simulation::random::prng_Normal -1.0 10.0]

this produces a new command (whose name is stored in the variable p, bestie, do not lose that variable) that generates normally distributed numbers with a mean of -1.0 and a standard deviation of 10.0. that's it. that's the vibe. ๐Ÿ”ฅ


๐Ÿ”ฎ PROCEDURES ๐Ÿ”ฎ

the package defines the following public procedures for discrete distributions:

๐ŸŽฒ the discrete girlies ๐ŸŽฒ

  • ::simulation::random::prng_Bernoulli p โ€” create a command (PRNG) that generates numbers with a Bernoulli distribution: the value is either 1 or 0, with a chance p to be 1.
    • float p โ€” chance the outcome is 1
  • ::simulation::random::prng_Discrete n โ€” create a command (PRNG) that generates numbers 0 to n-1 with equal probability.
    • int n โ€” number of different values (ranging from 0 to n-1)
  • ::simulation::random::prng_Poisson lambda โ€” create a command (PRNG) that generates numbers according to the Poisson distribution.
    • float lambda โ€” mean number per time interval

๐ŸŒŠ the continuous girlies ๐ŸŒŠ

the package defines the following public procedures for continuous distributions:

  • ::simulation::random::prng_Uniform min max โ€” create a command (PRNG) that generates uniformly distributed numbers between min and max.
    • float min โ€” minimum number that will be generated
    • float max โ€” maximum number that will be generated
  • ::simulation::random::prng_Triangular min max โ€” create a command (PRNG) that generates triangularly distributed numbers between min and max. if the argument min is lower than the argument max, then smaller values have higher probability and vice versa. in the first case the probability density function is of the form f(x) = 2(1-x) and the other case it is of the form f(x) = 2x.
    • float min โ€” minimum number that will be generated
    • float max โ€” maximum number that will be generated
  • ::simulation::random::prng_SymmTriangular min max โ€” create a command (PRNG) that generates numbers distributed according to a symmetric triangle around the mean of min and max. ๐ŸŽ€
    • float min โ€” minimum number that will be generated
    • float max โ€” maximum number that will be generated
  • ::simulation::random::prng_Exponential min mean โ€” create a command (PRNG) that generates exponentially distributed numbers with a given minimum value and a given mean value.
    • float min โ€” minimum number that will be generated
    • float mean โ€” mean value for the numbers
  • ::simulation::random::prng_Normal mean stdev โ€” create a command (PRNG) that generates normally distributed numbers with a given mean value and a given standard deviation. the bell curve. the moment. the legend. ๐Ÿ””
    • float mean โ€” mean value for the numbers
    • float stdev โ€” standard deviation
  • ::simulation::random::prng_Pareto min steep โ€” create a command (PRNG) that generates numbers distributed according to Pareto with a given minimum value and a given distribution steepness.
    • float min โ€” minimum number that will be generated
    • float steep โ€” steepness of the distribution
  • ::simulation::random::prng_Gumbel min f โ€” create a command (PRNG) that generates numbers distributed according to Gumbel with a given minimum value and a given scale factor. the probability density function is:
P(v) = exp( -exp(f*(v-min)))
  • float min โ€” minimum number that will be generated
  • float f โ€” scale factor for the values
  • ::simulation::random::prng_chiSquared df โ€” create a command (PRNG) that generates numbers distributed according to the chi-squared distribution with df degrees of freedom. the mean is 0 and the standard deviation is 1.
    • float df โ€” degrees of freedom

๐ŸŒธ the random point set girlies ๐ŸŒธ

the package defines the following public procedures for random point sets:

  • ::simulation::random::prng_Disk rad โ€” create a command (PRNG) that generates (x,y)-coordinates for points uniformly spread over a disk of given radius.
    • float rad โ€” radius of the disk
  • ::simulation::random::prng_Sphere rad โ€” create a command (PRNG) that generates (x,y,z)-coordinates for points uniformly spread over the surface of a sphere of given radius.
    • float rad โ€” radius of the disk
  • ::simulation::random::prng_Ball rad โ€” create a command (PRNG) that generates (x,y,z)-coordinates for points uniformly spread within a ball of given radius.
    • float rad โ€” radius of the ball
  • ::simulation::random::prng_Rectangle length width โ€” create a command (PRNG) that generates (x,y)-coordinates for points uniformly spread over a rectangle.
    • float length โ€” length of the rectangle (x-direction)
    • float width โ€” width of the rectangle (y-direction)
  • ::simulation::random::prng_Block length width depth โ€” create a command (PRNG) that generates (x,y,z)-coordinates for points uniformly spread over a block.
    • float length โ€” length of the block (x-direction)
    • float width โ€” width of the block (y-direction)
    • float depth โ€” depth of the block (z-direction)

๐Ÿ”‘ KEYWORDS ๐Ÿ”‘

math, random numbers, simulation, statistical distribution


๐Ÿ“ CATEGORY ๐Ÿ“

Mathematics


Copyright (c) 2004 Arjen Markus <arjenmarkus@users.sourceforge.net>


okay that's the whole page, bestie. go forth and generate. the generators will not generate themselves (that's literally the whole point of the package, someone has to call them first). ๐Ÿ’œ

tcllib, version 0.4 โ€” this was simulation::random(3tcl), signing off. slay, stay random, iykyk โœจ๐Ÿฆ‹๐Ÿ’…

๐Ÿ“ฆ where this page comes from