eamonng94

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Random Number Generator #3722
    eamonng94
    Participant

    Solved the seeding issue by removing the randomizer from the time loop, looks something like this:

    Random random = new Random();
    public double GetRandomNumber(double minimum, double maximum)
    {
       return random.NextDouble() * (maximum - minimum) + minimum;
    }
    • This reply was modified 5 years, 11 months ago by eamonng94.
    • This reply was modified 5 years, 11 months ago by eamonng94.
    in reply to: Random Number Generator #3719
    eamonng94
    Participant

    Hi Mikhail,

    this is the formula i have inputted into the formulas tab:

    public double GetRandomNumber(double minimum, double maximum)
    { 
        Random random = new Random();
        return random.NextDouble() * (maximum - minimum) + minimum;
    }

    However one problem i have found is that the numbers are coming from the same seed, so if i call a random number between the same values on two different input channels, it outputs the same number. Is there any way of implementing a formula, which for every instance of the source code, generates its own set of random numbers, different to that of another channel?

    in reply to: Reading Output Channel Values on Input Channels #3699
    eamonng94
    Participant

    This is now sorted.

Viewing 3 posts - 1 through 3 (of 3 total)