simulation::random(3tcl)
๐ 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 either1or0, with a chancepto be1.float pโ chance the outcome is1
::simulation::random::prng_Discrete nโ create a command (PRNG) that generates numbers0ton-1with equal probability.int nโ number of different values (ranging from0ton-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 betweenminandmax.float minโ minimum number that will be generatedfloat maxโ maximum number that will be generated
::simulation::random::prng_Triangular min maxโ create a command (PRNG) that generates triangularly distributed numbers betweenminandmax. if the argumentminis lower than the argumentmax, then smaller values have higher probability and vice versa. in the first case the probability density function is of the formf(x) = 2(1-x)and the other case it is of the formf(x) = 2x.float minโ minimum number that will be generatedfloat 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 ofminandmax. ๐float minโ minimum number that will be generatedfloat 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 generatedfloat 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 numbersfloat 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 generatedfloat 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 generatedfloat 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 withdfdegrees of freedom. the mean is0and the standard deviation is1.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 ๐
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
- debian trixie: tcllib 2.0+dfsg-4 ยท Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 ยท Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 ยท Tcl
- Copyright (c) 2004 Arjen Markus <arjenmarkus@users\&.sourceforge\&.net>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms