Solved

Random Number Generation

Posted on 2002-06-14
9
298 Views
Last Modified: 2011-09-20
I'm looking for an easy to use random number generator library for use in a descrete event simulation and do not have any experience or knowledge of the arena. Any testimonial experience with a particular library or information on the different methods of generation would be greatly appreciated.

Have a good day,
jeff
0
Comment
Question by:jkelly061597
9 Comments
 
LVL 4

Accepted Solution

by:
jos010697 earned 50 total points
ID: 7080301
Well, we are talking C++ here, so why not use good ol' function rand()? It is part of the Standard C Library and it generates uniformly distributed pseudo random numbers in the interval 0 ... RAND_MAX.

kind regards
0
 
LVL 8

Expert Comment

by:fl0yd
ID: 7080622
The Standard C Library's rand() does return PSEUDO-random numbers, as correctly stated by jos. The only way of generating real random numbers is through the use of hardware. The only device capable of doing so that I know of is Intel's 82802 Firmware Hub, which can be accessed through Intel's 8XX chipsets. I don't know of any library that actually uses this feature though.
0
 
LVL 5

Expert Comment

by:proskig
ID: 7082226
Boost random number library was always considered to be pretty good

http://www.boost.org/libs/random/index.html
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:jonnin
ID: 7083543
to test generators, check out a program called diehard.  Its on the web, and besides the program, the download has a good paper in it.

http://stat.fsu.edu/~geo/diehard.html

0
 
LVL 4

Expert Comment

by:havman56
ID: 7115896
very good info from all .. realy very good thread!!
0
 
LVL 4

Expert Comment

by:havman56
ID: 7115904
As far as i knew


if u go for some gausian random function u will get real good random numbers.
which is equivalent in getting noises in any comunication systems.

0
 
LVL 8

Expert Comment

by:fl0yd
ID: 7117211
jeff,
   one thing you should always look out for when choosing a library/api: Make sure that you have an easy way to reproduce the same sequence of 'random' numbers. So what you are looking for as a developer are certainly pseudo-random numbers. Just imagine how tough debugging will be when an error pops up every now and then without being able to reproduce it.
0
 
LVL 11

Expert Comment

by:griessh
ID: 7262326
Dear jkelly

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "jos"

comment(s) as an answer.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 

Author Comment

by:jkelly061597
ID: 7265573
Thank you to everyone, I forgot about this question but ended up just using rand().

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question