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 09-15-2008
Joe Allen Joe Allen is offline
Flexsim User
 
Join Date: Jul 2008
Posts: 80
Downloads: 2
Uploads: 0
Thanks: 34
Thanked 5 Times in 3 Posts
Rep Power: 151
Joe Allen is on a distinguished road
Default Recycling Flow Items

I need a little help understanding how the recycling of flow items work. Can anyone help by explaining to me how to appropriately recycle flowitems to maximize model performance in the following example:
A source creates a certain amount of flow items all of the same type. The flow items get split in a separator 1000X the number of the input from the source. On Exit from the separator, the item type of the flow item gets changed to a different item type (again all of the same type). These flowitems make their way to a combiner downstream in the model where they are combined in a combiner with a different flow item type from a second source (12 inputs per output). Again here the item type is changed on the flow item that is output (all the same item type). These flowitems are then joined in another combiner with eachother (75 inputs to each output). The item type gets changed again (all the same item type). Then the final flowitems go to a sink.
  #2  
Old 09-16-2008
Ben Wilson's Avatar
Ben Wilson Ben Wilson is offline
Flexsim Consultant, Super Moderator
 
Join Date: Jul 2007
Posts: 82
Downloads: 352
Uploads: 6
Thanks: 30
Thanked 159 Times in 43 Posts
Rep Power: 256
Ben Wilson is a glorious beacon of lightBen Wilson is a glorious beacon of lightBen Wilson is a glorious beacon of lightBen Wilson is a glorious beacon of lightBen Wilson is a glorious beacon of light
Default quick tutorial on recycling

Recycling is good for you and your model. Here's why:

In a normal, non-recycling model, you have sources that create flowitems, and sinks that destroy flowitems. For now we'll ignore the rest of the model.

There is a certain amount of overhead (processing time) required in creating new flowitems (allocating memory, assigning variables, etc). There is also a certain amount of overhead for destroying flowitems (though this is less than that for creation). If many flowitems are being created and destroyed on a constant basis, this can be a real drag on performance.

Enter recycling. Recycling helps to avoid a lot of the overhead associated with creating flowitems. It does this by never destroying them in the first place. Instead of destroying flowitems, sinks can be set to recycle. Essentially what this does is create a hidden "recycling bin" in your model. When a flowitem is recycled, it goes to that hidden bin. This essentially involves a node transfer. No memory is freed, nothing is destroyed. The flowitem is merely moved from the sink to a hidden recycling bin. If you understand how the tree works, this is basically a transfernode() command called on the flowitem.

There is a recycling bin for every type of flowitem, so just like you divide your glass from aluminum for your home recycling, you also need to make sure your sinks divide flowitems into the proper recycling bins. This is crucial because of the behavior of sources.

Sources by default try to use 100% recycled materials. You could say they're green. If the source is set to make textured colored boxes, it will first check the recycle bin for textured colored boxes. If there are any flowitems there in the recycle bin, the source will take one, run the source's triggers on it, and send it downstream. If the recycle bin is empty (if you don't have any sinks set to recycle, or if you've just started a model run) then the source is forced to create a brand new flowitem.

Here are some important points: if you accidently assign a sink to send cylindars to the recycle bin for boxes, the source making boxes will eventually pull cylindars out of the recycle bin and send them downstream as if they were boxes. The source assumes you've done your job and sorted the recycleables.

Another point: flowitems that are sent to the recycle bin are sent as-is. Meaning if you've changed some property of the flowitem (shape, color, size, rotation) that change will live on after the flowitem is recycled and sent out from the source. In this case it may be necessary to have an onCreation trigger that sets flowitems back to a default state. Even this is usually preferable to not recycling. The performance hit for changing color, size, shape, or labels is small compared to creating a new flowitem.

Lastly, other objects can join in the green crusade and recycle - we're not limited just to sources and sinks. The most common are combiners and separators. A combiner, if it is set to join, throws flowitems away. You can set them to recycle instead. A separator, if it is set to split, creates new flowitems. You can set it to use flowitems from the recycle bin instead of creating new ones.

Good luck and happy recycling!

Post any recycling questions/corrections below.

Ben
The Following 9 Users Say Thank You to Ben Wilson For This Useful Post:
Tom David (09-17-2008)


Thread Thread Starter Forum Replies Last Post
Can a combiner process multi items simultaneously? KelvinHo Q&A 6 11-08-2010 11:29 AM
different capacity for different flow item for a same TE KelvinHo Q&A 10 08-28-2008 08:12 AM
Sequence of Flow Items Through a Processor Anthony Timmiss Q&A 0 06-11-2008 02:26 AM
Operator not unloading items before picking up priority items Howe Chiat Cheng Q&A 2 05-28-2008 02:05 AM
Flow items with states AlanZhang Q&A 16 11-30-2007 10:32 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.