Performance measures for inventory table

All topics specific to modeling questions in Enterprise Dynamics
Post Reply
Thore
Posts: 16
Joined: Sunday 28 October, 2018 - 13:27

Performance measures for inventory table

Post by Thore »

Hi folks! :)
In my simulation model of a replenishment system i'm using a table to store and continiously update the current inventory label for +100 products. It works great, but i dont know how to get the average inventory level for each product (each row in the table), as an output from each experiment. I'm using the Data Recorder to write the daily inventory level for each product to an excel file, which i can use to calculate the measure. However if i want to run with multiple observation periods, the numbers will just be overwritten...

any good ideas?

BR
Thore
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: Performance measures for inventory table

Post by HarryBunnik »

Ha Thore,

If you're already writing your data away in an Excel file I think that what you're missing is to have Enterprise Dynamics write the data for each experiment into a different column.
To get the number of the experiment that you're currently are running, you have to get this information form the experiment support atom, namely:

Att([CurRun], refExperimentSupport)

This value you can use to write the data for each experiment into another column Excel. That way you can keep your data separated.

Another option is to collect the data in the cells in Excel using a Concat and a comma as a separator and this way add each new experiment to the data that is already stored in the Excel cell, instead of overwriting it. In the last experiment, you then concatenate it with the correct statistic Excel formula.

I hope this helps you further,

Regards,

Harry
Thore
Posts: 16
Joined: Sunday 28 October, 2018 - 13:27

Re: Performance measures for inventory table

Post by Thore »

Hi
Yeah I sounds very good. However since i'm using the Data Recorder atom to output to excel, how can i then use this 4Dscript?

Ideally, i would get each simulation run to be exported right after each other in an Excel table (thus same colums), but that will require knowing the last row where a value has been exported to, between simulation runs?

Thanks for your help
BR Thore :)
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: Performance measures for inventory table

Post by HarryBunnik »

Ha Thore,

Ok, that indeed throws the second idea out of the window. I had overlooked the data recorder at that time.

What you can do is at the start of the new scenario, update the column in which the DataRecorde will start writing.

This is the "Att([StartColumnExcel], RefDataRecorder)". I've created an alias for the DataRecorder since that makes it easy to refer to it.

You could update it as follows on the "On start of run"trigger that is located at the Experiment Wizard:

Att([StartColumnExcel], RefDataRecorder) := nCols(RefDataRecorder) * (Att([CurRun], refExperimentSupport) - 1) + 1 {or where ever you want to start writing your data.}

I hope this helps you further,

Regards,

Harry
Thore
Posts: 16
Joined: Sunday 28 October, 2018 - 13:27

Re: Performance measures for inventory table

Post by Thore »

Hi Harry
It works fine, thanks!

However i'm a bit curious how to make the row dynamic version of this, so the rows for each simulation run is just placed beneath each other. I have discovered the StartRowExcel and the nRows, but I still dont no how to store the last nRows(RefDataRecorder) from run 1 and use that to set Att([StartRowExcel], RefDataRecorder) of run 2. Do you know a way to do this?

Br
Thore
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: Performance measures for inventory table

Post by HarryBunnik »

Ha Thore,

You can create a global reference ( DIm([valCurrentRowInDataRecorder], vbValue) ) and use the "On Start of run" trigger on the experiment wizard to reset this value to 0 when the first run of the simulation is started.

Then the "On End of run" trigger can be used to increment the value of the global variable "valCurrentRowInDataRecorder" with the nRows of the table. Then you have the end value of the current experiment, which you can use for the next run (-1), which you indeed will have to place in the Attribute: "Att([StartRowExcel], RefDataRecorder)" at the "On Start of run" trigger (+1 to ensure it will start in a fresh row). If you place the value earlier, it will be reset.

I hope this works for you.

Regards,

Harry
Thore
Posts: 16
Joined: Sunday 28 October, 2018 - 13:27

Re: Performance measures for inventory table

Post by Thore »

It behaves a bit strange. By uisng the interact i can see that the StartRowExcel is updated correctly, but it looks like the nrows(refDataRecorder) kinda neglect this. It always starts writing in row 2.

I have attached the code in pictures.
Attachments
on run start.PNG
on run start.PNG (66.24 KiB) Viewed 4402 times
on run end.PNG
on run end.PNG (22.79 KiB) Viewed 4402 times
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: Performance measures for inventory table

Post by HarryBunnik »

Ha Thore,

Hmm... I think that the On Start of Run is then executed completely at the start of the reset, instead of at the end. Which causes the DataRecorder to executes its own code after the On Start of run is already executed, thereby resetting what we just tried to update.

What you can try is using an Initialize atom and execute the same code there. Only make sure that the option On Reset is turned off. It will then execute the code directly when the simulation runs starts.

Regards,

Harry
Thore
Posts: 16
Joined: Sunday 28 October, 2018 - 13:27

Re: Performance measures for inventory table

Post by Thore »

Hi Harry
I've not managed to get this feature to work, so i'll just use the one first one with dynamic columns.
Thank you very much for your help!
BR
Thore
Post Reply