sg_random.h File Reference

Routines to handle random number generation and hide platform differences. More...

Go to the source code of this file.

Functions

void sg_srandom_time ()
 Seed the random number generater with time() so we don't see the same sequence every time.
void sg_srandom_time_10 ()
 Seed the random number generater with time() in 10 minute intervals so we get the same sequence within 10 minutes interval.
void sg_srandom (unsigned int seed)
 Seed the random number generater with your own seed so can set up repeatable randomization.
double sg_random ()
 Return a random number between [0.0, 1.0).


Detailed Description

Routines to handle random number generation and hide platform differences.

Definition in file sg_random.h.


Function Documentation

double sg_random (  ) 

Return a random number between [0.0, 1.0).

Returns:
next "random" number in the "random" sequence

Definition at line 152 of file sg_random.c.

void sg_srandom ( unsigned int  seed  ) 

Seed the random number generater with your own seed so can set up repeatable randomization.

Parameters:
seed random number generator seed

Definition at line 146 of file sg_random.c.

void sg_srandom_time_10 (  ) 

Seed the random number generater with time() in 10 minute intervals so we get the same sequence within 10 minutes interval.

This is useful for synchronizing two display systems.

Definition at line 139 of file sg_random.c.


Generated on Mon Dec 17 09:30:56 2007 for SimGear by  doxygen 1.5.1