Jump to content

Entity Distance travelled on Transporter


Recommended Posts

Hi Everyone,

I have 100s of different products in a warehouse and I want to get statistics for all of them such as distance travelled, number entered and exited. So I created the entity instances for each product automatically through data table. The entity.totaldistancetraveled function doesnt increase since the entity doesnt moveby itself but moved by forklift instead.  So I have created a state variable called "distanceonforklift"  and increased by the difference between the forklift total distance travelled value when entity exits and enters to forklift. I have also created a function called "distancefunction" on the entity and equated it to "distanceonforklift" state variable of the entity. For the return type of function I have chosen "number" and set the unit to "length". I validated that both distance state variable and function is calculated correctly in the facility window. However I cannot output the result of this state variable on the model results screen. I used the following expression  under model outputstatistic but it didnt work. "ProductA.DistanceFunction". That expression gives me 0 value although there are some entities of this product which enters and exits the system.

How can I see the average total distance travelled on forklift for the whole population of Product A?

Link to comment
Share on other sites

Hello!

With your current approach, you need a way to aggregate the distance traveled per each entity. Each entity in the population is collecting their own distance traveled, but on the Output Statistic, you are looking at just the Instance, ProductA. The Instance will not automatically aggregate the population's values. If you were to specify a specific population index, for example ProductA[5].DistanceFunction, the Output Statistic would return the 5th entity in the population's distance function and you should see a value. However, making an Output Statistic for each population index would be inefficient and tedious to collect. 

I recommend using a global/model level State Variable. This State Variable could be summed as a ProductA entities leave the system. So the Product A entities will continue to collect their individual distance traveled as you have set it up, but then prior to exiting through the Sink, add their distance traveled to a running total State Variable. That total could then be divided by the number of entities destroyed giving you an average distance traveled. 

Link to comment
Share on other sites

Thank you so much Liz! I understand exactly what you mean. However we thought that using Tallies would give more correct results for the average value calculations. I am also thining that running and add on process on "run ending" would allow me to calculate the distances statistics for all the entities even if they are not destroyed. Now I know how to calculate it but there are around 800 different product types. So I have to write 800 if conditions saying if decide, entity.type.name == "A" is true, Tally "distanceonforkliftA", on false exit, if decide entity.type.name == "B", Tally "distanceonforkliftB" etc. Is there a way to automatically create tally statistics for each entity instance?

Link to comment
Share on other sites

I would recommend using a Data Table. One column could have all your entity types defined. The next column could be a Tally Statistic Element Reference Property. This column would match up the Tally statistic you want to correspond with the Entity Type. You could choose to auto-create these Tally Statistics from the Data Table. If you change the Tally Statistic Property's column Reference Type property from 'Reference' to 'Create', this will make the Tally Statistics for you. I recommend the Help page "Table-Based Elements (Auto-Create)" in Simio for more information. 

If your Entity Instances noted in the Data Table are unique, no duplicates, you can set that column as a Key. With that column as a Key, you could use just the Tally step and use the RowForKey expression. RowForKey will allow a key input to search for in that column. If the model entity is driving the process, you could use an expression like this for the Tally Statistic Name 'Table1[Table1.EntityInstanceProperty1.RowForKey(ModelEntityReference)].TallyStatisticProperty'. 

Since it seems this process will be on the OnRunEnding, it will not have a reference to a specific entity, so you will most likely need a Search step to find the entities still in the system. I would set the Search step to find Infinite things and let each entity reference exit on the found branch. If the EntityInstanceProperty column in your Data Table has the Auto-set Table Row Reference property to 'True', the entities will already know the row reference and your Tally step Tally Statistic Name property could be 'Table1.TallyStatisticProperty'.

Link to comment
Share on other sites

Thanks you so much for you help Liz. That's such an advanced modeling techinique I had never heard of before. I would never be able to figure it out myself. It has almost worked but correctly. It has recorded the results for some tallies correctly but recorded some tallies on the wrong tally. I think there is a problem with the set row feature somewhere. I have no problem with setting rows elsewhere in the model such as arrivals from production and arrivals from truck tables create entities correctly with all their state variables. The product list table also has unique "productnames" (entity instances), set as key and auto set-row property is set to true. I have added another coloumn with element tally statistics reference (DistanceOnForklift) to products table. I have auto created it as you suggested and turned on the auto-set row feature to true. Both my product names and tally statistics coloumn are set as key in same "products" table. But the tally step still doesnt record them to the correct tally statistics. Where am I doing wrong? Would you still be able to help me?
Shall I send you the model in private message?

Here is the formula I have inputted 'Products[Products.ProductName.RowForKey(ModelEntity.EntityType.Name)].DistanceOnForklift' and in the picture below you can see that tally step records into wrong tally element on last three entries.
I would be glad if you could help me. 

simio tally.jpg

Link to comment
Share on other sites

Hi again Liz.

I found the problem but it wasn't easy to figure out with the RowForKey formula. I used the search function with tablerows as collection type. When I filtered the trace on the search and tally process, I found that the the table index of the found item and index of the search function was not the same in some cases especially for "small" type products. Further even the available row count of the products table was not returning the correct number rows in the table. The products table has 810 rows but it was finding 197 rows only in the search function.
I had a separate "productsize" table which consists of "size" key string property and some other real type properties such as forklift capacity for each product size. I had used this productsize.size as foreign key in my main products table.

I figured that the search function automatically filters to the products those matches the size of the product eventhough in search function match condition I only write ModelEntity.EntityType==Products.ProductName. When I removed the foreign key from the products table the problem was solved.

Thanks for your help anyway. It was very useful and saved a ton of time from me.

Link to comment
Share on other sites

 Share

×
×
  • Create New...