<?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: batch by number or sum of label in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/batch-by-number-or-sum-of-label/m-p/13922610#M99170</link>
    <description>&lt;P&gt;Hi Felix,&lt;/P&gt;&lt;P&gt;thank you! I had to look at which place in PF it is correct. It works now. In my case i check the batch after a token entered. So I changed your code in line 18 a little.&lt;/P&gt;&lt;P&gt;A additional token/ item (same start) appears some minutes later, so there is enough time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;/**Custom Code*/
Object current = param(1);
treenode activity = param(2);
Token token = param(3);
treenode processFlow = ownerobject(activity);

treenode batchActivity = token.BatchActivity;
treenode batch = getbatch(batchActivity, current, token.Batchlabel);

if( objectexists(batch))
{
		double limit = Model.parameters.AnhaengerSum;
		double sum = 0;
		for (int i=1; i&amp;lt;= batch.subnodes.length; i++)
			{
				sum += batch.subnodes[i].value.as(Token).Gewicht;
			}
			if (sum &amp;gt;= limit)
			{
				releasebatch(batch,0);
			}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Nov 2025 09:59:52 GMT</pubDate>
    <dc:creator>andreas_boehmer</dc:creator>
    <dc:date>2025-11-27T09:59:52Z</dc:date>
    <item>
      <title>batch by number or sum of label</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/batch-by-number-or-sum-of-label/m-p/13919335#M99142</link>
      <description>&lt;P&gt;Hi comunity,&lt;/P&gt;&lt;P&gt;i want to batch tokens wich are grouped by "token.Batchlabel" . This is a combination of source and destination.&lt;/P&gt;&lt;P&gt;every token represent a box. The&amp;nbsp; box has a weight. Typically 3 (quantifier: number of tokens) boxes are loaded at a trailer. But if the sum of weight label (maximum load for trailer) is reached with 2 boxes, the batch should be 2 (quantifier). With every load the sum of weigth is written as object label at the trailer.&lt;/P&gt;&lt;P&gt;every box at the trailer has to have same value in token.Batchlabel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FlexSim version 25.2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="andreas_boehmer_0-1764071583771.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1599112i02609ACDC8C5FEA5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="andreas_boehmer_0-1764071583771.png" alt="andreas_boehmer_0-1764071583771.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 12:01:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/batch-by-number-or-sum-of-label/m-p/13919335#M99142</guid>
      <dc:creator>andreas_boehmer</dc:creator>
      <dc:date>2025-11-25T12:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: batch by number or sum of label</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/batch-by-number-or-sum-of-label/m-p/13919391#M99143</link>
      <description>&lt;P&gt;So the batch is limited by both weight and token quantity?&lt;/P&gt;&lt;P&gt;The only way to build this that comes to mind is to check if there is an existing batch and if it would exceed the limit if the token were to be added before the token enters the batch activity. If this is the case, you can manually release the current batch.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 12:50:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/batch-by-number-or-sum-of-label/m-p/13919391#M99143</guid>
      <dc:creator>FelixMoehlmann</dc:creator>
      <dc:date>2025-11-25T12:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: batch by number or sum of label</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/batch-by-number-or-sum-of-label/m-p/13922610#M99170</link>
      <description>&lt;P&gt;Hi Felix,&lt;/P&gt;&lt;P&gt;thank you! I had to look at which place in PF it is correct. It works now. In my case i check the batch after a token entered. So I changed your code in line 18 a little.&lt;/P&gt;&lt;P&gt;A additional token/ item (same start) appears some minutes later, so there is enough time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;/**Custom Code*/
Object current = param(1);
treenode activity = param(2);
Token token = param(3);
treenode processFlow = ownerobject(activity);

treenode batchActivity = token.BatchActivity;
treenode batch = getbatch(batchActivity, current, token.Batchlabel);

if( objectexists(batch))
{
		double limit = Model.parameters.AnhaengerSum;
		double sum = 0;
		for (int i=1; i&amp;lt;= batch.subnodes.length; i++)
			{
				sum += batch.subnodes[i].value.as(Token).Gewicht;
			}
			if (sum &amp;gt;= limit)
			{
				releasebatch(batch,0);
			}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Nov 2025 09:59:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/batch-by-number-or-sum-of-label/m-p/13922610#M99170</guid>
      <dc:creator>andreas_boehmer</dc:creator>
      <dc:date>2025-11-27T09:59:52Z</dc:date>
    </item>
  </channel>
</rss>

