question

Theresa B avatar image
0 Likes"
Theresa B asked Jeanette F commented

Statistics Collector: Distance travelled by operator from origin to destination

Hey, all!

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.

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.

1673852559643.png

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.

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:

  • Is there a Row Value I can use that will apply to both process flows?
  • 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?
    Math.round(Model.dateTime)
  • 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?
  • As an aside, I found this previous solution 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?

My model is attached for reference multipleAggrCalcTable.fsm

Thanks in advance!

FlexSim 22.2.0
calculated tablestatistic collectordistance traveled
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Theresa B, 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.

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.

0 Likes 0 ·

1 Answer

·
Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Felix Möhlmann commented

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.

1673860121801.png

This assumes a couple of however:

- Which part will be fitted to which item is known from the beginning.
- There is a strict order of operations/different batches cannot mix
- Batches are always transported as a single unit; no partial or mixed transports

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.

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.

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.

Again, if those products have some sort of ID value, you could finally take an aggregate over all items of one batch.


In regards to using object values in statistics collectors:

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.

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.

1673861570838.png

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 not be translated back into a pointer value.


Difference between using a statistics collectors/calculated tables vs. global tables:

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.

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.


1673860121801.png (7.2 KiB)
1673861570838.png (5.3 KiB)
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Theresa B avatar image Theresa B commented ·

Awesome, Felix! Thanks for helping me think through the process.


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?

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:

1673954901624.png1673954947196.png

I've tried to set a label "DistTravelled" to the object "item" to current.DistTravelled but I get this error:


1673955188811.png

The label seems to clearly exist on the Queue. Is there something wrong with my syntax?

I've attached the model for reference distTravelledUsingLabels.fsm

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Theresa B commented ·

The batchID would be the common factor between the two statistics collectors, allowing you to sum the respective entries together in the calculated table.


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.

1673957828280.png

Use a travel activity to assign the distance before the unload and it should work.

1673957852917.png

0 Likes 0 ·
1673957828280.png (17.2 KiB)
1673957852917.png (18.6 KiB)
Theresa B avatar image Theresa B Felix Möhlmann commented ·
Really appreciate the troubleshooting! I guess a glance at the Event List would've helped me to spot that one.


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?

I found this previous answer which seems to suggest that the output FlowItem is

first(current)

but they don't require use for a specific FlowItem through the port of their choice.

A quick search in the doc didn't get me far either. Please help :)


0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.