ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 02-18-2012
vasiliki grigorakaki vasiliki grigorakaki is offline
Flexsim User
 
Join Date: Apr 2011
Posts: 42
Downloads: 39
Uploads: 0
Thanks: 18
Thanked 0 Times in 0 Posts
Rep Power: 112
vasiliki grigorakaki is on a distinguished road
Default 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  
Old 02-18-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

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
  #3  
Old 02-18-2012
vasiliki grigorakaki vasiliki grigorakaki is offline
Flexsim User
 
Join Date: Apr 2011
Posts: 42
Downloads: 39
Uploads: 0
Thanks: 18
Thanked 0 Times in 0 Posts
Rep Power: 112
vasiliki grigorakaki is on a distinguished road
Default

I use a duniform (1,20,1) for the people who have to take items<= 20.
The other people have to take > 20. How can i use the constant value?What do you mean?
  #4  
Old 02-18-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Try
Code:
for (int index = 1; index <= 31;index++)
{
...
}
  #5  
Old 02-19-2012
vasiliki grigorakaki vasiliki grigorakaki is offline
Flexsim User
 
Join Date: Apr 2011
Posts: 42
Downloads: 39
Uploads: 0
Thanks: 18
Thanked 0 Times in 0 Posts
Rep Power: 112
vasiliki grigorakaki is on a distinguished road
Default

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  
Old 02-19-2012
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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++)
{
    .....
}
Lars-Olof
The Following User Says Thank You to Lars-Olof Leven For This Useful Post:
vasiliki grigorakaki (02-19-2012)
  #7  
Old 02-19-2012
vasiliki grigorakaki vasiliki grigorakaki is offline
Flexsim User
 
Join Date: Apr 2011
Posts: 42
Downloads: 39
Uploads: 0
Thanks: 18
Thanked 0 Times in 0 Posts
Rep Power: 112
vasiliki grigorakaki is on a distinguished road
Default

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  
Old 02-19-2012
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

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
  #9  
Old 02-19-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Lars-Olof has more constructive answer.

Jörg
  #10  
Old 02-19-2012
vasiliki grigorakaki vasiliki grigorakaki is offline
Flexsim User
 
Join Date: Apr 2011
Posts: 42
Downloads: 39
Uploads: 0
Thanks: 18
Thanked 0 Times in 0 Posts
Rep Power: 112
vasiliki grigorakaki is on a distinguished road
Default

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  
Old 02-19-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

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  
Old 02-19-2012
vasiliki grigorakaki vasiliki grigorakaki is offline
Flexsim User
 
Join Date: Apr 2011
Posts: 42
Downloads: 39
Uploads: 0
Thanks: 18
Thanked 0 Times in 0 Posts
Rep Power: 112
vasiliki grigorakaki is on a distinguished road
Default

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  
Old 02-20-2012
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

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  
Old 02-20-2012
vasiliki grigorakaki vasiliki grigorakaki is offline
Flexsim User
 
Join Date: Apr 2011
Posts: 42
Downloads: 39
Uploads: 0
Thanks: 18
Thanked 0 Times in 0 Posts
Rep Power: 112
vasiliki grigorakaki is on a distinguished road
Default

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


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.