• API Documentation
Show / Hide Table of Contents
  • Rebus
    • Arguments
    • Biome
    • CantorPairing
    • CommandRequest
    • CommandResponse
    • CommandType
    • Commodity
    • Configuration
    • ConflictEventArgs
    • Depths
    • Economy
    • Fleet
    • HexPoint
    • IGameService
    • ILoginService
    • Player
    • Unit
    • User
    • Zone
    • ZoneInfo
  • Rebus.Client
    • GraphicsEngine
    • Layout
    • RpcClient
    • ZoneVisualizer
  • Rebus.Client.Lenses
    • BiomeLens
    • ConstellationLens
    • Lens
    • PopulationLens
    • StarLens
  • Rebus.Server
    • AStarSearch
    • EvaluationContext
    • FisherYatesShuffle
    • JuliaSet
    • PowerSet
  • Rebus.Server.Considerations
    • Agent
    • Behavior
    • BehaviorCollection
    • Consideration
    • ConsiderationCollection
    • FunctionConsideration
    • LinearConsideration
    • QuadraticConsideration
  • Rebus.Server.Functions
    • IFunctions<T>
  • System
    • NegativeExponentialRandom
  • System.Text.Json.Serialization.Converters
    • ComplexConverter
    • CultureInfoConverter
    • IPAddressConverter

Class NegativeExponentialRandom

Represents a pseudo-random number generator whose outputs, when aggregated, approximate a negative exponential distribution.

Inheritance
Object
Random
NegativeExponentialRandom
Inherited Members
Random.Next()
Random.Next(Int32)
Random.NextInt64()
Random.NextInt64(Int64)
Random.NextInt64(Int64, Int64)
Random.NextBytes(Byte[])
Random.NextBytes(Span<Byte>)
Random.NextSingle()
Random.Shared
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: System
Assembly: Rebus.Server.dll
Syntax
public class NegativeExponentialRandom : Random
Remarks

The implementation of this class was inspired by and based on this Stack Overflow question asked by @maxammann and answered by @pjs.

Constructors

NegativeExponentialRandom(Double)

Initializes a new instance of the NegativeExponentialRandom class.

Declaration
public NegativeExponentialRandom(double lambda)
Parameters
Type Name Description
Double lambda

The rate parameter λ.

NegativeExponentialRandom(Int32, Double)

Declaration
public NegativeExponentialRandom(int seed, double lambda)
Parameters
Type Name Description
Int32 seed

A number used to calculate a starting value for the pseudo-random number sequence. If a negative number is specified, the absolute value of the number is used.

Double lambda

The rate parameter λ.

Methods

Next(Int32, Int32)

Declaration
public override int Next(int minValue, int maxValue)
Parameters
Type Name Description
Int32 minValue
Int32 maxValue
Returns
Type Description
Int32
Overrides
Random.Next(Int32, Int32)

NextDouble()

Declaration
public override double NextDouble()
Returns
Type Description
Double
Overrides
Random.NextDouble()

Sample()

Declaration
protected override double Sample()
Returns
Type Description
Double
Overrides
Random.Sample()

See Also

java - Generate random number between 0 and 1 with (negative)exponential distribution - Stack Overflow
@maxammann - Stack Overflow
@pjs - Stack Overflow
In This Article
Back to top © 2021-2022 Ishan Pranav. All rights reserved. Licensed under the MIT License.