question

Paulina B6 avatar image
0 Likes"
Paulina B6 asked Jeanette F commented

Order of calls through list

Good morning, I want to know if in some way these processors can be configured to serve as follows:


procesor 1 5 4 3 2 1
procesor 2 3 2 1 5 4
procesor 3 1 5 2 3 4


1678486000328.png

In addition to this, I want this order to be able to be changed manually in each processor and that if there are no boxes in any of the queues, it should still call the queues if there are boxes.

thank you so much

Logica.fsm

FlexSim 22.2.1
procesorlist pull from listusing lists
1678486000328.png (305.6 KiB)
logica.fsm (27.8 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.

1 Answer

Jeanette F avatar image
0 Likes"
Jeanette F answered Jeanette F commented


Hello @Paulina B6 ,

I added your table into your model as a Global Table. I fixed the row headers so that they matched the processor names in your model.

On each processor, you can add a pull strategy that is custom code. 1678571874823.png

This custom code uses a label on the processor to tell what index the processor is at in the pull sequence. This sequence index is initialized as 1 so we first increment if the processor has pulled its first item (This is because the pull strategy is evaluated on reset so we don't want it to increment until the model starts). Then evaluate what port should be used for this index in the sequence as defined in your global table. Lastly this code checks to see if the sequence index needs to be reset by making sure the index does not exceed the number of columns in the table

  1. Object current = ownerobject(c);
  2.  
  3. /**Custom Code: Port Sequence defined in Global Table*/
  4.  
  5.  
  6. int Port = 0;
  7. Table PortSequenceTable = Table("GlobalTable1");
  8. string Row = current.name;
  9. int Column = 0;
  10.  
  11.  
  12. if(current.stats.input.value > 0){
  13. current.PortSequenceIndex++;
  14. }
  15.  
  16.  
  17. Column = current.PortSequenceIndex;
  18. Port = PortSequenceTable[Row][Column];
  19.  
  20.  
  21. if (current.PortSequenceIndex >= PortSequenceTable.numCols){
  22. current.PortSequenceIndex = 0;
  23. }
  24.  
  25.  
  26. return Port;


logica_1.fsm



logica-1.fsm (29.2 KiB)
1678571874823.png (8.2 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.