question

Steven C7 avatar image
0 Likes"
Steven C7 asked Jeff Nordgren commented

Multiprocessor process control

I have a multiprocessor that processes two types of items: Type 1 goes through Process1 only, and Type 2 goes through Process2 only. What I would like to do is that after each process, assign a new label called "Check", where Check 1 goes to the next fixed resource (Queue2), and Check 2 forces the item to go through the multiprocessor again.

Right now in the "On Process Finish" trigger, the "Check" label is assigned after the item goes through all the processes. So there are two parts to my questions:

  1. How to assign a label after a specific process in multiprocessor?
  2. How to create a conditional feedback loop within the multiprocessor?

Any help would be much appreciated!

multiprocessor.fsm

FlexSim 19.2.2
multiprocessor
multiprocessor.fsm (32.3 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.

1 Answer

Jeff Nordgren avatar image
1 Like"
Jeff Nordgren answered Jeff Nordgren commented

@Steven C7

Attached is your model with the changes that I've made.

You can assign a label after a specific process by adding code to OnProcessFinish of the MultiProcessor. I commented around your code that is already in that trigger to show you where you would put your code to assign a label after a specific process (variable "opnum"). And in this trigger, I also added code to change the flowitems color to red if the Check label is equal to 2. This is just so it can be visualized in the model easier but is not required.

As far as the conditional routing back to the multiprocessor, I based that off of the Check label on the flowitem as well in the Send To Port option on the Flow tab of the Properties Window. I just use the By Expression option.j

I also changed to the Pull option in Multiprocessor. In the Send To Port option in Queue1, I send the flowtiems to a List. Then in the Input area on the Flow tab of the Multiprocessor's Properties Window, I checked the Pull Strategy check box. I pull from that flowtiems List and in the Query field, I added "ORDER BY Check DESC". This is so all the flowitems with a Check label value of 2 will be taken from the queue before other flowitems. That was just something I added. You don't need it if you don't care if those flowitems are reprocessed first or not.

Take a look at the model and see if it will do what you are wanting it to do. If you have any problems of questions, please don't hesitate to ask.

Thanks.

multiprocessor-jn1.fsm


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

Steven C7 avatar image Steven C7 commented ·

Your model is great, thank you @Jeff Nordgren! I did intend for the red items to be reprocessed first, so your Pull Strategy works well. I will dive deeper into it to understand how ItemsList interact with the Fixed Resources.

In the mean time, I'm wondering if it would be possible to direct the Check 2 items within the multiprocessor. So the workflow would go like this: items assigned Check 1 go to the next fixed resource (Queue2), and Check 2 would proceed to Process3 within MultiProcessor1, after which the item would cycle back directly to either Process1 or Process2 depending on the Type label.

The solution I can think of at this moment is having Process3 as a separate Processor, and create a feedback loop between MultiProcessor (Process1 and Process2) and Processor (Process3). That method currently works perfectly. However, it would be ideal to have all three processes under the same MultiProcessor, as opposed to two separate entities, though I'm not entirely sure if that would be feasible.

Let me know what you think, and thank you again for clarifying the OnProcessFinish trigger code!

0 Likes 0 ·
Jeff Nordgren avatar image Jeff Nordgren Steven C7 commented ·

@Steven C7

I have a couple of questions for you. I don't think I quite understand the normal flow of a flowitem through MultiProcessor1. You have three processes in that object. Do all of the flowitems go through all of the three processes? Your description:

"So the workflow would go like this: items assigned Check 1 go to the next fixed resource (Queue2), and Check 2 would proceed to Process3 within MultiProcessor1, after which the item would cycle back directly to either Process1 or Process2 depending on the Type label."

First, when is the "Check" label assigned to the flowitem? If the label is 1 would it just go through processes 1 and 2 and NOT 3? If it's a 2 does it go through processes 1 and 2 AND 3? I don't understand when you say that after a flowitem goes through process3 it would cycle back to process 1 or 2. Could you explain that a little further? Not sure I understand that.

And the solution will probably involve 2 objects rather than just the multiprocessor. But I'm not sure because the flow of a flowitem is not clear to me. We can make this work, just need a little more information.

Thanks,

0 Likes 0 ·