Search code examples
anylogic

Manually Plot values stored in Collection in Anylogic Monte Carlo Bayesian Experiment


Good Day Everyone,

In Monte Carlo Bayesian Experiment I am storing data inside a collection (called incidence1). Please see the image

enter image description here

My collection (called incidence1) is collection class: TreeMap, Key is double, and value is also double. See the image

enter image description here

Finally, in the Monte Carlo Bayesian Calibration Experiment in Java Actions>After Simulation Run> I am writing the following code

incidences1.put(getCurrentIteration(), root.Incidence_Plot);

and doing so I get the error when compiling "incidence1 cannot be resolved". See the image below,

enter image description here


Solution

  • You need to access Main using the root keyword:

    root.incidences1.put(getCurrentIteration(), root.Incidence_Plot);

    There is no incidences1 in your experiment, it "lives" on Main so you need to get there first via code.