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
|
|||
|
|||
Add nodes in a label
Hello. I have created a label named "Items", in a Task executer's page. Asource generates the task executers.
The task executers can be itemtype 1, or itemtype 2. They travel throuh the model in order to pick items. I want, the task executers of itemtype 1 to pick <= 20 items and the task executers of itemtype 2, to pick >21 and <= 149 items. I tried to do this by adding nodes in the label "Items", but i don't know how to add nodes that should be more than 21. I "ve used the code (for items < 20): int NumberOfItems = duniform(1,20,1); for (int i = 1; i <= NumberOfItems; i++) { nodeinsertinto(Items); treenode Last = last(Items); nodeadddata(Last,DATATYPE_NUMBER); } I can add more than 1, but not more than 21. Is there a way? |
#2
|
||||
|
||||
Hi,
the function duniform(1,20,1) returns values between 1 and 20. Try instead of 20 perhaps 31. Or you use a constant value instead of a distribition function. Jörg |
#5
|
|||
|
|||
Thanks for your reply. But if i write this code, then they will pick <= 31 items.
I want them to pick more than 21 items and less than 149. Is there a way to add a certain number of nodes in a label and this number to be >= 21 and <= 149? |
#6
|
|||
|
|||
Hi,
If I understand right, then I would do something like this Code:
int NumberOfItems; int StartLevel; int EndLevel; switch (getitemtype(item)) { case 1: StartLevel=1; EndLevel=20; break; case 2: StartLevel=21; EndLevel=148; break; } NumberOfItems=duniform(StartLevel,EndLevel); for (int i=1; i<=NumberOfItems; i++) { ..... } |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
vasiliki grigorakaki (02-19-2012) |
#7
|
|||
|
|||
Thank you, but using that code, they don't pick any item. I can't see what is wrong. If I am right, when i write for example, a "for" loop, looking like this: for (int i = 21; i <= 149; i ++)
{ nodeinsertinto(Items); treenode Last = last(Items); nodeadddata(Last,DATATYPE_NUMBER); } then it will add a number of nodes, into the label "Items", between 1 and 128 and not between 21 and 149. So, the operators, would pick items between 1 and 128 and not more than 21 and less than 149. Am i wrong? |
#8
|
|||
|
|||
Hi,
Only to add the label "Items" and then insert nodes into that label will not cause the TE to pick up items. After adding the nodes you need probably write your own task sequence logic to pick up correct number of items from your model. Even if you have a label called "Item" on the TE, the TE will not understand what to do with that label. A label only stores information and you as modeller need to tell what to do with that information. Lars-Olof |
#10
|
|||
|
|||
I know.That's not the whole code. Everything works fine, but only for those who have to pick items <= 20. The others TE pick a number of items between 1 and 149. So, the only problem i have is that i don't know how to make the second team (the second itemtype), to pick only 21 and more items and Not < 21.
|
#11
|
||||
|
||||
Hello Vasiliki,
search for other posts, which contain the control of loading more flowitems. Your Taslexecuter has to have a maximum content for all 149 flowitems. You can set the maximum content depending on the first loaded item. Or you control the loading activity in the break to requirement function. Jörg |
#12
|
|||
|
|||
I really thank you for your help.I don't know if this could be done, because the TE are shoppers and they hold Carts. So Carts are the First Items for the TE. If they were just TE that pick items with their hands, it would be simpler.
So there isn't a command that can add certain number of nodes in a label? I 've searched a lot, in the commands but i can't find such a command. |
#13
|
||||
|
||||
let the TE have a maximum content of two while it is collecting and change the value back to one if it is not collecting any more.
If you do it at the right time the internal logic of flexsim does the right loading over the function "break to" Requirement. Jörg |
#14
|
|||
|
|||
How can i control the loading activity in the "Break" to requirement?
Can I separate the TE by itemtype and define how many items they should pick, in the "Break" to requirement? Furthermore, what is the right time, that you mean in the maximum capacity? Can you be more specific please? Last edited by vasiliki grigorakaki; 02-20-2012 at 10:41 AM. |
Thread | Thread Starter | Forum | Replies | Last Post |
Cannot use label | Jack Lai | Flexsim Student Forum | 7 | 11-24-2011 03:41 AM |
Problem with the value of a label | Clement Schaller | Q&A | 3 | 03-15-2011 09:44 AM |
Add Label | Nischith Kashyap | Q&A | 4 | 03-14-2011 07:16 PM |
Record label | manuel fernandez | Q&A | 1 | 03-21-2010 12:29 PM |
how to set preempt by label? | Vic Li | Q&A | 4 | 10-19-2008 01:51 AM |