vbarandomarena-simulation

Randomstream in vba for Arena


I have been practising my knowledge in Arena, mainly in the VBA module. My intention is to get random data, from a uniform distribution in VBA. I've been testing with the code:

Dim s As SIMAN
Set s = ThisDocument.Model.SIMAN
s.SampleUniform (5,10, randomStream As Long)

The values 5 and 10 are the minimum and maximum, but the third parameter I have not been able to find a value that is accepted by VBA, it is supposed to be a random value that serves as a seed to generate the uniform value. I have tried with the Rnd function but it generates error.


Solution

  • I have been looking for examples and found one in which the code is presented as follows:

    Dim s As SIMAN
    Set s = ThisDocument.Model.SIMAN
    Int(s.SampleUniform(5, 10, 10))
    

    I still don't understand why the randomstream has a value of 10, but the expression works correctly.