Random problem

dezreena

Member
Joined
Mar 29, 2007
Messages
20
Programming Experience
Beginner
hello guys!

i have simple question about random:

VB.NET:
Shared seed As Double = 0
Shared randobj As New Random(seed)

For int_i = 1 To 10 'Step 1

 EinfallZeitpkt(int_i) = = -Log(1 - randobj.NextDouble()) * MittlBedZeit /(Angebot / Anzahl)           

 Next int_i


what is the different between when seed = 0 (as above) and seed = 56?
 
The seed is the starting point of the random sequence generated from Random class. If you use the parameterless constructor a time-based seed is used by default, this is also sufficient in most cases. As explained in documentation you specify a seed if you need to create multiple Random class instances in a very short timespan (one tick to be precise, there are 10000 of these in a millisecond) and need to make sure they start from different seeds. In other words, it is very rare you use this constructor.
 
Back
Top