<?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: Need help with Batch Process in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/need-help-with-batch-process/m-p/13509134#M22546</link>
    <description>&lt;P&gt;Maybe you could try this. It`s not elegant but it works:&lt;/P&gt;
&lt;P&gt;Put a numlabel on the queue that produces the batch and call it e.g. "path" &lt;/P&gt;
&lt;P&gt;On the OnEndCollection Trigger you just write this:&lt;/P&gt;
&lt;PRE&gt;// Produce a uniform distributed random number between 0 an 100 
double randomNumber = uniform(0,100);

// Write the path for the batch accoring to the randomnumber you got
if (randomNumber &amp;lt; 15) setlabel(current,"path",1);
else if (randomNumber &amp;gt;= 15) setlabel(current,"path",2);
&lt;/PRE&gt;
&lt;P&gt;This sends the batch in 15% of the cases to port 1 and in 85% to port 2.&lt;/P&gt;
&lt;P&gt;To make this work you just use the label at the the Send To Port trigger&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="6330-sendtoport.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1495332i44A36CA5BDD3A1D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="6330-sendtoport.png" alt="6330-sendtoport.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Apr 2017 16:23:23 GMT</pubDate>
    <dc:creator>philip_diem</dc:creator>
    <dc:date>2017-04-19T16:23:23Z</dc:date>
    <item>
      <title>Need help with Batch Process</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/need-help-with-batch-process/m-p/13509133#M22545</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 7.7.4 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;I am trying to figure out how to create a batch process where 15% of the time , the batch goes to Port 2 and the rest of the time goes to Port 1. By doing 'By Percentage' it only moves part of the batch to Port 2 and not the whole batch. Can you help?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 14:22:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/need-help-with-batch-process/m-p/13509133#M22545</guid>
      <dc:creator>brandon_tondreault</dc:creator>
      <dc:date>2017-04-19T14:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Batch Process</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/need-help-with-batch-process/m-p/13509134#M22546</link>
      <description>&lt;P&gt;Maybe you could try this. It`s not elegant but it works:&lt;/P&gt;
&lt;P&gt;Put a numlabel on the queue that produces the batch and call it e.g. "path" &lt;/P&gt;
&lt;P&gt;On the OnEndCollection Trigger you just write this:&lt;/P&gt;
&lt;PRE&gt;// Produce a uniform distributed random number between 0 an 100 
double randomNumber = uniform(0,100);

// Write the path for the batch accoring to the randomnumber you got
if (randomNumber &amp;lt; 15) setlabel(current,"path",1);
else if (randomNumber &amp;gt;= 15) setlabel(current,"path",2);
&lt;/PRE&gt;
&lt;P&gt;This sends the batch in 15% of the cases to port 1 and in 85% to port 2.&lt;/P&gt;
&lt;P&gt;To make this work you just use the label at the the Send To Port trigger&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="6330-sendtoport.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1495332i44A36CA5BDD3A1D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="6330-sendtoport.png" alt="6330-sendtoport.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 16:23:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/need-help-with-batch-process/m-p/13509134#M22546</guid>
      <dc:creator>philip_diem</dc:creator>
      <dc:date>2017-04-19T16:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Batch Process</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/need-help-with-batch-process/m-p/13509135#M22547</link>
      <description>&lt;P&gt;Actually you can replace your whole code with &lt;/P&gt;&lt;PRE&gt;setlabel(current, "path", bernoulli(15, 1, 2));&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Apr 2017 16:31:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/need-help-with-batch-process/m-p/13509135#M22547</guid>
      <dc:creator>mischa_spelt</dc:creator>
      <dc:date>2017-04-19T16:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Batch Process</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/need-help-with-batch-process/m-p/13509136#M22548</link>
      <description>&lt;P&gt;Oh yes you`re absolutely right. Thanks! The more you know &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 16:39:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/need-help-with-batch-process/m-p/13509136#M22548</guid>
      <dc:creator>philip_diem</dc:creator>
      <dc:date>2017-04-19T16:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Batch Process</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/need-help-with-batch-process/m-p/13509137#M22549</link>
      <description>&lt;P&gt;Thanks guys. This worked in my simulation. It saved me some time trying to figure this one out. &lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 17:16:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/need-help-with-batch-process/m-p/13509137#M22549</guid>
      <dc:creator>brandon_tondreault</dc:creator>
      <dc:date>2017-04-19T17:16:18Z</dc:date>
    </item>
  </channel>
</rss>

