Class RandomNumber
Assembly: TowseyLibrary.dll
Syntax
public class RandomNumber
Constructors
|
Improve this Doc
View Source
RandomNumber()
Declaration
|
Improve this Doc
View Source
RandomNumber(Int32)
Declaration
public RandomNumber(int seed)
Parameters
Type |
Name |
Description |
Int32 |
seed |
|
Methods
|
Improve this Doc
View Source
GetDouble()
returns a random number between 0.0 and 1.0.
Declaration
public double GetDouble()
Returns
|
Improve this Doc
View Source
GetDouble(Int32)
Declaration
public double GetDouble(int max)
Parameters
Type |
Name |
Description |
Int32 |
max |
|
Returns
|
Improve this Doc
View Source
GetInt(Int32)
generates numbers 0 to max-1.
Declaration
public int GetInt(int max)
Parameters
Type |
Name |
Description |
Int32 |
max |
|
Returns
|
Improve this Doc
View Source
GetRandomDistancesInEuclidianSpace(Int32, Int32)
generates numbers 1 - 100.
Declaration
public static void GetRandomDistancesInEuclidianSpace(int trialCount, int dimensions)
Parameters
Type |
Name |
Description |
Int32 |
trialCount |
|
Int32 |
dimensions |
|
|
Improve this Doc
View Source
GetRandomPercent()
generates numbers 1 - 100.
Declaration
public int GetRandomPercent()
Returns
|
Improve this Doc
View Source
GetRandomVector(Int32, RandomNumber)
generates a vector of random numbers in [0, 1.0].
Declaration
public static double[] GetRandomVector(int vectorLength, RandomNumber rn)
Parameters
Returns
|
Improve this Doc
View Source
GetVectorOfRandomIntegers(Int32[], RandomNumber)
Declaration
public static int[] GetVectorOfRandomIntegers(int[] maxValues, RandomNumber rn)
Parameters
Returns
|
Improve this Doc
View Source
RandomizeArray(Double[], Int32)
returns the passed array but with the elements in a random order
see method above which was originally written for FuzzyART in 1995.
Declaration
public static double[] RandomizeArray(double[] array, int seed)
Parameters
Returns
|
Improve this Doc
View Source
RandomizeArray(Int32[], Int32)
IMPORTANT - THIS METHOD NEEDS WORK!!
returns the passed array but with the elements in a random order
see method above which was originally written for FuzzyART in 1995.
Declaration
public static int[] RandomizeArray(int[] array, int seed)
Parameters
Returns
|
Improve this Doc
View Source
RandomizeNumberOrder(Int32, Int32)
Returns integers up to N in random order.
Use of seed will always return the same order.
Pass a negative seed value to ignore it and to have a different random order every time method called.
Use this method if you want random numbers up to N without replacement.
Declaration
public static int[] RandomizeNumberOrder(int N, int seed)
Parameters
Returns
|
Improve this Doc
View Source
RandomNumbersWithoutReplacement(Int32, Int32)
Returns N random integers between 0 - K-1 without replacement.
If seed is negative, it will be ignored ie different random order every time method called.
Declaration
public static int[] RandomNumbersWithoutReplacement(int n, int seed)
Parameters
Returns
Extension Methods