Search code examples
anylogic

how to generate a random number in Anylogic


newbie in AnyLogic here ,

I am having a difficulty in dealing with this environment , am trying to know how i can generate a random number between 0.5 and 0.8 of type double and put it in a parameter ?


Solution

  • You can use uniform(a,b) function. a is the minimum, b is is the maximum. Say your parameter is called myParameter, you can set its value to uniform random number at any place in the simulation by myParameter=uniform (0.5, 0.8)