Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating object according to a distribution

Status
Not open for further replies.

metdim

Programmer
Nov 16, 2004
1
GR
I need to generate objects of a class I have created in a program and that generation must follow the Poisson distribution.How do I do that? The program is a simulation of an airport and at any given timeslot of the simulation I need to know how many new airplanes have come.It is their arrival that follows the Poisson distribution.
 
Download GSL (GNU Scientific Library):
You may extract its gsl_ran_poisson() function with its dependencies and use it in your program. Self-made Poisson distribution numbers generator will be worse (because of a very bad uniform distribution function in most of compilers RTLs)...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top