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
|
|||
|
|||
MergeSort Spacing Rule For Recirculation
Hi!
I just finished Flexsim Basic Training. To practice Flexsim and to learn more about the FlexScript, I downloaded a demo model from the download page and tried to test it. One model I tried is "Demo_ConveyorSortingSystem" (Author: Tom David). It helped me a lot to understand MergeSort conveyor. I played with it by changing arrival rate to see the behavior of the MergeSort. One thing that I realized is that, however, when the arrival rate is too fast (expo. 1 sec), the recirculation flow doesn't seem right. The flowitem that passes its sort lane disappears at the end of MergeSort conveyor, and instantaneously reappears at the beginning of the MergeSort. It wouldn't take the reciculation conveyor. To fix this, I modified "Send Requirement" script. It is a very simple change and seems to work fine. However, from time to time, some of the recirculated flowitem seem to ignore the MergeSort conveyor's "spacing rule" and overlap onto the other flowitem. if the overlapped particular flowitem reaches to the recirculation again (at the end of MergeSort), it even ignores the script and reappears instantaneously at the begining point again. Could you please let me know what I missed and did wrong? For your review, modified demo model is attached. (I assume this modification and reposting the model with different name here is ok??) Last edited by Sung Kim; 01-18-2008 at 03:03 PM. |
#2
|
||||
|
||||
Sung,
First of all I like to suggest, if people do not use the official version 4.01, but a beta version 4.30 (release from?) they should mention in the post, which version they used to build the model. Please do not fell offended, but this will make life easier . I had a look into your model and you are right, there is an issue, and that’s why I built a different model called SortingCircleConveyor_TD which you can find in the User Concept section of the Downloads. In this model I address the issue and solved it in my eyes. I tried to figure out, how you start to solve this problem and had a look into the Send Requirement of the MergeSortA. For me it looks like that you not really did a change, because you added return (port == 9); The whole code is if (getitemtype(item) == port) { return 1; } //return getitemtype(item) == port; return (port == 9); This means that depending on the item type the port is returned. But after this return the following code is not executed. In other words it will always return at the first return. Beside this you made a compare of port and 9 which means you do not return 9 as you might expect. You return 1 or zero, because 9 = = 9 is one and x = = 9 is zero. If you want return 9 you should just say return9; Anyway, I hope I was able to give you some hints. Good success. tom the (A)tom
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
#3
|
|||
|
|||
Thanks for the hint
Tom,
First of all, I am sorry that I didn't specified the version that I use. I agree that it can make life easier. I tried the other model you recommended, and your hint helped a lot. Regarding the code I "ADDED" in the previous demo model, I think you meant what I intended. I didn't expect to have 9 as a return value. I thought the IF statement only returns true when the port num equals the itemtype which can have only 1 thru 8. If the port is 9 (recirculation), I think it passes the IF statement, and reaches to the line "return (port == 9);". I wanted to have return value true for that event to make recirculation. It seems to work fine to make recirculation except the overlapped items. Thanks, Sung |