为什么AnyLogic中没有HashMap数据结构

huangapple go评论47阅读模式
英文:

Why no HashMap data structure in AnyLogic

问题

我目前正在创建一个模型,在这个模型中,我想调用HashMap上的一些“put”方法。这里键的顺序并不重要,所以我认为HashMap是解决这个问题的最佳选择。

然而,我只能在“collection”块的属性中看到“LinkedHashMap”选项。有没有一种特殊的方法可以将“collection”变成HashMap?

英文:

I'm currently creating a model where I want to call some "put" methods on a HashMap. The order of the keys does not matter here, so I figured that a HashMap was the best fit for the problem.

However, I can only see the "LinkedHashMap" option in the properties of the "collection" block. Is there a particular way of making the "collection" become a HashMap?

答案1

得分: 1

你可以使用任何你喜欢的Java数据结构,下拉菜单只是一个建议。

不过,在这种情况下,定义一个变量会更容易:
为什么AnyLogic中没有HashMap数据结构

英文:

You can use any Java data structure you like, the drop-down is just a suggestion.

However, it is easier to just define a variable in such a case:
为什么AnyLogic中没有HashMap数据结构

huangapple
  • 本文由 发表于 2023年5月24日 23:43:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76325295.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定