Optimization : Optimization Namespace

Random Class

Random number generator.

public class Random

Remarks

Convenient object to generate random numbers. This is basically just Random but extended with some useful methods.

Requirements

Namespace: Optimization
Assembly: Optimization (in Optimization.dll)

Members

See Also: Inherited members from object.

Public Constructors

Random ()
Create new Random object.
Create new Random object.
Create new random number generator from existing generator.

Public Methods

NextDouble () : double
Generate next random number.
Range (double, double) : double
Generate a random number in a specific range.
Seed (int)
Seed the random number generator.

Member Details

Random Constructor

Create new Random object.

public Random ()

Remarks

Create new Random object.

Requirements

Namespace: Optimization
Assembly: Optimization (in Optimization.dll)

Random Constructor

Create new Random object.

public Random (int seed)

Parameters

seed
The seed.

Remarks

Create a new Random object and seed the random number generator. Use this if you need to have reproducible sequence of random numbers.

Requirements

Namespace: Optimization
Assembly: Optimization (in Optimization.dll)

Random Constructor

Create new random number generator from existing generator.

public Random (Random rnd)

Parameters

rnd
Existing random number generator.

Remarks

Creates a new random number generator using an existing generator.

Requirements

Namespace: Optimization
Assembly: Optimization (in Optimization.dll)

NextDouble Method

Generate next random number.

public double NextDouble ()

Returns

The next random number.

Remarks

Generate and return the next random number.

Requirements

Namespace: Optimization
Assembly: Optimization (in Optimization.dll)

Range Method

Generate a random number in a specific range.

public double Range (double min, double max)

Parameters

min
Minimum range.
max
Maximum range.

Returns

A random number.

Remarks

Generate a random number in a specific range.

Requirements

Namespace: Optimization
Assembly: Optimization (in Optimization.dll)

Seed Method

Seed the random number generator.

public void Seed (int seed)

Parameters

seed
The seed.

Remarks

Use this if you need to have reproducible sequence of random numbers.

Requirements

Namespace: Optimization
Assembly: Optimization (in Optimization.dll)