英文:
Manually Plot values stored in Collection in Anylogic Monte Carlo Bayesian Experiment
问题
我的集合(称为incidence1)是一个集合类:TreeMap,键是double类型,值也是double类型。请参见下图
最后,在Monte Carlo贝叶斯校准实验中,在Java操作>模拟运行后>我写下了以下代码:
incidences1.put(getCurrentIteration(), root.Incidence_Plot);
这样做时,在编译时会出现错误“无法解析incidence1”。请参见下图,
英文:
Good Day Everyone,
In Monte Carlo Bayesian Experiment I am storing data inside a collection (called incidence1). Please see the image
My collection (called incidence1) is collection class: TreeMap, Key is double, and value is also double. See the image
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,
答案1
得分: 0
你需要使用root
关键词访问Main
:
root.incidences1.put(getCurrentIteration(), root.Incidence_Plot);
在你的实验中没有incidences1
,它位于Main
上,所以你需要通过代码先到达那里。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论