Cancel
Showing results for 
Search instead for 
Did you mean: 

Method to sort MU's

Creator
Creator

Hello all,

I tried to search what I want in the community but I don't understand how this question wasn't asked in the past or else I wouldn't have got the right search..

 

Okay so I have a source.. In it a table file(TableFileInput) containing 3 different types of entity is there for MU selection random and the TableFileInput. Firstly I'm unable to put an attribute here.. May be if somebody help me here to show what should I do to show these three entity with  different colors. I don't want to duplicate entity as entity1,2,3 and change the graphical attribute.

 

Secondly after the MU's move I have a sorter. Now I want each colored item to go to a different path. So in the "exit strategy" of sorter I chose an exit file of "Method" and I'm getting an error there. So if somebody could kindly correct my code I'd be thankful. Below is the code..

 

is
     k: integer;
do
     for k := 1 to TableFileInput.YDim loop
                       if .MUs.entity.name(k):= "A" then
                           @.move(Line)
                      elseif .MUs.entity.name:= "B" then
                         @.move(Line2)
                      else
                          @.move(Line1)
                      end;
     next;
end;

 

 

 

Instead of naming them I wanted to identify them with a color but didn't get how to do that. Hence I named them A, B and C.. But still it gives the error. In the table file I have different frequency of all three entity. Hence I assumed while writing .MUs.entity.Name(k) would mean a kth no. of MU..

 

Thank you in advance..

7 REPLIES

Betreff: Method to sort MU's

Creator
Creator

use "=" instead of ":=" to compare values

 

Exitfile could look like this:

if @.name = "A" then
     @.move(Line)
elseif @.name = "B" then
     @.move(Line2)
else
    @.move(Line1)
end;

simple++ / eM-Plant / Plant Simulation

Re: Method to sort MU's

Siemens Phenom Siemens Phenom
Siemens Phenom
see the spp attached ...

Regards

Always consider using the AttributeExplorer!

Betreff: Method to sort MU's

Creator
Creator

@dst Thank you very much. That might help me for future reference.

But as I said earlier my aim is to sort them with colors and not by their name..

Re: Method to sort MU's

Creator
Creator

@Eventdebugger

Thank you very much.

But this creates more confusion to me. If we can do everything with 'entrance' and 'exit' "controls" and "exit strategy" 'blocking'..

why do we have sorter for?

 

Also will you kindly tell me the diffrence between "frequency" and "number" in the tablefile. What does that mean? I thought frequency 2,5,9 respectively meant that there will be 2 red color entity, 5 green color entity and 9 blue color entity coming to source.. Is it not so? Then what does "number" indicate?

 

Well anyway I'd appreciate if you could kindly help me understand how can I do this using a sorter to go them into different lines..

Re: Method to sort MU's

Siemens Phenom Siemens Phenom
Siemens Phenom
you don't need to use a sorter, just use the exit behavior of the object that releases the parts. the method in the example is just to change the color. if you remove it, the model will sort anyway.

Regards

Always consider using the AttributeExplorer!

Re: Method to sort MU's

Siemens Phenom Siemens Phenom
Siemens Phenom

Hello,

 

regarding your question about the difference between "frequency" and "number" you could have a look at this post

 

https://community.plm.automation.siemens.com/t5/Plant-Simulation-Forum/Percetange-of-Mus-in-Source/m...

 

Kind regards,

Igor
------------------------------------------------------------------------------------------------------
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution


Re: Method to sort MU's

Gears Phenom Gears Phenom
Gears Phenom

Since you still seem to be confused: the object "Sorter" is actually used for sorting MUs into a desired sequence, not for sorting them into different lines. This will always be done by the ExitStrategy, which is used to select one of many successor-objects.

Hope this helps a bit,
Alex

____________________________________________________________
Alex Dilg, Consultant at SimPlan AG (www.SimPlan.de)
This post was good and/or helpful to you? Please provide some Kudos, thank you!