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 03-05-2010
claudia gertheinrich claudia gertheinrich is offline
Flexsim User
 
Join Date: Nov 2009
Location: Warstein, Germany
Posts: 16
Downloads: 48
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 128
claudia gertheinrich is on a distinguished road
Default Problem in sorting products by jobnum

Hi everyone!

I have 2 processors connected to 6 racks with a max content of 35 each.
I want to send my products to the racks according to their jobnumbers, which are stored on an itemlabel called "jobnum".
Each rack may only have one job in it at a time. The product quantity of each job changes.
On both processors I chose the picklist option "matching itemtypes" in the flow tab and changed it, so that it looks for "jobnum" and not for "itemtype".
It seemed to work at first side, but sometimes if , for example, processor1 has a time delay between two products of the same jobnumber (e.g. job 3) and processor 2 has products to send (e.g. job 6), the according rack of processor1 with content 12 of current job (job 3) is filled up to content 35 with job 6 of processor2 and the rest of job 3 is send to the next rack with content 0.

Here is the code I use in the two processors:

treenodeitem = parnode(1);
treenode current = ownerobject(c);
/**Matching Itemtypes*/
/** \nSend flowitem to the output port connected to an object that contains flowitems whose itemtype matches the itemtype of the involved flowitem.*/
double curjob = getlabelnum(item,"jobnum");
int outportindex;
int flowitemindex;
int nrofoutports = nrop(current);
int nrofflowitems;
treenode tempoutobject;
for(outportindex = 1; outportindex <= nrofoutports; outportindex++)
{
tempoutobject = outobject(current, outportindex );
nrofflowitems = getlabelnum(rank(tempoutobject,1),"Quantity");
for(flowitemindex = 1; flowitemindex <= nrofflowitems; flowitemindex++)
if(curjob == getlabelnum(rank(tempoutobject, 1),"jobnum"))
return outportindex;
}
for (outportindex = 1; outportindex <=nrofoutports; outportindex++)
{
tempoutobject = outobject(current,outportindex);
if (content(tempoutobject) == 0)
return outportindex;
}
return 0;

I do not see my mistake. Somehow I think I need to save the current port in the processors, but do not know how to solve this...

Hope you understand the problem and have any help?
Thanks a lot, Claudia
  #2  
Old 03-09-2010
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

Claudia,

here you find my modified code with the two changes I made:

treenodeitem = parnode(1);
treenode
current = ownerobject(c);
/**Matching Itemtypes*/
/** \nSend flowitem to the output port connected to an object that contains flowitems whose itemtype matches the itemtype of the involved flowitem.*/
double curjob = getlabelnum(item,"jobnum");
int outportindex;
int flowitemindex;
int nrofoutports =
nrop(current);
int nrofflowitems;
treenode tempoutobject;
for(outportindex =
1; outportindex <= nrofoutports; outportindex++)
{
tempoutobject =
outobject(current, outportindex );
nrofflowitems =
content(tempoutobject); // HERE YOU NEED TO GET THE NUMBER OF FLOWITEMS IN THE TEMP RACK
for(flowitemindex = 1; flowitemindex <= nrofflowitems; flowitemindex++)
if(curjob ==
getlabelnum(rank(tempoutobject, flowitemindex),"jobnum")) // HERE YOU HAVE TO LOOK AT THE flowitemindex RANKED ITEM NOT THE FIRST
return outportindex;
}
for (outportindex =
1; outportindex <=nrofoutports; outportindex++)
{
tempoutobject =
outobject(current,outportindex);
if (
content(tempoutobject) == 0)
return outportindex;
}
return
0;

This seems to do the job as far as I understood it was supposed to be done. If not please come back to me or send me your model by email.

Best regards

Ralf
aka ralle

Flexsim Germany
The Following 2 Users Say Thank You to RalfGruber For This Useful Post:
Tom David (03-11-2010)
  #3  
Old 03-11-2010
claudia gertheinrich claudia gertheinrich is offline
Flexsim User
 
