question

Karol DS avatar image
0 Likes"
Karol DS asked Ben Wilson commented

How can i have 3 types in a current order

Hi!

I want to have 3 types of items going from 1 source. I want to have them in order 1,2,3,1,2,3,1,2,3.....and give them 3 colors(one for each type). I tried to do it by table or set "type and percentage" but it doesnt work becouse sometimes we have 1,2,2,3 or any another wrong order. How can i do it?

FlexSim 20.2.3
flexsim 20.2.3types in order
· 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.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

Hi @Karol DS, was Patryk U2's answer helpful? If so, please click the red "Accept" button on their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Patryk avatar image
0 Likes"
Patryk answered

You can do it in two ways.

The first way

You can set "Arrival Style" to "Arrival sequence". Then set number of row to 3 and add one label "Type" in sequence 1,2,3 and mark " repeat table" .

To change the color you should set in trigger "On Creaton" or "On exit" "Visual">"set color by case".

The second way

If you want use "Inter - Arrival Time", you should add number label "Type" =0 to the source. Then in triggger "On creation" in custome code you should write code:

/**Custom Code*/

Object current = ownerobject(c);

Object item = param(1);

int rownumber = param(2);

current.Type++;

int number = current.Type;

if (number > 3){

number = 1;

current.Type =1;

}

item.Type = number;


To change the color you should set in trigger "On exit" "Visual">"set color by case".

At the end in trigger "On reset " in cutome code write:


Object current = ownerobject(c);

current.Type = 0;


To always start to item.Type =1 ;


1604928097599.png (5.9 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.