Search Results for

    Show / Hide Table of Contents

    Class RandomNumberGenerator

    Simple wrapper around a random number generator that can be reset easily.

    Inheritance
    object
    RandomNumberGenerator
    Namespace: AS2
    Assembly: .dll
    Syntax
    public class RandomNumberGenerator

    Constructors

    | Edit this page View Source

    RandomNumberGenerator(int)

    Declaration
    public RandomNumberGenerator(int seed)
    Parameters
    Type Name Description
    int seed

    Fields

    | Edit this page View Source

    _random

    Declaration
    private Random _random
    Field Value
    Type Description
    Random
    | Edit this page View Source

    _seed

    Declaration
    private readonly int _seed
    Field Value
    Type Description
    int

    Methods

    | Edit this page View Source

    Range(int, int)

    Computes a random integer between min and max.

    Declaration
    public int Range(int min, int max)
    Parameters
    Type Name Description
    int min

    The minimal value to return.

    int max

    The maximal value to return.

    Returns
    Type Description
    int

    A random integer between min and max.

    | Edit this page View Source

    Range(float, float)

    Computes a random float between min and max.

    Declaration
    public float Range(float min, float max)
    Parameters
    Type Name Description
    float min

    The minimal value to return.

    float max

    The maximal value to return.

    Returns
    Type Description
    float

    A random float between min and max.

    | Edit this page View Source

    Reset()

    Resets the random number generator's state using the seed it was constructed with.

    Declaration
    public void Reset()
    • Edit this page
    • View Source
    In this article
    Back to top AmoebotSim 2.0 Documentation v1.11
    Copyright © 2025 AmoebotSim 2.0 Authors
    Generated by DocFX