<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Bin Packing Algorithm in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512264#M25080</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/14767/braydnt.html" nodeid="14767"&gt;@Braydn T&lt;/A&gt; Thanks for your input.&lt;/P&gt;&lt;P&gt;Could you please share First Fit Algorithm code or sample model so that I can try. &lt;/P&gt;</description>
    <pubDate>Thu, 12 Dec 2019 23:34:24 GMT</pubDate>
    <dc:creator>sudheer_r</dc:creator>
    <dc:date>2019-12-12T23:34:24Z</dc:date>
    <item>
      <title>Bin Packing Algorithm</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512262#M25078</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 19.2.4 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;As shown in below image, I am trying to pull items where cumulative Value should be &amp;lt;=9.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24217-query1.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1500844iD413846EFC0C5904/image-size/large?v=v2&amp;amp;px=999" role="button" title="24217-query1.jpg" alt="24217-query1.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;First Bin Packed with id:2 Value 9 (100% bin utilization)&lt;/P&gt;&lt;P&gt;Second BIn Packed with id:3 Value 9 (100% bin utilization)&lt;/P&gt;&lt;P&gt;Third BIn Packed with id:9 Value 9 (100% bin utilization)&lt;/P&gt;&lt;P&gt;Fourth Bin Packed with id:6 and id:8 cumulative Value 9 (100% bin utilization)&lt;/P&gt;&lt;P&gt;Fifth Bin Packed with id:7 and id:10 cumulative Value is 9 (100% bin utilization)&lt;/P&gt;&lt;P&gt;Sixth Bin packed with id:4 Value 7 (bin Utilization &amp;lt;100)&lt;/P&gt;&lt;P&gt;Seventh Bin packed with id:1 Value 3( bin utilization&amp;lt;100)&lt;/P&gt;&lt;P&gt;For example following code pulls first token in the list with Value 3 because when we add next token Value, the cumulative exceeds &amp;gt;=9. So first token is pulled. Instead need to loop all the tokens and pull the tokens where bin utilization is high.&lt;/P&gt;&lt;PRE&gt;List itemList = List("ItemList1");
