1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
<head><title>rsm.rand</title>
<meta http-equiv="Expires" content="Jan 1 1990 00:00:00 GMT" />
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" />
<meta name="Copyright" content="R. Scott McIntire 2003 <rscottmcintire@users.sourceforge.net>" />
<meta name="description" content="Discrete Random Number Generator" />
<meta name="author" content="R. Scott McIntire" />
<meta name="keywords" content="discrete, random, generator, Lisp" />
<meta name="generator" content="LML2-1.4.1" />
<center><h1>Documentation for package rsm.rand</h1></center></head>
<body bgcolor="#C5C5C5"><hr color="lightred" style="height=10" /><p></p><table border="10" bordercolor="navyblue" align="center" cellspacing="15"><tr bgcolor="#A5A5A5"><td><h2>Author : R. Scott McIntire</h2>
<h2>Version: 1.2</h2>
<h2>Overview:</h2>
<pre>This package provides a discrete random number generator.
<b style="color:darkblue">Export Summary:</b>
<b style="color:darkblue">
make-standard-rangen:</b> Make a new random number generator based on a list of
value-density pairs.<b style="color:darkblue">
Example:</b> (rsm.rand:make-standard-randgen
'((1 0.2) (2 0.25) (3 0.25) (4 0.3)))
makes a random generator object that has values 1,2,3,4 with
corresponding probability density values 0.2, 0.25, 0.25, 0.3.<b style="color:darkblue">
clone :</b> Clone a random generator object.<b style="color:darkblue">
next-rand :</b> Get a random number (or numbers) from the a random number object.<b style="color:darkblue">
rand-val-dens:</b> Set the value-density pairs for the random number object.<b style="color:darkblue">
rand-dist :</b> Get the distribution function (array) from a random
generator object.<b style="color:darkblue">
bin-rand :</b> Form an ASCII display that describes the distribution of
the random number object.</pre>
</td></tr><tr bgcolor="#C5C5C5"></tr><tr bgcolor="#C5C5C5"><td>
<h2 style="color=darkblue">bin-rand<b style="color=blue">  (rand &optional (num-of-trials 1000))</b></h2><pre>Create an ASCII display of bining <em style="color:blue"><num-of-trials></em> random numbers from the
random generator object, <em style="color:blue"><rand></em>.</pre>
<h2 style="color=darkblue">clone<b style="color=blue">  (rand)</b></h2><pre>Clone a randgen object <em style="color:blue"><rand></em>.</pre>
<h2 style="color=darkblue">make-standard-randgen<b style="color=blue">  (val-dens)</b></h2><pre>Makes a standard random generator object.<div style="color:darkgreen">
Example: (rsm.rand:make-standard-randgen '((1 0.2) (2 0.25) (3 0.25) (4 0.3))) </div>
makes a random generator object that has values: 1,2,3,4 with
corresponding probability density values: 0.2, 0.25, 0.25, 0.3.</pre>
<h2 style="color=darkblue">next-rand<b style="color=blue">  (rand &optional (n 1))</b></h2><pre>Get the next <em style="color:blue"><n></em> random numbers from <em style="color:blue"><rand></em>.</pre>
<h2 style="color=darkblue">rand-dist<b style="color=blue">  (rand)</b></h2><pre>Gets the probability distribution of the random number generator object as a
vector.</pre>
<h2 style="color=darkblue">rand-val-dens<b style="color=blue">  (rand)</b></h2><pre>Gets the values and probability density of the random number generator
object in the form ((val dens) ...).</pre></td></tr></table></body>
|