Cancel
Showing results for 
Search instead for 
Did you mean: 

Reading values from MUs from multiple buffers, comparing them

Valued Contributor
Valued Contributor

Hello Community!

I have an advanced challenge this time.
I have a few (here 5) buffers in a subframe.
What I want to do is, reading an integer, which is a custom user attribute on the MUs;
from within 5 buffers at once.
The reason being, using a priority ruling to send different MUs into the machine for processing.
How could I possibly access these integers at once in an efficient way?
 get? inspect? I am not sure. My method is placed as entry strategy on my machine so far...
Thank you very much, like always!
I attach 3 screenshots to illustrate the problem.

 

ENGLISH

advanced3.PNG

GERMAN
advanced.PNG

Network with the 5 buffers and the machine (MAHO)


advanced2.PNG

4 REPLIES 4

Re: Reading values from MUs from multiple buffers, comparing them

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
one strategy could be to insert all data into a table. Then you can sort by a column, create sub-sets - sort them anew… (but this will be bad for the performance, if the model is big).
table: decision, first column: object (MU), second column: order_number and so on
for better handling it is better to have also the buffer (references) in a list or table

decision.delete
var i,k:integer
for i:=1 to bufferTable.yDim loop
  for k:=1 to bufferTable[1,i].numMu loop
     decision.writeRow(1,decision.yDim+1,bufferTable[1,i].Mu(k),bufferTable[1,i].Mu(k).orderNumber) --and so on
  next
next
--sort by column 2
decision.sort(2,"up")

I prefer to use databases to do such tasks (SQLite interface). So I can use SQL for searching and I can avoid complex table operations.
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Reading values from MUs from multiple buffers, comparing them

Valued Contributor
Valued Contributor

SQL looks promising and it's very commonly used.

But maybe I can solve this still within Plant Simulation.
Would it help to place all parts in 1 buffer;
and then using a command like
"get the smallest order number"
"if you have 2"
"get the highest processing stage"
"if you have 2"
"get the shortest pending processing time"
"choose part type"
"move part type until none left and process them"

my biggest problem is still, how to access (get) an attribute from within a method
on a different object. They are contained in the list of contents...

Re: Reading values from MUs from multiple buffers, comparing them

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
the contentslist contains object links, these you can use to access also the attributes of the objects e.g.


var t:table
buffer.contentsList(t)
--print the name of the first part in the contents list
print t[1,1].name


Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Reading values from MUs from multiple buffers, comparing them

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
see also

<table>.minAttr
<table>.maxAttr
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net