question

Bartosz S2 avatar image
0 Likes"
Bartosz S2 asked Jeanette F commented

How to set the packing order?

Hello everyone. I have recently started using Flexsim software and have a question regarding. How to set the order of packets to queue from the processor. I used triggers on the queues to pass between them. After 8 hours it stops working. And second question is it possible to loop packing on selected period like 24 hours?


123.fsm

FlexSim 20.1.3
flexsim 20.1.3triggerspacking order
123.fsm (40.5 KiB)
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Bartosz S2, was Eric M's answer helpful? If so, please click the red "Accept" button at the bottom of 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

·
Eric M avatar image
0 Likes"
Eric M answered Eric M commented

Hi @Bartosz S2, the reason the model stops after 8 hours is because one of the queue's if statements is set to equal 1200 but its max content property is only set to 400 (meaning it will never reach 1200 to open the next queue's port). This change seemed to solve the problem of all the ports being closed after 8 hours.

This way of organizing the outputs certainly works, but as you can probably tell, takes quite a bit of work and leaves room for error. The easiest way to organize the output is under the "output" section of the properties of the processor. There's a "send to port" category with a dropdown that gives you a lot of options. The one that seems most similar to what you're trying to do is "Queue size>>Longest Queue if Available" Another way is to use lists. This works by having the processor "push" items to the list and the queues "pull" items off the list. Different logic can be implemented to pull certain items to certain queues (tutorials on using lists can be found in the manual).

If you want to keep using the logic that you've made, I would point a couple things out. This code gives you the current content of an object so you won't need the ilosc label (although nice job making that work although you would need to add a trigger that will set ilosc to 0 on reset):

current.subnodes.length;  

This code returns the maximum content allowed in a queue (which would have helped with the 8 hour problem):

getvarnum(current,"maxcontent");

As far as the second question, I'm a little confused what you mean by "to loop packing." Does this mean you want a schedule of items to repeat every 24 hours? Have the processor send items based on time (which is a 'send to port' option)?


1622674073442.png (11.3 KiB)
· 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.

Bartosz S2 avatar image Bartosz S2 commented ·

Thank you for your response @Eric M. I will try to use your advice to change model. I am trying solve the problem on the subject job-shop scheduling. I created model when after 24 hours simulation i have to find best way to pack. In first version i tried control proces from a processor. I wrote custom code on the flow instead of First available. But i had the same problem. After one full queue, the simulation was over. And my bonus question maybe u know how to use command "senddelaymessage". I would like the simulation stop after filled one of queue for 2 minutes. In my code simulation stoped aftereach box.

0 Likes 0 ·
code.png (15.3 KiB)
Eric M avatar image Eric M Bartosz S2 commented ·

I still having a bit of a hard time understanding exactly what you're looking for. When you say "find best way to pack" do you mean the best way to output items from Processor1? What statistics are you hoping to look at to determine what is the best way? Do you have in mind how you want to send items from Processor1 to the 4 queues? Are you hoping to fill up one queue, then move to the next and fill up that queue, then move to the next, etc?

I think using the senddelaymessage could work, or you could use a delay in process flow which might be easier (process flow would probably help with sending the items to the queues as well). Here's an explanation of the code and this video gives the basics on how messages work. You would need an 'on message' trigger on the object receiving the message to have that object do something as a result of the message (like one on the processor that would make it pause when it receives the message).

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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