question

Brandon I avatar image
0 Likes"
Brandon I asked Braydn T answered

How to use decision point to split 3:2 between 2 conveyors

Hi there,

Is there a way to simply have a 3:2 ratio of flow items at the conveyor split (3 top, 2 bottom) using a decision point?

I have tried to make use of the modulus condition but I'm not too sure how it works, and only managed to achieve a 3:1 with:

current.stats.input.value%4

conveyordecision-autosave.fsm

Kind regards,

Brandon

FlexSim 19.0.0
decision pointsconveyor decision pointmodulus
5 |100000

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

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joerg Vogel commented

The modulus seems to do it in conjunction with "send item by case".

The division is by 5 and you can choose two cases of from {0,1,2,3,4} to go one send to connection and by default to go to the other connection.

If you rather need a more randomly approach, you replace the modulus division by a discrete uniform distribution in “send item by case” function for example

duniform(1,5)

where cases of 1 and 2 go to one decision point and by default to the other decision point.

conveyor-distribute-3-to-2.fsm


· 4
5 |100000

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

Brandon I avatar image Brandon I commented ·

Hey, thank you for the reply. I'm not really clued up with what you mean by cases and ports, do you maybe have an example program I can understand from?

I don't think the random approach will work either, as I need a fixed amount of 3 boxes going up, then 2 pass repeatedly.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Brandon I commented ·

@Brandon I, I hvae updated the answer to attach a model.

0 Likes 0 ·
Brandon I avatar image Brandon I commented ·

Thank you @Jörg Vogel

This is what I was looking for. While I still don't full grasp the concept, I'm going see what I can do.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Brandon I commented ·

@Brandon I , the send item by case is a logical switch structure of programming languages:

The switch variable evaluates to different values at each arrival event in the decision point. The statistical input is divided by the modulus operator to return the rest of the division of 5. The values are of 0, 1, 2, 3, 4. Two of these values are responsible to divert the item to a Decision Point connected at the output of the current Decision Point. All other values are evaluated by default and the item goes to the other Decision Point connected at the output port.

You can find the Logical Switch Statement in the manual in writing logic in FlexSim.

0 Likes 0 ·
Braydn T avatar image
0 Likes"
Braydn T answered

@Brandon I

You would use something like this:

int stream = getstream(current);
double randomnum = uniform(0.0, 100.0, stream);
double total = 0.0;


total += 66; 
if (randomnum <= total)
	return 1;
total += 33; 
if (randomnum <= total)
	return 2;

1 and 2 being ports. 66 and 33 are percentages.

5 |100000

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

Sebastian Hemmann avatar image
0 Likes"
Sebastian Hemmann answered Brandon I commented

Hi, I think "bernoulli();" is what you are looking for. It gives you the option to set percentages ;-)

· 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.

Brandon I avatar image Brandon I commented ·

Heya, sorry, I failed to mention that I did try bernoulli before, but I'm looking for a fixed amount. =)

0 Likes 0 ·