question

XinLiang S avatar image
0 Likes"
XinLiang S asked ·

Why operator load 2 items to MultiProcessor other than 1?

In the project, I want to keep 1 item only in MultiProcessor for processing.

But the operator load 2 items after 1st item exit.

multiprocessortest.fsm

Anything problem caused by the following code in OnProcessFinish?

Object current = ownerobject(c);
Object item = param(1);
int opnum = param(2);


int numOfCuts = current.attrs.variables.find("optable").subnodes.length;
double item0length = 1.8;
if(opnum < numOfCuts){
	
	createcopy(item,current,1,0,1,0);
	Object cutitem = current.last;
	releaseitem(cutitem,1);
}
multiprocessor
multiprocessor.png (194.7 KiB)
5 |100000 characters needed characters left characters exceeded

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

1 Answer

· Write an Answer
Joerg Vogel avatar image
1 Like"
Joerg Vogel answered ·

There is a new feature in FlexSim since the cutting multiprocessor. The mechanism of moving objects has changed. When you release or move an item the MultiProcessor receives automatically an item. The workaround is to create the cutted part somewhere else than directly in the MultiProcessor - for example in the model directly or inside a copied object in the tree of the MultiProcessor. You can place a invisible queue in your model, too. Then you move the cutted part by the command moveobject to your destination object and you update the output statistic of the MultiProcessor.

The attached MultiProcessor creates the cutted part inside a queue object in the drawsurrogate treenode under visual. The ProcessFinish trigger contains some further hints as comments.


· 1
5 |100000 characters needed characters left characters exceeded

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

Thanks for your reply. The attached works OK to fulfill the requirements of my project.

Alternatively, I have tried many ways and find it is also ok as below codes. The only modification is to move the openinput from On Exit to On Message event. It may help to bypass some loading events triggered by FelxSim.

On Exit Event:
  if(current.subnodes.length == 1) 
	senddelayedmessage(current, 1, current);
On Message Event:
  openinput(current);
1 Like 1 ·

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.