Join Date: Nov 2009
Location: Warstein, Germany
Posts: 16
Downloads: 48
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 128
claudia gertheinrich is on a distinguished road
Default

Hello Ralf!

Thanks for your help. I'll try it and give you a response...
  #4  
Old 03-11-2010
claudia gertheinrich claudia gertheinrich is offline
Flexsim User
 
Join Date: Nov 2009
Location: Warstein, Germany
Posts: 16
Downloads: 48
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 128
claudia gertheinrich is on a distinguished road
Default

I realized that I already tried it that way, but it is not working.

My model is very big, thus didnt upload.
I'll try to build a sample model, that will show the problem. So it will be easier to understand, I suppose.

Already found a solition, but it doesnt fit the situation exactly.
Will upload a sample of it, too.

Give me a moment...
  #5  
Old 03-11-2010
claudia gertheinrich claudia gertheinrich is offline
Flexsim User
 
Join Date: Nov 2009
Location: Warstein, Germany
Posts: 16
Downloads: 48
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 128
claudia gertheinrich is on a distinguished road
Default

Well, this is my solution of the problem.
I put a controlqueue between proc1, proc2 and the racks. This queue controls, which rack is empty and not filled with the current job.

The problem is, that in my original model the mounting_1 process has a process time of 1800 (much longer than in the sample). Therefore the items in proc2 have to wait a very long time, before the job in mounting_1 is finished and the controlqueue releases the job.
In reality, while mounting_1 is still processing a job, proc2 can release its current job to a rack, if ready.

Tried to put 2 controlqueue in between. But then the original problem comes back...
Attached Files
File Type: zip Sample_Problem_with_jobnum_solution_own.zip (144.9 KB, 147 views)
  #6  
Old 03-11-2010
claudia gertheinrich claudia gertheinrich is offline
Flexsim User
 
Join Date: Nov 2009
Location: Warstein, Germany
Posts: 16
Downloads: 48
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 128
claudia gertheinrich is on a distinguished road
Default

Ok. Now I'm all confused.
Tried to build a sample model of my original problem, but now Ralf's solution works!

So, here is the solution and not the problem.
Attached Files
File Type: zip Sample_Problem_with_jobnum.zip (106.5 KB, 150 views)
  #7  
Old 03-11-2010
claudia gertheinrich claudia gertheinrich is offline
Flexsim User
 
Join Date: Nov 2009
Location: Warstein, Germany
Posts: 16
Downloads: 48
Uploads: 0
Thanks: 5
Thanked 1 Time in 1 Post
Rep Power: 128
claudia gertheinrich is on a distinguished road
Default

Just had a look at the model where I tried Ralf's solution earlier.
Guess what...
I "just" forgot the "jobnum" in the if-statement
if(curjob == getlabelnum(...,"jobnum")

Aaargh! 2 weeks gone...
  #8  
Old 03-11-2010
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 319
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

Hello,
in the first model you shared, is in the OnEntry trigger still some code of the idea you got it from Probably this gives some mistakes!?
__________________
Hemmi
  #9  
Old 03-11-2010
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 319
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

Ok I found my fault, the "batchsize" variable is used correct I think. This means no mistake this way. Sorry, just an little too bussy the last time. Will try to proof my statements before I give some the next time
__________________
Hemmi


Thread Thread Starter Forum Replies Last Post
Sorting and Stacking multi products Simon Zaw Q&A 5 08-05-2014 01:16 AM
Sorting a list of nodes in the tree Ben Wilson Tips and Tricks 3 02-27-2013 07:10 AM
Pulling from a Queue vs Sorting the Queue Brandon Peterson Tips and Tricks 3 03-03-2010 01:27 AM
Vitor - warehouse operations for long steel products vgeorge Pre-sales Questions 2 07-12-2008 09:52 AM
Queue Sorting Jeff Nordgren Q&A 12 05-22-2008 03:21 PM


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.