question

Mario García López avatar image
0 Likes"
Mario García López asked Mario García López commented

How to choose random output port

Depending on the case i'd like to choose a random port between 2 numbers. But it is not working, it always choose the same port.


/**Custom Code*/

Object item = param(1);

Object current = ownerobject(c);

/***popup:ValuesByCase:valuestr=Port*/

/**Port By Case*/


Variant value = /***tag:ValueFunc*//**/item.persona/**/;


/***tagex:data*/

if (value == /**/1/**/) {

return /**/1/**/;

}


if (value == /**/2/**/) {

return /**/1/**/;

}


if (value == /**/3/**/) {

return /**/duniform(2,4)/**/;

}


if (value == /**/4/**/) {

return /**/duniform(5,6)/**/;

}


if (value == /**/5/**/) {

return /**/7/**/;

}

/***/


return /***tag:default*//**/1/**/;


What is wrong?

FlexSim 24.2.0
randomportrandom number generator
· 2
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

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Mario García López commented

In an express license is randomness deactivated. Only licensed version uses randomness. You can tell then the system to deactivate randomness. Function is called repeat random streams in statistic menu.

· 1
5 |100000

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