<?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: Statistics Collector: Distance travelled by operator from origin to destination in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534255#M42452</link>
    <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Awesome, Felix! Thanks for helping me think through the process.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;I'm still not sure how the batch ID would help determine the real distance covered the item, or the operator transporting the item. How would the batch ID help sample the "totaltraveldist" of an operator?&lt;/P&gt;
 &lt;P&gt;I did have a go at tracking the distance on the items themselves but got stuck when trying to assign the travelled distance to the item on exit from its queue:&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1673954901624.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514848i5915FB4D57D5E864/image-size/large?v=v2&amp;amp;px=999" role="button" title="1673954901624.png" alt="1673954901624.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1673954947196.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514850iD243BAA1FFB42C3B/image-size/large?v=v2&amp;amp;px=999" role="button" title="1673954947196.png" alt="1673954947196.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;I've tried to set a label "DistTravelled" to the object "item" to current.DistTravelled but I get this error:&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1673955188811.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514849i72244E9BC5CDB2A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="1673955188811.png" alt="1673955188811.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;The label seems to clearly exist on the Queue. Is there something wrong with my syntax?&lt;/P&gt;
 &lt;P&gt;I've attached the model for reference &lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/63173-disttravelledusinglabels.fsm" target="_blank"&gt;distTravelledUsingLabels.fsm&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Tue, 17 Jan 2023 11:35:47 GMT</pubDate>
    <dc:creator>theresa_b</dc:creator>
    <dc:date>2023-01-17T11:35:47Z</dc:date>
    <item>
      <title>Statistics Collector: Distance travelled by operator from origin to destination</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534253#M42450</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 22.2.0 ]&lt;/I&gt;&lt;/P&gt;&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Hey, all!&lt;/P&gt;
 &lt;P&gt;I'm in the process of learning how to use Statistics Collectors and Calculated Tables, and would like some advice on where I'm going wrong.&lt;/P&gt;
 &lt;P&gt;I am trying to track how far the operator travels from a collection of sources, to the queues of a combiner, to another queue of a combiner, to a floor storage space, to the queue of a Mega Combiner, as shown below.&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1673852559643.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514856iA542EEE514E5E440/image-size/large?v=v2&amp;amp;px=999" role="button" title="1673852559643.png" alt="1673852559643.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;The way that I've built the process flow for this is that after parts are unloaded to Combiner1 (the one downstream of the sources), the operator is released while a number of outputs are batched in Queue8 and the path from that Combiner to the Mega Combiner is set in a second process flow.&lt;/P&gt;
 &lt;P&gt;Due to this, I couldn't figure out which label I could use to track the operator through both process flows, so I used two Statistics Collectors, with the idea that I could combine them later as a Calculated Table. My questions are:&lt;/P&gt;
 &lt;UL&gt;&lt;LI&gt;Is there a Row Value I can use that will apply to both process flows?&lt;/LI&gt;&lt;LI&gt;The object value that I assign to the token that represents 20 FlowItems is, which I hoped would create a unique label per batch to track the operator as it travelled between its different destinations, excluding the time taken to collect transporters/AGVs. The appearance of this label isn't what I expected (i.e. ".3317206837.00"). What does this mean? If I wanted to use the object label to only aggregate "Travelled Distance"s with the same Object label, how would I do this?&lt;PRE&gt;&lt;SPAN class="fr-class-code"&gt;Math.round(Model.dateTime)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;I've tried to implement a Calculated Table but I have only been able to aggregate the values of a column from the CombinerToMega Statistics Collector. How do I also add the "travelled Distance" value from the SourcesToCombiner Statistics Collector to that number?&lt;/LI&gt;&lt;LI&gt;As an aside, I found &lt;A rel="nofollow noopener noreferrer" href="https://answers.flexsim.com/questions/102666/how-to-monitor-parts-of-distances-travelled-by-ope.html" target="_blank"&gt;this previous solution&lt;/A&gt; using custom code and recording to a Global Table instead of using Statistics Collector (or Calculated Tables). What are the advantages and/or disadvantages of either implementation?&lt;/LI&gt;&lt;/UL&gt;
 &lt;P&gt;My model is attached for reference &lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/63132-multipleaggrcalctable.fsm" target="_blank"&gt;multipleAggrCalcTable.fsm&lt;/A&gt;&lt;/P&gt;
 &lt;P&gt;Thanks in advance!&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Jan 2023 07:47:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534253#M42450</guid>
      <dc:creator>theresa_b</dc:creator>
      <dc:date>2023-01-16T07:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics Collector: Distance travelled by operator from origin to destination</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534254#M42451</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;You'd need some sort of ID number for the batches that connects the parts created in sources 1-4 to the items that they will be made a part of by the combiner.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1673860121801.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514845iFB5A75C888FEE175/image-size/large?v=v2&amp;amp;px=999" role="button" title="1673860121801.png" alt="1673860121801.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This assumes a couple of however:&lt;/P&gt;&lt;P&gt;- Which part will be fitted to which item is known from the beginning.&lt;BR /&gt;- There is a strict order of operations/different batches cannot mix&lt;BR /&gt;- Batches are always transported as a single unit; no partial or mixed transports&lt;/P&gt;&lt;P&gt;If these assumptions are valid, then you can copy this batch ID to the tokens and a column in the statistics collectors. Then use those columns to identify which rows belong together when creating the calculated table.&lt;/P&gt;&lt;P&gt;Otherwise it might be easier to track the distance on the items themselves. In the first process flow, use a token label to sum up the distance travelled. Then copy that value to all items that were transported (and those that are created when unloading). Later (for example in the On Process Finish trigger of combiner1) you can again copy those labels to the product, either as an aggregation over all involved items, such as the average travel distance, or you just use the label from any of the items, if you assume that they were all transported together.&lt;/P&gt;&lt;P&gt;The same can be done for the second leg of the transport, adding the new travel distance to the previous one. The statistics collector could then store a travel distance per product that arrives at the megacombiner. &lt;/P&gt;&lt;P&gt;Again, if those products have some sort of ID value, you could finally take an aggregate over all items of one batch.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;In regards to using object values in statistics collectors:&lt;/P&gt;&lt;P&gt;There are two possible ways to do this. Either you store name of the object, if it is unique, as a string. Or you use the "getID" method to create a unique number for the object. &lt;/P&gt;&lt;P&gt;Persistent objects will get assigned a large number that can be translated back into a pointer value to the object. For these, if you set the "Display Format" to object, the statistics collector table will show the object name.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1673861570838.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514847iE48991B733D1ADDB/image-size/large?v=v2&amp;amp;px=999" role="button" title="1673861570838.png" alt="1673861570838.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;FlowItems will get assigned incremental numbers starting at 1. (The first item for which the method is called will get the value 1, the second 2 and so on...). These can &lt;STRONG&gt;not &lt;/STRONG&gt;be translated back into a pointer value.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Difference between using a statistics collectors/calculated tables vs. global tables:&lt;/P&gt;&lt;P&gt;Statistics collectors and calculated tables can be connected to dashboard charts to plot their content graphically. Furthermore, when using the Experimenter, you can automatically store the data in them for each replication.&lt;/P&gt;&lt;P&gt;Global tables are more meant for input data or to store information that is used during the model run, but not necessarily output data. You can always get around this pretty easily though by creating a calculated table that simply clones a global table.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 16 Jan 2023 09:32:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534254#M42451</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-01-16T09:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics Collector: Distance travelled by operator from origin to destination</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534255#M42452</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 &lt;P&gt;Awesome, Felix! Thanks for helping me think through the process.&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;I'm still not sure how the batch ID would help determine the real distance covered the item, or the operator transporting the item. How would the batch ID help sample the "totaltraveldist" of an operator?&lt;/P&gt;
 &lt;P&gt;I did have a go at tracking the distance on the items themselves but got stuck when trying to assign the travelled distance to the item on exit from its queue:&lt;/P&gt;
 &lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1673954901624.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514848i5915FB4D57D5E864/image-size/large?v=v2&amp;amp;px=999" role="button" title="1673954901624.png" alt="1673954901624.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1673954947196.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514850iD243BAA1FFB42C3B/image-size/large?v=v2&amp;amp;px=999" role="button" title="1673954947196.png" alt="1673954947196.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;I've tried to set a label "DistTravelled" to the object "item" to current.DistTravelled but I get this error:&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1673955188811.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514849i72244E9BC5CDB2A0/image-size/large?v=v2&amp;amp;px=999" role="button" title="1673955188811.png" alt="1673955188811.png" /&gt;&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;The label seems to clearly exist on the Queue. Is there something wrong with my syntax?&lt;/P&gt;
 &lt;P&gt;I've attached the model for reference &lt;A rel="noopener noreferrer" href="https://answers.flexsim.com/storage/attachments/63173-disttravelledusinglabels.fsm" target="_blank"&gt;distTravelledUsingLabels.fsm&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 17 Jan 2023 11:35:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534255#M42452</guid>
      <dc:creator>theresa_b</dc:creator>
      <dc:date>2023-01-17T11:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics Collector: Distance travelled by operator from origin to destination</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534256#M42453</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;The batchID would be the common factor between the two statistics collectors, allowing you to sum the respective entries together in the calculated table.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You are assigning the label to the queue after the item is unloaded to it. FlexSim will first run through any events that were created due to the unloading (such as the item exiting the queue) before the token continues.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1673957828280.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514853i2E8485C9036292B5/image-size/large?v=v2&amp;amp;px=999" role="button" title="1673957828280.png" alt="1673957828280.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Use a travel activity to assign the distance before the unload and it should work.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1673957852917.png"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1514854i8BFCFF4113E7608B/image-size/large?v=v2&amp;amp;px=999" role="button" title="1673957852917.png" alt="1673957852917.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 17 Jan 2023 12:17:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534256#M42453</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-01-17T12:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics Collector: Distance travelled by operator from origin to destination</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534257#M42454</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;
 Really appreciate the troubleshooting! I guess a glance at the Event List would've helped me to spot that one.
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
 &lt;P&gt;I'm now stuck at the part where I use "On Process Finish" to assign a "DistTravelled" label to the output FlowItem of the Combiner. I'd like to get the average of all of the "DistTravelled" labels from the input FlowItems but how do you refer those input FlowItems as opposed to the output FlowItem?&lt;/P&gt;
 &lt;P&gt;I found &lt;A rel="nofollow noopener noreferrer" href="https://answers.flexsim.com/questions/27506/the-way-to-use-item-label-in-combiner-object.html" target="_blank"&gt;this previous answer&lt;/A&gt; which seems to suggest that the output FlowItem is&lt;/P&gt;
 &lt;PRE&gt;first(current)&lt;/PRE&gt;
 &lt;P&gt;but they don't require use for a specific FlowItem through the port of their choice.&lt;/P&gt;
 &lt;P&gt;A quick search in the doc didn't get me far either. Please help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
 &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 18 Jan 2023 11:07:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534257#M42454</guid>
      <dc:creator>theresa_b</dc:creator>
      <dc:date>2023-01-18T11:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics Collector: Distance travelled by operator from origin to destination</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534258#M42455</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;"first(current)" (or in more recent syntax "current.first") returns a reference to the first subnode. As the combiner will only start to accept items through its other ports once the first item was received through port 1, you can savely assume that "current.first" is in fact the container/output item. &lt;/P&gt;&lt;P&gt;The "On Process Finish" trigger should also contain the variable "item", which should point to the same object.&lt;/P&gt;&lt;P&gt;To get the average, you could then simply add up all label values from each item and divide by the number of items. The location of the other items in the tree depends on the mode of the combiner. In "Pack" node, they should be subnodes of the first item, in "Join" and "Batch" mode subnodes of the combiner.&lt;/P&gt;&lt;P&gt;Assuming "Pack" mode, the code to assign the label would look something like this:&lt;/P&gt;&lt;PRE&gt;// Start with the distance of the first item
double totalDist = item.DistTravelled;

// Add distances from other items
for(int i = 1; i &amp;lt;= item.subnodes.length; i++)
{
&amp;nbsp; &amp;nbsp; totalDist += item.subnodes&lt;I&gt;.DistTravelled;
}

// Assign average to container item
item.DistTravelled = totalDist/(1 + item.subnodes.length);&lt;/I&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 18 Jan 2023 11:37:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534258#M42455</guid>
      <dc:creator>moehlmann_fe</dc:creator>
      <dc:date>2023-01-18T11:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Statistics Collector: Distance travelled by operator from origin to destination</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534259#M42456</link>
      <description>&lt;DIV class="fr-view clearfix"&gt;&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/35968/theresab.html" nodeid="35968"&gt;@Theresa B&lt;/A&gt;, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.&lt;/P&gt;&lt;P&gt;If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 23 Jan 2023 15:52:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/statistics-collector-distance-travelled-by-operator-from-origin/m-p/13534259#M42456</guid>
      <dc:creator>Jeanette_Fullmer</dc:creator>
      <dc:date>2023-01-23T15:52:39Z</dc:date>
    </item>
  </channel>
</rss>

