question

Prateekq4 avatar image
0 Likes"
Prateekq4 asked Jeanette F edited

Distribution based interarrival time

Hi,

I am trying to have my source assign item label values based on a normal distribution.

So, i want the label values to occur in a normal distribution with mean 17 and s.d. 3. But i only want the values that lie between 8 and 26.

The code i used is shown below:

The problem i am facing is that some items are released with no label value. So i think what it is doing is if the value lies outside the range, it does not assign any value to that item. I want to avoid this. Please suggest a solution to ensure all items are labeled based on the specified range.


1694726598334.png

Object current = ownerobject(c);

Object item = param(1);

int port = param(2);

{ // ************* PickOption Start ************* //

/***popup:SetLabel*/

/**Set Label*/

Object involved = /** \nObject: *//***tag:object*//**/item/**/;

string labelname = /** \nLabel: *//***tag:label*//**/"Type"/**/;

int value = /** \nValue: *//***tag:value*//**/normal(17,3,getstream(current))/**/;

if (value>=8 && value<=26)

{

involved.labels.assert(labelname).value = value;

}

} // ******* PickOption End ******* //


FlexSim 22.1.4
distributions
1694726598334.png (18.3 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jeanette F avatar image
0 Likes"
Jeanette F answered Prateekq4 commented

Hello @Prateekq4,

You just described a normal distribution.

  1. normal(17, 3.0, getstream(current))

Normal Distribution.fsm


· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.