question

gilbert jerald avatar image
2 Likes"
gilbert jerald asked Matthew Gillespie edited

how to give priority for an operator to take an item from queue to processor when two item arrives at the same time

in my model i have two queue and a single processor and a operator ,two different item will arrives at the queue at same time here how can i give priority that the operator will take more item from queue 1 when compare to queue 2 (for example 5 item from queue 1 and 3 item from queue 2, ) this is done to increase the output based on the demand for a particular item which means if the customer order item 1 more, when compare to item 2 ,here i want to increase the item 1 production more when compare to item 2 to satisfied the customer, for that how can i adjust the operator to pick the item based on demand by giving priority, here i have attached my model for your referencepriority-model.fsm

Choose One
operatorflowitempriorityflowitem routing
priority-model.fsm (20.7 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.

Brandon Peterson avatar image
5 Likes"
Brandon Peterson answered

Gilbert,

The flow of the items is not controlled by the operator but by the queues and the processor. The reason for this is that the task sequence for the operator is not generated until after the flowitem has been released to travel from one of the queues to the processor. If you had a situation where more than one of the flowitems could be released at the same time (i.e. one queue to another queue) then you could change some of the properties on either the task sequences or the operator to prioritize the task sequences.

In your model you don't need to make any changes to the operator but rather to the flow logic on the queues and/or processor. I was able to modify your model to give priority to the queue with the most flowitems by changing the pull strategy on the processor. Using the option "Longest Queue if Ready" causes the processor to pull items from the queue with the highest content.

If this doesn't answer your question directly (demand might not be represented by the content of the queues) then I would recommend changing the code of this pick list option to look at the parameter that represents your demand instead of the content of the queues.

I hope this helps,

Brandon

5 |100000

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

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered

If you have a nearly static distribution of items to be pulled, you can use a dempirical distribution function in the Pull From Port method.

You set the probabilties in a global table. You can change these values during simulation, if you need another distribution. The command is:

settable(string tablename,row,column,value)

Please read the command help to this command, too.1955-priority-model-3jv.fsm


kt2zy.png (95.0 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.

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joerg Vogel edited

Gilbert,

if you don't depend on the pull strategy you can define a preferred itemtype in the processor and control the output of the queues. I switch off Pull in the Flow Tab and placed the following code in the onProcessFinish trigger.

/**Custom Code - open outputs of queues next items matches 
   preferred itemtype*/
treenode item = param(1);
treenode current = ownerobject(c);
treenode testitem = NULL; // pointer to the item to compare
treenode testQueue; // pointer to the station the tested item stays
int port; // input ports of the processor
for(port = 1; port <= nrip(current); port++){ 
    // search over all input objects of the processor   
	testQueue=inobject(current,port);   
	testitem = first(testQueue);   
    if(getitemtype(testitem)==getlabel(current,"preferType")){     
      // I created a label in the processor to identify the 
      // preferred itemtype change the labelvalue if the demand
      // changes to another itemtype
    colorred(testitem); 
	// just change the color to identiy the item     
	openoutput(testQueue); 
	//let this queue send items    
     }   
     else closeoutput(testQueue);}
     if (!objectexists(testitem))
	// no items queued, open all queues outputs testitem was 
        // initialized with NULL and stays unchanged     
	for(port = 1; port <= nrip(current); port++)     
	  openoutput(inobject(current,port));

If the demand changes for another itemtype, change the value of the label preferType in the processor. 1955-priority-model-2jv.fsm


5 |100000

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