Dungeon Architect  17.0.0
DungeonArchitect.Utils.PMRandom Class Reference

A random stream based on normal distribution. Also support uniform distsribution More...

Public Member Functions

 PMRandom ()
 Creates a new random stream with seed 0 More...
 
 PMRandom (uint seed)
 Creates a new random stream with the specified seed More...
 
void Initialize (uint seed)
 Initializes the stream with the given seed More...
 
float NextGaussianFloat ()
 Gets the next random number from a uniform distribution More...
 
float NextGaussianFloat (float mean, float stdDev)
 Gets the next random number from a uniform distribution More...
 
UnityEngine.Vector2 RandomPointOnCircle ()
 
float GetNextUniformFloat ()
 Gets a random number from the uniformly distributed stream More...
 

Properties

Random UniformRandom [get]
 

Detailed Description

A random stream based on normal distribution. Also support uniform distsribution

Definition at line 10 of file PMRandom.cs.

Constructor & Destructor Documentation

◆ PMRandom() [1/2]

DungeonArchitect.Utils.PMRandom.PMRandom ( )

Creates a new random stream with seed 0

Definition at line 27 of file PMRandom.cs.

◆ PMRandom() [2/2]

DungeonArchitect.Utils.PMRandom.PMRandom ( uint  seed)

Creates a new random stream with the specified seed

Parameters
seedThe seed to initialize the random stream

Definition at line 36 of file PMRandom.cs.

Member Function Documentation

◆ GetNextUniformFloat()

float DungeonArchitect.Utils.PMRandom.GetNextUniformFloat ( )

Gets a random number from the uniformly distributed stream

Returns

Definition at line 86 of file PMRandom.cs.

◆ Initialize()

void DungeonArchitect.Utils.PMRandom.Initialize ( uint  seed)

Initializes the stream with the given seed

Parameters
seed

Definition at line 45 of file PMRandom.cs.

◆ NextGaussianFloat() [1/2]

float DungeonArchitect.Utils.PMRandom.NextGaussianFloat ( )

Gets the next random number from a uniform distribution

Returns
Random number from a uniform stream

Definition at line 55 of file PMRandom.cs.

◆ NextGaussianFloat() [2/2]

float DungeonArchitect.Utils.PMRandom.NextGaussianFloat ( float  mean,
float  stdDev 
)

Gets the next random number from a uniform distribution

Parameters
meanThe mean used for the normal distribution
stdDevThe standard deviation used for the normal distribution
Returns
The resulting random number from the normal distributed random stream

Definition at line 71 of file PMRandom.cs.


The documentation for this class was generated from the following file: