I am trying to measure the total time spent by every agent in my system in Anylogic. I have already learnt there are multiple ways to do this. Using block TimeMeasureStart and TimeMeasureEnd is not working, so I studied and found other ways like using Agent Variables. But I havent been able to store those variable data, or visualize those variable data. I am attaching images for reference.
Please let me know if you are having trying to understand what I am saying.
These are the parameters I am using for my agent RawMaterial
This is the code
From what I can see in your code, you're on the right path, however you're saving the processing time of your agent within a variable that exists inside your agent, at the same time you're sinking it, without saving it somewhere else beforehand.
There are many ways to record your results, i.e. saving it to an AnyLogic DB, a Text file, an Excel file, etc. The most straightforward manner would be using Analysis Palette.
Let's use the Statistics object. Create a statistics
object on your canvas. Right after your endtime = time() - starttime
add main.statistics.add(endtime)
. Then you can call the statistic
's functions to get summary data.