int listLen = itemList.entries().length;
int valueSum = 0;
for (int i = 1; i &amp;lt;= listLen; i++)
{	
	valueSum += List("ItemList1").entries()&lt;I&gt;.value.labels["Value"].value;
	
	if(valueSum &amp;gt;= 9)
	{
		return i - 1;
	}
}
return 0;
&lt;/I&gt;&lt;/PRE&gt;&lt;P&gt;Team I need to pack the bins in the above mentioned way. Please help me on this.I am attaching model for reference&lt;/P&gt;&lt;P&gt;&lt;A id="24221" href="https://answers.flexsim.com/storage/attachments/24221-binpacking.fsm"&gt;binpacking.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 18:34:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512262#M25078</guid>
      <dc:creator>sudheer_r</dc:creator>
      <dc:date>2019-12-12T18:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Bin Packing Algorithm</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512263#M25079</link>
      <description>&lt;P&gt;&lt;A href="https://answers.flexsim.com/questions/76404/view.html?overrideforward=1#"&gt;@Sudheer R&lt;/A&gt;&lt;/P&gt;&lt;P&gt;what would you like to have happen with the tokens that are passed over? should the stay on the list? &lt;/P&gt;&lt;P&gt;I think the main issue you are going to encounter is you have one token that is doing all the pulling. All of the items pulled will go to one token. You will have to have a token run the algorithm, determine the number of bins that will be released and then release that number of tokens to your algorithm again, and then pull from the list.&lt;/P&gt;&lt;P&gt;As for your algorithm I would take a look at the First Fit Algorithm and see if you can adapt it for your needs. First fit has bins with different capacities, but you should be able to adapt it for your needs. &lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 21:22:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512263#M25079</guid>
      <dc:creator>braydn_t</dc:creator>
      <dc:date>2019-12-12T21:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Bin Packing Algorithm</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512264#M25080</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/14767/braydnt.html" nodeid="14767"&gt;@Braydn T&lt;/A&gt; Thanks for your input.&lt;/P&gt;&lt;P&gt;Could you please share First Fit Algorithm code or sample model so that I can try. &lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2019 23:34:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512264#M25080</guid>
      <dc:creator>sudheer_r</dc:creator>
      <dc:date>2019-12-12T23:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Bin Packing Algorithm</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512265#M25081</link>
      <description>&lt;P&gt;Here is some info on the first fit algorithmn: &lt;A href="https://www.geeksforgeeks.org/program-first-fit-algorithm-memory-management/"&gt;https://www.geeksforgeeks.org/program-first-fit-algorithm-memory-management/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 14:49:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512265#M25081</guid>
      <dc:creator>braydn_t</dc:creator>
      <dc:date>2019-12-16T14:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Bin Packing Algorithm</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512266#M25082</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/16951/sudheerr.html" nodeid="16951"&gt;@Sudheer R&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Was Braydn's answer helpful for you? If so, please click the accept button. If not, how else can we help?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 18:02:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512266#M25082</guid>
      <dc:creator>benjamin_w2</dc:creator>
      <dc:date>2019-12-20T18:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Bin Packing Algorithm</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512267#M25083</link>
      <description>&lt;A rel="user" href="https://answers.flexsim.com/users/13461/benjaminw2.html" nodeid="13461"&gt;@Benjamin W2&lt;/A&gt;&lt;P&gt;I am still trying first fit algorithm. If possible could you please update any sample model having first fit algorithm. It really helps me.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 21:09:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512267#M25083</guid>
      <dc:creator>sudheer_r</dc:creator>
      <dc:date>2019-12-20T21:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Bin Packing Algorithm</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512268#M25084</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/16951/sudheerr.html" nodeid="16951"&gt;@Sudheer R&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Here's an example where I used the first fit algorithm to fill queues. All of the custom code can be found in the Custom Code activity in Process Flow. Hopefully this helps give you an example of what you can do in your model. Your model was incomplete, so I wasn't sure exactly the route you wanted to go with this, but this code should get you started.&lt;/P&gt;&lt;P&gt;The idea is that each queue has a valueSum label that adds the values on each of the items in the queue and should be equal to 9.&lt;/P&gt;&lt;P&gt;&lt;A id="24476" href="https://answers.flexsim.com/storage/attachments/24476-binpacking.fsm"&gt;binpacking.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2019 18:00:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512268#M25084</guid>
      <dc:creator>tanner_p</dc:creator>
      <dc:date>2019-12-26T18:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Bin Packing Algorithm</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512269#M25085</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/8186/tannerp.html" nodeid="8186"&gt;@tanner.p&lt;/A&gt; &lt;/P&gt;&lt;P&gt;In below shown image for &lt;STRONG&gt;pulledItem &lt;/STRONG&gt;it is showing&lt;STRONG&gt; &lt;/STRONG&gt;as&lt;STRONG&gt; Queue8/Box1 &lt;/STRONG&gt;but for&lt;STRONG&gt; pulled &lt;/STRONG&gt;it is showing as &lt;STRONG&gt;Internal Type. &lt;/STRONG&gt;I would like to see what is the content of &lt;STRONG&gt;pulled &lt;/STRONG&gt;instead of &lt;STRONG&gt;Internal Type.&lt;/STRONG&gt; I am trying to find in &lt;STRONG&gt;Tree Structure&lt;/STRONG&gt; what is&lt;STRONG&gt; pulled &lt;/STRONG&gt;content&lt;STRONG&gt;. &lt;/STRONG&gt; Where to find this in&lt;STRONG&gt; Tree Structure&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24567-internaltype.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1500841i7B8ACE0619223616/image-size/large?v=v2&amp;amp;px=999" role="button" title="24567-internaltype.jpg" alt="24567-internaltype.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Following is the Tree Structure I am looking for &lt;STRONG&gt;pulled. &lt;/STRONG&gt; Where to find in Tree Structure.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="24568-pulled.jpg"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1500842i88F878552799FC5D/image-size/large?v=v2&amp;amp;px=999" role="button" title="24568-pulled.jpg" alt="24568-pulled.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 13:18:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512269#M25085</guid>
      <dc:creator>sudheer_r</dc:creator>
      <dc:date>2020-01-02T13:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Bin Packing Algorithm</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512270#M25086</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://answers.flexsim.com/users/16951/sudheerr.html" nodeid="16951"&gt;@Sudheer R&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;That "pulled" value that you've found isn't necessary and is just a local duplicate of "pulledItem". I wouldn't worry about it. I deleted that part of the code and the model still functions.&lt;/P&gt;&lt;P&gt;&lt;A id="24591" href="https://answers.flexsim.com/storage/temp/24591-24476-binpacking-3.fsm"&gt;24476-binpacking-3.fsm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 16:49:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/bin-packing-algorithm/m-p/13512270#M25086</guid>
      <dc:creator>tanner_p</dc:creator>
      <dc:date>2020-01-02T16:49:04Z</dc:date>
    </item>
  </channel>
</rss>

