Cancel
Showing results for 
Search instead for 
Did you mean: 

z_normal and time data type

Creator
Creator

Hi, 

 

what i want to do: use z_normal to generate normally distributed processing times ( example lowerbound 1 minute , upperbound 3 minutes ...) 

 

how do i use the function properly? if input 1:00 i get an error ( z_normal(1, 1:00, 3:00)  doesnt work..

 

Thanks in advance!

5 REPLIES

Re: z_normal and time data type

Pioneer
Pioneer

Hi dustsim.
Try using the following line of code:


z_normal(1, str_to_time("01:00"), str_to_time("03:00"));

 

 

Re: z_normal and time data type

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

set the time as seconds (real):

z_normal(1,60,180);

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: z_normal and time data type

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi dustsim,

 

just one more remark:

 

The second and third arguments are not the lower and upper bounds, they are the mean value and the standard deviation. The optional fourth and fifth parameter can be used to define the boundaries.

 

Here you can see the definition from the online manual:

z_normal(Stream:<integer>, Mu:<real>, Sigma [,LowerBound:<real>, UpperBound<:real>]);

 

Regards,

Ralf

Regards,

Ralf
------------------------------------------------------------------------------------------------------
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: z_normal and time data type

Creator
Creator

Thank you RalfTobel! This was also helpful.

 

I am still having trouble with the parameter for "Stream". Does this mean that I get the same set of numbers every time I call a method with the same value for "Stream" ?

 

Example:

do while i < 3

print z_normal(1,2,3) 

i ++ 

loop 

 

gives me: 2,2,2

 

Now when i run the simulation again , i would again get 2,2,2 ? 

If so , how do i get totally random (distributed) values?

 

Thank you so much!

 

 

Re: z_normal and time data type

Siemens Phenom Siemens Phenom
Siemens Phenom

Usually you want to have reproducable simulation runs to be able to find and fix problems.

 

If you want to have different random seeds for each run then open the dialog of the Event Controller.

 

For Version 10.1 and before deselect 'Reset Random Number Streams on Reset' in the Tools menu.

 

For Version 11 and newer select 'Increment Variant on Reset'.

 

Regards,

Ralf

Regards,

Ralf
------------------------------------------------------------------------------------------------------
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.