ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#1
|
|||
|
|||
Content of an object - itemtype specific
Hi all!
I have a question regarding the command "content": Is there a way to read out particular (itemtype specific) items from one object that contains several itemtypes? In my model the production line contains one queue ("WS2") that can contain several itemtypes. This queue WS2 is the successor stage of several other queues that constantly release items to this queue. Splitting up WS2 into itemtype specific queues is not possible (that would solve my problem I know). In the OnExit Trigger of the object I want to define a variable that counts me the actual number of flow items of a particular itemtype. This variable will be used for futher calculation. I write: Code:
treenode item = parnode(1); treenode current = ownerobject(c); int port = parval(2); treenode WS2; WS2=node("/WS2", model()); int WS2content = content(WS2); Thank you for your help in advance!!! Best wishes! Simon |
#2
|
||||
|
||||
Simon,
there are two basic options to do this: 1. Count every single item entering or leaving by itemtype. I did that for the queue in the model attached. It has three labels, one for each itemtype and the labels are updated OnEntry and OnExit. The advantage is, that you always have accurate figures for each itemtype without calculation. 2. Only count when you need an actual number. I created a user command ("Tools/User Commands") which you can call from anywhere in the model with an object to search and and itemtype you are looking for. It runs through the content of the object and adds up flow items with the matching itemtype. You can call the sample in the script window. This will be slower than option 1. for large queues and frequent calls. Let us know, if that helps you. Best wishes Ralf FlexSim |
The Following 6 Users Say Thank You to RalfGruber For This Useful Post: | ||
Tom David (06-12-2014) |
#3
|
||||
|
||||
Hi Simon,
Here is a solution illustrating your requirement. Regards, Arun KR |
The Following User Says Thank You to arunkrmahadeva For This Useful Post: | ||
Simon Jutz (06-12-2014) |
#4
|
||||
|
||||
Hello Simon,
you can give the function: forobjecttreeunder(obj.) { } a try, too. You find more information in the command manual. Jörg |
The Following 4 Users Say Thank You to Jörg Vogel For This Useful Post: | ||
Simon Jutz (06-12-2014) |
#5
|
|||
|
|||
Thank you guyy for the many replies!
I have choosen the first way Ralf proposed me! It works fine and I can now calculated with this information! Related to this, I have a further question: As I said, I define several variables to make the following query: Code:
treenode FGI7; treenode WS2; treenode ProductionLine2; FGI7=node("/FGI7", model()); WS2=node("/WS2", model()); ProductionLine2=node("/ProductionLine2", model()); int WS2content = getlabelnum(WS2, "Product7"); int ProductionLine2content = getlabelnum(ProductionLine2, "Product7"); int FGI7content = content(FGI7); int I7content = content (current); int Reordered = getlabelnum(current, "Reordered"); int ReorderPoint = getlabelnum(current, "ReorderPoint"); int ReorderQuantityP7 = getlabelnum(current, "ReorderQuantityP7"); treenode SourceRaw = centerobject(current, 7); // FIRST CHECK CAN'T HAPPEN BEFORE INITIAL CONTENT IS IN FGI if((time() > 1) && (I7content + WS2content + ProductionLine2content + FGI7content + Reordered) <= ReorderPoint) { senddelayedmessage(SourceRaw, 0, current, ReorderQuantityP7); } Thanks again for your help! Simon |
#6
|
||||
|
||||
Simon,
time() doesn't mean the code is executed continuously. It only replaces time() with the current simulation time at the point this function is called. If you put the code on an exit trigger it will be fired on exit only. If you want it to be fired timebased you can do either one: - Create a UserEvent with a repeat interval or - Send a delayed message on the object itself and in the messagetrigger you send the delayedmessage again with the delaytime being your check interval Here's the question: The beauty of discrete event simulation is, that you can use events to execute functionality when the system changes. Time based calls actually are using a lot of CPU performance, even when there are no changes in the system. Unless the real time system does time based calls (which a KanBan does not do, returning KanBan cards in general triggers events) I can see no reason to use time based calls in your model. Please explain a little more, what you try to achieve. Thanks Ralf FlexSim |
#7
|
|||
|
|||
Well, it is more a question of argmentation of the model design in my case. With very short interval in my demand process I can argue a "continuous" demand pattern, although it is technically quite difficult to implement. Therefore the small time intervals. I THOUGHT that the query I have shown is time-continuous and that these two modeling strategies are difficult to propose (a almost continuous demand process and a classical continuous review process).
Now, I know more. So each time an item leaves the object the stock level is checked. Thus it is actually a PERIODIC review system, right? I won't change anything by now I think and will put my thoughts together to see how things can be explained reasonably. Thanks!! |
The Following User Says Thank You to Simon Jutz For This Useful Post: | ||
RalfGruber (06-12-2014) |
Thread | Thread Starter | Forum | Replies | Last Post |
Process Maximum Content (depends on itemtype) | shafizad | Q&A | 4 | 03-04-2015 07:53 AM |
Periodic Pull Strategy - itemtype specific | Simon Jutz | Q&A | 20 | 06-14-2014 04:44 AM |
Dashboard Graph Content vs Time for Fluid object | Abdul Mirza | Q&A | 3 | 05-10-2013 08:29 AM |
Specific Path for TaskExecuters | Scott Mullen | Flexsim Student Forum | 5 | 03-25-2013 03:32 AM |
closing specific port# | George Serhan | Q&A | 3 | 01-07-2013 05:17 AM |