I'm currently leaning about assembly and I a have problem. I have a system which simulates the rental bike shop in a city for a week. The goal of this simulation is to see how many bikes do this bike shop need to provide. The renters are classified using percentage into five different type based on their age. I use a method to create an attribute (color) to color code them.
The problem is if I make the renters/tourists as the main MUs in the assembly conversation, I will have the capacity error ("Load capacity of main MU is not sufficient") but if I make the container (bikes in this case) to be the main MUs, my method for assigning the attribute (e.g. @.Color := "Blue") is not working.
Is that possible to keep the renters as the main MUs rather than the bike? If it is not possible (the bikes must be the main MUs) what is the code to give the color to the renters?
Attached is my plant. Any comments are greatly appreciated.
Solved! Go to Solution.
To assemble two MUs, the main MU needs enough capacity to carry the assembled items. So you cannot use the Entity class if you have "Attach MUs" as the Assembly mode.
The problem in your case is that there is actually no attribute Color defined for your MUs. Your method CreatingAttribute is not called anywhere. Therefore you get the error message in the Classifications method. Instead I would suggest that you simply change the VectorgraphicsColor and VectorgraphicsBorderColor attributes. You already have this partially in place.
By the way, your approach with the Assembly and Dismantle stations is the right one here. I think you might also want to look at the Source options. If you go for "Interval adjustable" (default setting) and "Random" for MU Selection then you are much more flexible to choose different customer mixes. You now give meaningful names quite late, but if you do it in the Source, then you can use the MU name to route them to the right processes with an exit strategy "MU Attribute".
Thanks for taking a look at my case. I'm sorry I meant to put the "creatingattribute" method in the source, thus after they were created they got new attribute called "color".
But the problem still occurs. Thanks for giving me another way by duplicating the Entity into 4 and make the color different, but I'm afraid I probably need more attributes later.
Thus If I want to create the Attribute using a method (@.createAttr), based on your explanation I want to clarify:
- The main MUs defined in the assembly must be the container because the main MU need the dimesions to carry other MUs. The color assigning method in the Assembly will target the main MU thus it should be the containers that I assign the color not the tourists (probably you know the method to give/target the secondary MU color?)
Otherwise, I need to color them before the assembly.
But, It may cause another problem if I want to identify the MUs by it's color later somewhere in the system. What's the method for identifying secondary MUs (attached MUs) since @.Color will target the container?.
- Entity can't be the main MUs since they dont have X Y dimensions.
From your message I cannot conclude if you got the whole thing.
Basically, you can assemble bikes to customers and customers to bikes, depending on the kind of statistics that you want. If you attach an MU, the main MU needs to offer capacity to do so. It does not matter what kind of MU you put onto the main part.
There may be a nice example for you in the Exampels collection (start page of the software): Discrete material flow>>Source>>Random MUs.
Then how to specify the dimensions, since there arent dimension conversation for entity class:
And also how to assign color/attribute to the secondary MUs using a method?
The main MU should be a Container, its loading capacity is defined by the XDim and YDim attributes. The dimensions of the MUs just specify how big the object is in space, but not what it may contain.
Please look at the attached example, may it gives some inspiration. It uses the Attributes column to set the color attributes (you know how to do the same with SimTalk).
Thank you very much Gert, now my assembly has worked exatcly as I wanted.
two more questions,
1. after I sucessfully assemble my MUs, I want to combine the procces time for all different colored MUs in one parallelproc. The problem should be similar like this Process Times based on MU not on container, the different is I want to refer different process time (constant) for each colored MUs using a method. Since using list(type) is not working,
2. how to delete attribute that have been created? I tried @.deleteAttr("Color") but it doesnt work.