-1

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.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Jonathan
  • 1
  • 2
  • Remove the parentheses from the arguments (you only need those if there's a return value you want to capture). Also remove the `As Long` – Tim Williams Aug 20 '20 at 00:38
  • Thanks, but yes, i want to save the value in a variable or an atributte, so i need the parenthesis. – Jonathan Aug 25 '20 at 23:02

1 Answers1

0

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.

Jonathan
  • 1
  • 2
  • You could leave that 3rd argument (randomstream) out, and you would still get the same answer, since 10 is the default stream. If you prefer to sample from a different stream of random numbers, you could choose a value between 1 and 9. – John Feb 10 '23 at 01:54