Go Back   Flexsim Community Forum > Flexsim Software > Q&A
FAQ Downloads Calendar Search Mark Forums Read vBExperience Register

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 03-05-2010
claudia gertheinrich claudia gertheinrich is offline
Flexsim User
 
Join Date: Nov 2009
Location: Warstein, Germany
Posts: 16
Thanks: 5
Thanked 1 Time in 1 Post
Downloads: 48
Uploads: 0
Rep Power: 13
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
Reply With Quote
  #2  
Old 03-09-2010
RalfGruber's Avatar
RalfGruber RalfGruber is offline
Flexsim Germany, Forum Moderator
 
Join Date: Jul 2007
Location: Hamburg, GERMANY
Posts: 71
Thanks: 219
Thanked 93 Times in 39 Posts
Downloads: 32
Uploads: 0
Rep Power: 100
RalfGruber is a jewel in the roughRalfGruber is a jewel in the roughRalfGruber is a jewel in the rough
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
Reply With Quote
The Following 2 Users Say Thank You to RalfGruber For This Useful Post:
claudia gertheinrich (03-11-2010), Tom David (03-11-2010)
  #3  
Old 03-10-2010
claudia gertheinrich claudia gertheinrich is offline
Flexsim User
 
Join Date: Nov 2009
Location: Warstein, Germany
Posts: 16
Thanks: 5
Thanked 1 Time in 1 Post
Downloads: 48
Uploads: 0
Rep Power: 13
claudia gertheinrich is on a distinguished road
Default

Hello Ralf!

Thanks for your help. I'll try it and give you a response...
Reply With Quote
  #4  
Old 03-10-2010
claudia gertheinrich claudia gertheinrich is offline
Flexsim User
 
Join Date: Nov 2009
Location: Warstein, Germany
Posts: 16
Thanks: 5
Thanked 1 Time in 1 Post
Downloads: 48
Uploads: 0
Rep Power: 13
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...
Reply With Quote
  #5  
Old 03-11-2010
claudia gertheinrich claudia gertheinrich is offline
Flexsim User
 
Join Date: Nov 2009
Location: Warstein, Germany
Posts: 16
Thanks: 5
Thanked 1 Time in 1 Post
Downloads: 48
Uploads: 0
Rep Power: 13
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, 21 views)
Reply With Quote
  #6  
Old 03-11-2010
claudia gertheinrich claudia gertheinrich is offline
Flexsim User
 
Join Date: Nov 2009
Location: Warstein, Germany
Posts: 16
Thanks: 5
Thanked 1 Time in 1 Post
Downloads: 48
Uploads: 0
Rep Power: 13
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, 15 views)
Reply With Quote
  #7  
Old 03-11-2010
claudia gertheinrich claudia gertheinrich is offline
Flexsim User
 
Join Date: Nov 2009
Location: Warstein, Germany
Posts: 16
Thanks: 5
Thanked 1 Time in 1 Post
Downloads: 48
Uploads: 0
Rep Power: 13
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...
Reply With Quote
  #8  
Old 03-11-2010
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Germany
Posts: 66
Thanks: 49
Thanked 32 Times in 16 Posts
Downloads: 14
Uploads: 0
Rep Power: 38
Sebastian Hemmann will become famous soon enoughSebastian Hemmann will become famous soon enough
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
Reply With Quote
  #9  
Old 03-11-2010
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Germany
Posts: 66
Thanks: 49
Thanked 32 Times in 16 Posts
Downloads: 14
Uploads: 0
Rep Power: 38
Sebastian Hemmann will become famous soon enoughSebastian Hemmann will become famous soon enough
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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -6. The time now is 08:26 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Powered by NuWiki v1.3 RC1 Copyright ©2006-2007, NuHit, LLC
Copyright 1993-2010 Flexsim Software Products, Inc.