Source to create diferrent items

Source to create diferrent items

jorgeobis
Contributor Contributor
128 Views
8 Replies
Message 1 of 9

Source to create diferrent items

jorgeobis
Contributor
Contributor
Source to create diferrent items 

I need a source that creates two different themes in a cyclical manner, the sequence must be 10 items of type 1 and then 1 item of type 2. Therefore, it must be 10-1-10-1-10-1 all the time... These items go from the source to a processor, in which each item has a different processing time. for type 1 it is 0.1 seconds and for type 2 it is 0 seconds. and after this processor they all go to queue11. I have tried to do it with a creationqueue with its process flow but I can't do it correctly.

0 Likes
129 Views
8 Replies
Replies (8)
Message 2 of 9

moehlmann_fe
Enthusiast
Enthusiast

You can use the following expression in the Set Label trigger option of a 3d-source.

getstat(current, "Output", STAT_CURRENT)%11 == 10 ? (2):(1)

"getstat()" gets the current output value of the source (so it just counts up starting at 0). With the modulo operator % we get the remainder of a division by 11. When that remainder is 10, it is an "11th" item and gets assigned a label value of 2, otherwise 1.

You also find the used operators in the documentation (math operations and info box for ternary operator under if-condition).

https://docs.flexsim.com/en/25.2/Reference/CodingInFlexSim/WritingLogic/WritingLogic.html#math

0 Likes
Message 3 of 9

jorgeobis
Contributor
Contributor

Thank you. I did from another way.

 

I want to ask another thing, I share the model. 

 

I'm creating Items with the form I telled before, 10-1-10-1-10-1 in "COLA_C11_C11_Box". The 10 is "Componentes_S5" and 1 is "caja_S5".

 

Now I want to deliver them to "Cola11" and in there process them depends on the element on one or other processor.

 

If element is "Componentes_S5" I want to process it in the processor1, if the element is "Caja_S5" I want to process it in processor11.

 

How can I do that?

 

Thank you!!

0 Likes
Message 4 of 9

moehlmann_fe
Enthusiast
Enthusiast

Use name/type is assigned to the "Nombres" label on the item. Use that in either the "Conditional Port" or "Port By Case" option to send the item to the correct port depending on the label name. 

You would use the same label in "Values By Case" for the load and unload times on the task executer.

0 Likes
Message 5 of 9

jorgeobis
Contributor
Contributor

Okay now it's partially fixed.

The point is that I want a pure fifo. That is, it is fine that in "Maq_comp_c11" it processes the components and in "maq_box_c11" the boxes, but I want it to always do it as a fifo.

first process the 6 components and then 1 box. first 6 components then the box.

Until you process the 6 components, you will not process the box.

Even though it does it on 2 different processors, it does it as a fifo.

0 Likes
Message 6 of 9

moehlmann_fe
Enthusiast
Enthusiast

I would solve the FIFO requirement with a Process Flow. A token, representing the item, must first enter a zone with a limited capacity before it is released to the processor. Because the first processor has a capacity of 2, I use a subset in which tokens take up space according to their item's type. The relevant settings are found on the "Subsets", "Subset Constraints" and "Advanced" tab in the zone properties.

0 Likes
Message 7 of 9

jorgeobis
Contributor
Contributor

I'm not undestanding.

 

How can I use on my model?

 

 

0 Likes
Message 8 of 9

jorgeobis
Contributor
Contributor

As you can see in the model. He makes right the rule of where the type of component has to go, but it doesn't go cyclically. I mean, now. When "Cola11" has a "Caja_S1" it goes to the processor regardless of the 6-1-6-1 sequence, and "Caja_C11" does not have to go to the processor until 6 "components_S1" have been processed.

 

I hope I have been expressed well

0 Likes
Message 9 of 9

moehlmann_fe
Enthusiast
Enthusiast

Maybe just using a combiner is an option? The first port of the queue leads to the combiner, so it receives the "caja" item right away. The second port goes to a processor that then leads to the combiner, so the "component" items are processed one by one and then added to the batch in the combiner.

0 Likes