Class Randomizer
Random numbers facade.
Inheritance
System.Object
Randomizer
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: SpiceSharpParser.Common.Mathematics.Probability
Assembly: SpiceSharpParser.dll
Syntax
public class Randomizer : IRandomizer
Constructors
| Improve this Doc View SourceRandomizer(Boolean, Nullable<Int32>, Nullable<Double>, Nullable<Int32>, Dictionary<String, Func<Pdf>>, Dictionary<String, Pdf>, Dictionary<String, Cdf>, Dictionary<String, CustomRandomNumberProviderFactory>)
Initializes a new instance of the Randomizer class.
Declaration
public Randomizer(bool isDistributionNameCaseSensitive = false, int? cdfPoints = default(int? ), double? normalLimit = default(double? ), int? seed = default(int? ), Dictionary<string, Func<Pdf>> pdfDictionary = null, Dictionary<string, Pdf> pdfInstances = null, Dictionary<string, Cdf> cdfDictionary = null, Dictionary<string, CustomRandomNumberProviderFactory> customRandomNumberProviderFactories = null)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isDistributionNameCaseSensitive | Is distribution name case-sensitive. |
System.Nullable<System.Int32> | cdfPoints | Number of cdf points. |
System.Nullable<System.Double> | normalLimit | Normal limit. |
System.Nullable<System.Int32> | seed | Seed. |
System.Collections.Generic.Dictionary<System.String, System.Func<Pdf>> | pdfDictionary | |
System.Collections.Generic.Dictionary<System.String, Pdf> | pdfInstances | |
System.Collections.Generic.Dictionary<System.String, Cdf> | cdfDictionary | |
System.Collections.Generic.Dictionary<System.String, CustomRandomNumberProviderFactory> | customRandomNumberProviderFactories |
Properties
| Improve this Doc View SourceCdfPoints
Gets or sets number of CDF points.
Declaration
public int CdfPoints { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
CurrentPdfName
Gets or sets current pdf name.
Declaration
public string CurrentPdfName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
NormalLimit
Gets or sets normal limit.
Declaration
public double NormalLimit { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Seed
Declaration
public int? Seed { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> |
Methods
| Improve this Doc View SourceClone()
Declaration
public IRandomizer Clone()
Returns
Type | Description |
---|---|
IRandomizer |
GetRandomDoubleProvider(String)
Gets a random double provider for a given seed and pdf.
Declaration
public IRandomDoubleProvider GetRandomDoubleProvider(string pdfName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | pdfName | Name of PDF. |
Returns
Type | Description |
---|---|
IRandomDoubleProvider | A random double provider. |
GetRandomIntegerProvider(String)
Gets a random integer provider for a given seed and pdf.
Declaration
public IRandomIntegerProvider GetRandomIntegerProvider(string pdfName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | pdfName | Name of PDF. |
Returns
Type | Description |
---|---|
IRandomIntegerProvider | A random integer provider. |
GetRandomProvider(String)
Gets a random number provider for a given seed and pdf.
Declaration
public IRandomNumberProvider GetRandomProvider(string pdfName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | pdfName | Name of PDF. |
Returns
Type | Description |
---|---|
IRandomNumberProvider | A random number provider. |
RegisterPdf(String, Func<Pdf>)
Registers a Pdf in the randomizer.
Declaration
public void RegisterPdf(string name, Func<Pdf> pdf)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of Pdf. |
System.Func<Pdf> | Pdf. |