⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 node248.html

📁 相关搜索: ns2仿真结果分析 all-awk ns2 ns2 无限网络中awk文件 ... [2.tcl.rar] - 在ns2平台上实现对AODV协议的模拟
💻 HTML
字号:
<html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><!--Converted with jLaTeX2HTML 2002 (1.62) JA patch-1.4patched version by:  Kenshi Muto, Debian Project.LaTeX2HTML 2002 (1.62),original version by:  Nikos Drakos, CBLU, University of Leeds* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan* with significant contributions from:  Jens Lippmann, Marek Rouchal, Martin Wilck and others --><HTML><HEAD><TITLE>22.1 Random Number Generation</TITLE><META NAME="description" CONTENT="22.1 Random Number Generation"><META NAME="keywords" CONTENT="everything"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META NAME="Generator" CONTENT="jLaTeX2HTML v2002 JA patch-1.4"><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"><LINK REL="STYLESHEET" HREF="everything.css" tppabs="http://www.isi.edu/nsnam/ns/doc/everything.css"><LINK REL="next" HREF="node260.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node260.html"><LINK REL="previous" HREF="node247.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node247.html"><LINK REL="up" HREF="node247.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node247.html"><LINK REL="next" HREF="node249.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node249.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html5115"  HREF="node249.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node249.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html5109"  HREF="node247.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node247.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html5103"  HREF="node247.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node247.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html5111"  HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html5113"  HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html5116"  HREF="node249.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node249.html">22.1.1 Seeding The RNG</A><B> Up:</B> <A NAME="tex2html5110"  HREF="node247.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node247.html">22. Mathematical Support</A><B> Previous:</B> <A NAME="tex2html5104"  HREF="node247.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node247.html">22. Mathematical Support</A> &nbsp <B>  <A NAME="tex2html5112"  HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>  &nbsp <B>  <A NAME="tex2html5114"  HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H1><A NAME="SECTION04210000000000000000"></A><A NAME="sec:random"></A><BR>22.1 Random Number Generation</H1><P>The RNG class contains an implementation of the combined multiplerecursive generator MRG32k3a proposed by L'Ecuyer[<A HREF="node589.html#lecuyer99" tppabs="http://www.isi.edu/nsnam/ns/doc/node589.html#lecuyer99">17</A>]. The C++ code was adapted from [<A HREF="node589.html#lecuyer01" tppabs="http://www.isi.edu/nsnam/ns/doc/node589.html#lecuyer01">19</A>].This replaces the previous implementation of <TT>RNG</TT>, which usedthe minimal standard multiplicative linear congruential generator ofPark and Miller&nbsp;[<A HREF="node589.html#Park88:Random" tppabs="http://www.isi.edu/nsnam/ns/doc/node589.html#Park88:Random">28</A>].  The newer (MRG32k3a) <TT>RNG</TT> isused in ns versions 2.1b9 and later.<P>The MRG32k3a generator provides x independentstreams of random numbers, each of which consists ofx substreams. Each substream has a period(<I>i.e.</I>, the number of random numbers before overlap) ofx. The period of the entire generator isx. Figure <A HREF="node248.html#streams" tppabs="http://www.isi.edu/nsnam/ns/doc/node248.html#streams">22.1</A> provides a graphical idea ofhow the streams and substreams fit together.<DIV ALIGN="CENTER"><A NAME="streams"></A><A NAME="9844"></A><TABLE><CAPTION ALIGN="BOTTOM"><STRONG>Figure 22.1:</STRONG>Overall arrangement of streams and substreams.[<A HREF="node589.html#lecuyer01" tppabs="http://www.isi.edu/nsnam/ns/doc/node589.html#lecuyer01">19</A>]</CAPTION><TR><TD><DIV ALIGN="CENTER">[angle=270,width=6 in]figures/rng-streams.eps</DIV></TD></TR></TABLE></DIV><P>A default RNG (<TT>defaultRNG</TT>), created at simulator initializationtime, is provided. If multiple random variables are used in asimulation, each random variable should use a separate RNG object.When a new RNG object is created, it is automatically seeded tothe beginning of the next independent stream of random numbers.Used in this manner, the implementation allows for a maximum ofx random variables.<P>Often, multiple independent replications of a simulation areneeded (<I>i.e.</I>, to perform statistical analysis givenmultiple runs with fixed parameters).  For each replication, adifferent substream should be used to ensure that the randomnumber streams are independent. (This process is given as an OTclexample later.) This implementation allows for a maximum ofx independent replications. Each random variable ina single replication can produce up to x randomnumbers before overlapping.<P><B>Note:</B> Only the most common functions are described here. Formore information, see [<A HREF="node589.html#lecuyer01" tppabs="http://www.isi.edu/nsnam/ns/doc/node589.html#lecuyer01">19</A>] and the source code foundin <TT>tools/rng.h</TT> and <TT>tools/rng.cc</TT>.  For a comparison of this RNG tothe more common LCG16807 RNG (and why LCG16807 is not a good RNG), see [<A HREF="node589.html#lecuyer-wsc" tppabs="http://www.isi.edu/nsnam/ns/doc/node589.html#lecuyer-wsc">18</A>].<BR><HR><!--Table of Child-Links--><A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A><UL><LI><A NAME="tex2html5117"  HREF="node249.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node249.html">22.1.1 Seeding The RNG</A><UL><LI><A NAME="tex2html5118"  HREF="node250.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node250.html">22.1.1.1 Example</A><LI><A NAME="tex2html5119"  HREF="node251.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node251.html">22.1.1.2 Output</A></UL><BR><LI><A NAME="tex2html5120"  HREF="node252.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node252.html">22.1.2 OTcl Support</A><UL><LI><A NAME="tex2html5121"  HREF="node253.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node253.html">22.1.2.1 Commands</A><LI><A NAME="tex2html5122"  HREF="node254.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node254.html">22.1.2.2 Example</A><LI><A NAME="tex2html5123"  HREF="node255.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node255.html">22.1.2.3 Output</A></UL><BR><LI><A NAME="tex2html5124"  HREF="node256.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node256.html">22.1.3 C++ Support</A><UL><LI><A NAME="tex2html5125"  HREF="node257.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node257.html">22.1.3.1 Member Functions</A><LI><A NAME="tex2html5126"  HREF="node258.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node258.html">22.1.3.2 Example</A><LI><A NAME="tex2html5127"  HREF="node259.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node259.html">22.1.3.3 Output</A></UL></UL><!--End of Table of Child-Links--><HR><!--Navigation Panel--><A NAME="tex2html5115"  HREF="node249.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node249.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html5109"  HREF="node247.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node247.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html5103"  HREF="node247.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node247.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html5111"  HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html5113"  HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html5116"  HREF="node249.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node249.html">22.1.1 Seeding The RNG</A><B> Up:</B> <A NAME="tex2html5110"  HREF="node247.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node247.html">22. Mathematical Support</A><B> Previous:</B> <A NAME="tex2html5104"  HREF="node247.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node247.html">22. Mathematical Support</A> &nbsp <B>  <A NAME="tex2html5112"  HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>  &nbsp <B>  <A NAME="tex2html5114"  HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <!--End of Navigation Panel--><ADDRESS>2003-09-23</ADDRESS></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -