Represents a pseudo-random number generator, which is a device that produces a sequence of numbers that meet certain statistical requirements for randomness.To browse the .NET Framework source code for this type, see the Reference Source.
More...
|
| KSPRandom () |
| Initializes a new instance of the T:System.Random class, using a time-dependent default seed value. More...
|
|
| KSPRandom (int Seed) |
| Initializes a new instance of the T:System.Random class, using the specified seed value. More...
|
|
virtual new int | Next () |
| Returns a non-negative random integer. More...
|
|
virtual new int | Next (int maxValue) |
| Returns a non-negative random integer that is less than the specified maximum. More...
|
|
virtual new int | Next (int minValue, int maxValue) |
| Returns a random integer that is within a specified range. More...
|
|
virtual new void | NextBytes (byte[] buffer) |
| Fills the elements of a specified array of bytes with random numbers. More...
|
|
virtual new double | NextDouble () |
| Returns a random floating-point number that is greater than or equal to 0.0, and less than 1.0. More...
|
|
virtual double | NextDouble (double minValue, double maxValue) |
| Returns a random double that is within a specified range. More...
|
|
|
virtual new double | Sample () |
| Returns a random floating-point number between 0.0 and 1.0. More...
|
|
Represents a pseudo-random number generator, which is a device that produces a sequence of numbers that meet certain statistical requirements for randomness.To browse the .NET Framework source code for this type, see the Reference Source.
Initializes a new instance of the T:System.Random class, using a time-dependent default seed value.
KSPRandom.KSPRandom |
( |
int |
Seed | ) |
|
|
inline |
Initializes a new instance of the T:System.Random class, using the specified seed value.
- Parameters
-
Seed | A number used to calculate a starting value for the pseudo-random number sequence. If a negative number is specified, the absolute value of the number is used. |
virtual new int KSPRandom.Next |
( |
| ) |
|
|
inlinevirtual |
Returns a non-negative random integer.
- Returns
- A 32-bit signed integer that is greater than or equal to 0 and less than F:System.Int32.MaxValue.
virtual new int KSPRandom.Next |
( |
int |
maxValue | ) |
|
|
inlinevirtual |
Returns a non-negative random integer that is less than the specified maximum.
- Parameters
-
maxValue | The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to 0. |
- Returns
- A 32-bit signed integer that is greater than or equal to 0, and less than maxValue ; that is, the range of return values ordinarily includes 0 but not maxValue . However, if maxValue equals 0, maxValue is returned.
- Exceptions
-
T:System.ArgumentOutOfRangeException | maxValue is less than 0. |
virtual new int KSPRandom.Next |
( |
int |
minValue, |
|
|
int |
maxValue |
|
) |
| |
|
inlinevirtual |
Returns a random integer that is within a specified range.
- Parameters
-
minValue | The inclusive lower bound of the random number returned. |
maxValue | The exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue . |
- Returns
- A 32-bit signed integer greater than or equal to minValue and less than maxValue ; that is, the range of return values includes minValue but not maxValue . If minValue equals maxValue , minValue is returned.
- Exceptions
-
T:System.ArgumentOutOfRangeException | minValue is greater than maxValue . |
virtual new void KSPRandom.NextBytes |
( |
byte[] |
buffer | ) |
|
|
inlinevirtual |
Fills the elements of a specified array of bytes with random numbers.
- Parameters
-
buffer | An array of bytes to contain random numbers. |
- Exceptions
-
T:System.ArgumentNullException | buffer is . |
virtual new double KSPRandom.NextDouble |
( |
| ) |
|
|
inlinevirtual |
Returns a random floating-point number that is greater than or equal to 0.0, and less than 1.0.
- Returns
- A double-precision floating point number that is greater than or equal to 0.0, and less than 1.0.
virtual double KSPRandom.NextDouble |
( |
double |
minValue, |
|
|
double |
maxValue |
|
) |
| |
|
inlinevirtual |
Returns a random double that is within a specified range.
- Parameters
-
minValue | The inclusive lower bound of the random number returned. |
maxValue | The exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue . |
- Returns
- A 32-bit signed integer greater than or equal to minValue and less than maxValue ; that is, the range of return values includes minValue but not maxValue . If minValue equals maxValue , minValue is returned.
- Exceptions
-
T:System.ArgumentOutOfRangeException | minValue is greater than maxValue . |
virtual new double KSPRandom.Sample |
( |
| ) |
|
|
inlineprotectedvirtual |
Returns a random floating-point number between 0.0 and 1.0.
- Returns
- A double-precision floating point number that is greater than or equal to 0.0, and less than 1.0.
The documentation for this class was generated from the following file:
- KSP/Assets/Scripts/Util Scripts/KSPUtil/Utility Classes/KSPRandom.cs