Class RandomService
Inheritance
RandomService
Assembly: cs.temp.dll.dll
Syntax
public class RandomService : ServiceBase, IRandomService, IService
Fields
_random
Declaration
Field Value
DEFAULT_SEED
Declaration
protected const int DEFAULT_SEED = -1
Field Value
Properties
DefaultSeed
Declaration
protected virtual int DefaultSeed { get; }
Property Value
Methods
CleanupService()
Declaration
protected override void CleanupService()
GetRandomDouble()
Declaration
public virtual double GetRandomDouble()
Returns
GetRandomDouble(Double, Double)
Declaration
public virtual double GetRandomDouble(double min, double max)
Parameters
Returns
GetRandomDouble(Double, Double, Int32)
Declaration
public virtual double GetRandomDouble(double min, double max, int seed)
Parameters
Returns
GetRandomDouble(Int32)
Declaration
public virtual double GetRandomDouble(int seed)
Parameters
Type |
Name |
Description |
Int32 |
seed |
|
Returns
GetRandomInt()
Declaration
public virtual int GetRandomInt()
Returns
GetRandomInt(Int32)
Declaration
public virtual int GetRandomInt(int seed)
Parameters
Type |
Name |
Description |
Int32 |
seed |
|
Returns
GetRandomInt(Int32, Int32)
Declaration
public virtual int GetRandomInt(int min, int max)
Parameters
Returns
GetRandomInt(Int32, Int32, Int32)
Declaration
public virtual int GetRandomInt(int min, int max, int seed)
Parameters
Returns
GetRandomSeed()
Declaration
public virtual int GetRandomSeed()
Returns
GetRandomWeightedElement<TRandomWeighted>(TRandomWeighted[])
Declaration
public virtual TRandomWeighted GetRandomWeightedElement<TRandomWeighted>(TRandomWeighted[] collection)
where TRandomWeighted : class, IRandomWeighted
Parameters
Type |
Name |
Description |
TRandomWeighted[] |
collection |
|
Returns
Type |
Description |
TRandomWeighted |
|
Type Parameters
Name |
Description |
TRandomWeighted |
|
GetRandomWeightedElement<TRandomWeighted>(TRandomWeighted[], Int32)
Declaration
public virtual TRandomWeighted GetRandomWeightedElement<TRandomWeighted>(TRandomWeighted[] collection, int seed)
where TRandomWeighted : class, IRandomWeighted
Parameters
Type |
Name |
Description |
TRandomWeighted[] |
collection |
|
Int32 |
seed |
|
Returns
Type |
Description |
TRandomWeighted |
|
Type Parameters
Name |
Description |
TRandomWeighted |
|
InitializeRandom(Int32)
Declaration
public virtual void InitializeRandom(int seed)
Parameters
Type |
Name |
Description |
Int32 |
seed |
|
InitializeService()
Declaration
protected override void InitializeService()
Implements
IService