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
|
|||
|
|||
Batching, max wait time
Hi,
In this model, I need the items to be batched by recipe. I'd also need the maxwaittime condition for the batching. Please help. Chieng To clarify, The situation is this. I have items entering queue with labels: priority and recipe. Items are batched in fours and sent to downstream processor. I first sort the items in the queue by priority. 2nd rule is to batch by recipe with max wait time 200. The thing that makes this difficult for me is that the batch option in queue batches all flowitems regardless of labels. I'll further explain upon request. Last edited by Chieng Kai Seng; 08-16-2011 at 01:15 AM. Reason: clarification |
#2
|
|||
|
|||
Just a thought
I thought it would be nice to have features like batch by itemtype or batch by labelname for the "use batching" in queues. The present one allows one to set only the batch size and max wait time, which doesn't really suffice.. imo.
|
#3
|
||||
|
||||
Why don't you sort your item in different queues? That way on every queue you can set the batchsize and max wait time just as you like. If your amount of labels are limited use fixed queues, otherwise make some code that makes it dynamicall (like check if your label is already present in a queue and send it to there. If not find an empty queue etc..)
|
#4
|
|||
|
|||
What if the number of recipes can't be known or is just too many to create a queue for each of them? I get what you mean but from your experience, is it a better practice to code the behavior of an object or to use a lot of objects to "imitate" that behaviour? the model will look kinda messy in the end I think.. haha!
|
#5
|
||||
|
||||
The answer on your question depends on how complex the code is going to be. But whatever you are going to program it will contain some kind of internal queueing system to keep track of what is going on.
So I see at least 2 programming mechanisms here: Don't send out the items of the queue but use the command "releaseitem" and use 1 or more global tables to store the pointers to the items in the table. The moment you have four, you send them out manually. So actually just do the bookkeeping outside the object. Other option might be to really create a queue dynamically. You can make a queue containing all the right settings and store it in a user library. If you get a product in that doesn't have a matching queue, you simply create it and when you are done you destroy it again. This will be getting slower if you have to create a lot of queues and in that case you could move them in and out of a queue store, just like the recycling of flow items that Flexsim has build in. There are probably other ideas possible out there, but these are the ones that come to my mind first and although the second one might not be as fast or elegant as the first, validation might be easier. Anyway see what you can do with it. |
#6
|
||||
|
||||
Because it sounds like as if you only got one Processor and this way there only can be one itemtype used, I´m just thinking about this solution:
Use one queue behind Source and one in front of Processor both connected. The first holds all items. Second got a Batch of four and a max wait time. If second is empty the outputport of first is open and any Item goes to second queue. From now only items with same type can go through the second queue. After releasing all items in second queue, input is again open for every type. Could this be a way?
__________________
Hemmi |
#7
|
|||
|
|||
Steven,
I learnt that the number of recipes in the production line might go up to hundreds or thousands so i think using queue for each recipe is out. Your 1st idea fits better. And I tried it out. So I have this queue with "do not release item" and with codes that "release item" when the batch is met. But thing is, "release item" requires port num. What if I have multiple processors downstream to choose from? I implemented the "pull" system as discussed in previous thread. If there's something that allows me to release item but let downstream processor to pull it'd be great. If you get what I mean. haha.. and seriously, is there no way to batch by labelname or by itemtype while having the "target batch size" and "max wait time" feature in?? This would make a great feature.. Regards |
#8
|
|||
|
|||
Hi Sebastian,
That would be a way if the number of recipe in line is really little. But thing is, that's not the case. haha.. anyway, thanks for the input. Cheers, Chieng. |
#9
|
||||
|
||||
Quote:
Another solution, which in this case might be even better because you seem to want to make special things is to use the BasicFR. That one has no releaseitem so your releaseitem and subsequent sendtoport is the only one they will have. But here you also have to use receiveitem because the BasicFR doesn't receive items by itself. Quote:
Steven |
#10
|
|||
|
|||
Thanks for the input. I'm looking into that.
Steven,
Quote:
Quote:
Cheers, Chieng. |
#11
|
|||
|
|||
Still stucked. Urgent help needed.
Hi,
I attach my latest model here. Please check that the maximum content for SRT01 is 4 before proceeding. First, I'll explain what I'm working on. The minifab has tools(processors) connected to toolgroups(queues). Source generates flowitems according to schedule. Process flow is read into flowitems at Start/sendto. Processors pull flowitems according to their process flow table in the label table of each flowitem. My main issue is batching at FUR. My code works by sorting flowitems in queue by CR(priority) onEntry. Message triggers by userevent causes FUR to decide the batch to release downstream. I use 'releaseitem' here and whether the batch flows by first available or not to be released is decided at FUR/sendto. Stop simulation at time 230, you'll see a batch of green items(recipe b) already at FUR. I assume my codes works perfectly here so that batch of green items should be in the released state but cannot move out of FUR because the available downstream processor(FOX02) is processing. At time 231, a red batch(recipe a) comes in and is released also. meaning a total of 8 flowitems are released. and at that same moment they all move out of FUR. By right, what I need is that green batch appears at FOX02 and red batch appears at FOX03. But the simlation at time 231 gives me a mixture of both at FOX02 and FOX03. I suspect that it's the confusion at FUR when 8 flowitems are released but they are no longer batched but are released as seperate entities. I thought of two possible ways to solve this but I do not know how to implement them. 1. when there is a released batch in FUR(e.g. the green batch in this case), do not batch or do not release anymore batch. 2. mark the released batch(but haven't moved out of queue), and only release them in the way they are batched(same recipe) when downstream processor is available. Please help the rookie here. Tell me if the way I wrote the codes is wrong or should be improved to avoid errors or any other comments. I'll try to use only ONE QUEUE if possible. I appreciate any input. Suddenly hit me, can I create a node to store the batched items and then move the items stored in the node only when downstream processor is available? It works pretty much like a queue I think. Do tell me if this could work and how to implement it. Thanks! Cheers, Chieng |
#12
|
||||
|
||||
hi,
i haven't opened your modell, but you can prevent mixing if you write a special code at the Pull Requirement. If the content of the processor is 0 the return - value is 1. If the processor has already some content, the itemtype must match (getitemtype(item)==getitemtype(last(current))). Jörg |
The Following User Says Thank You to Jörg Vogel For This Useful Post: | ||
Chieng Kai Seng (08-21-2011) |
#13
|
|||
|
|||
Jörg is right about your Pull Requirement. Also, you don't need to use the re-evaluate check box. Please read the user manual help on these to items.
I'm also concerned that your pull requirement will let you down if you have batches of the same type released close together... with the first not being a "full" batch cut short by time. But that depends on what your process rules are. I have uploaded a MultiBatchingQueue here: http://www.flexsim.com/community/for...ead.php?t=1871 |
The Following User Says Thank You to Kris Geisberger For This Useful Post: | ||
Chieng Kai Seng (08-21-2011) |
#14
|
|||
|
|||
Thanks
Kris,
Thanks so much for the model! Took you 2 hrs, took me 1 week. You guys are the experts! Respect. I'll get back if I encounter problems with the code you provide. Do the members of the forum use private message much? If yes then I thought maybe I could make direct communication with some. Cheers, Chieng |
#15
|
|||
|
|||
I don't get what you mean. Are you referring to the pull req I wrote or the one you modified? Do you mean when the first is recipe A batched in 3 and second is recipe B batched in 4?
|
#16
|
|||
|
|||
The situation might not be possible based on your process and data but I'll explain anyway. What if you release a batch of say 3 items of recipe A because max time was reached, but then shortly after (within a FOX2 cycle), a number of recipe A items arrive such that you have another complete batch. When this second batch of recipe A is released, FOX2 still has capacity for 1 more item so the first item of the second batch will go to FOX2 and the rest will go to FOX3. I'm assuming you want to keep the batches together, so I suggest adding a BatchID label or something to differentiate each batch.
On line 14 of the Pull Requirement I wrote I made a comment saying "REPLACE THIS". In my code my condition compares itemtypes, but that really does nothing for you in your model. By comparing BatchID labels the Pull Requirement will make sure that a tool only processes items from the same batch at any given time. |
#17
|
|||
|
|||
If all I need is for the same recipe to be batched together, regardless of how it was batched upstream, the code works right? I've replaced line 14 of Pull Requirement.
|
#18
|
|||
|
|||
So then your line 14 should read:
if(comparetext(getlabelstr(item,"Recipe"), getlabelstr(first(current),"Recipe"))) |
The Following User Says Thank You to Kris Geisberger For This Useful Post: | ||
Chieng Kai Seng (08-21-2011) |
#19
|
|||
|
|||
WPF
This model has an additional group: WPF. I have some problem at this area.
WPF21 and WPF22 are capable of processing 2 items in a batch but has a capacity of up to 8(multiple batches are allowed at the same time on one tool). There is a time interval between each of the batches which is determined by the remaining process time of the last batch on either the processor vs the remaining process time of the batch waiting to come in from the upstream queue. At time 417, there're 4 items in a batch on WPF21(shouldn't happen). How can I correct that? Yes, they are of the same recipe but one batch should only have 2 items. I'm thinking it's the way I code it to closeinput that might be causing the problem. Code is at WPF21/onEntry. The way I book-keep using labels on WPF,WPF21 and WPF22 also doesn't feel robust enough. The rookie needs help. Cheers, Chieng |
#20
|
|||
|
|||
URGENT.
This is the latest model. I have chunked down the problem. The problem occurs at time 525. At time 525.000, the flowitem P1005007.007 at queue WPF moves out of the queue, enters WPF21, exits WPF21, and enters WPF again. I've attached the screenshot of log event to show this. All at the same time. What happened? Why is the process time ignored?
According to the codes, what should have happened is that P105007.007 is batched together with P105007.005, leave WPF and be processed in WPF21 for 30 unit time. Is there a loophole in the code or what? Please advise on how to correct this. Thank you. Chieng. |
Thread | Thread Starter | Forum | Replies | Last Post |
Displaying the simulation time with the various date/time formats. | Regan Blackett | Tips and Tricks | 12 | 11-12-2012 08:01 AM |
What is the exact start time of dewell time? | zhang xin | Container Terminal (CT) Library | 1 | 11-23-2009 10:56 AM |
All time related values 0,0000001 time units delayed | Patrick Cap | Q&A | 2 | 05-01-2009 01:50 AM |
Call Two operators for Repair but wait until both are available | Brandon Peterson | Tips and Tricks | 6 | 10-15-2008 01:12 PM |
batching problem | KelvinHo | Q&A | 9 | 06-25-2008 08:17 PM |