Shariff Ghanem
Shariff Ghanem

Reputation: 75

How to obtain certain data from main on a graph using parameter variation in anylogic?

I am having trouble with the coding process or steps to extract data from the main and onto the parameter variation experiment in anylogic. I am currently working on total evacuation time due to random fire obstruction.

For now I have successfully obtained the total max evacuation time for 100 runs in my study but I also need another set of data for the number of exits obstructed during each run. My main has the collection (of 3 exits) availableExits and I can see what is obstructed during the simulation.

Furthermore, I would like to obtain data for the number of people evacuating at a particular time (for example number of pedestrians using exit at 120 seconds). I can see this in main from timeMeasureEnd and creating a histogram distribution graph, which shows number of pedestrians escaping at each time. I've managed to create one in parameter variation but when I run the experiment, I am unable to store or view the data as it keeps changing after every run.

Here is the code from analysis Histogram Data which is entered in after simulation run

data = root.timeMeasureEnd.distribution;

Upvotes: 1

Views: 470

Answers (1)

yuriy pidvalny
yuriy pidvalny

Reputation: 124

i would recommend to add a dataset to your main which would store all the values you want to keep in parameter variation. Dataset differs from histogram data in a way that it doesnt aggregate, it is just a raw array of values, and later you will not have a problem of "aggregating aggregated data".

So, after each simulation run you can access your dataset in main via "root" reference (as you are already doing it) and loop through it to store all the values one by one.

Upvotes: 2

Related Questions