从任何logic中的集合中选择一个对象?

发布于 2025-01-31 23:47:24 字数 413 浏览 1 评论 0原文

我需要在GIS地图上模拟地震。我已经在GIS地图上创建了一些区域,并且创建了一个放置这些区域的集合。现在,我需要创建一个函数,该函数选择其中一个区域(每个区域可能是概率),在此选择的区域模型中必须找到Eartquake Epicenter(我创建了一个称为地震的代理)。

1-如何在身体功能中键入此代码?

2-我需要选择哪种类型的集合(例如“链接列表”,“树地图”。等等)?

3-在此之后,我该如何创建地震纬度和经度(我需要在Epicenter上发送TIR代理)? 我在图片下上传以使其可理解。

enter Image Description

I need to simulate an earthquake on my GIS map. I've created some regions on my GIS map and I've created a collection in which put these regions. Now, I need to create a function which choose one of these regions (which may a probability for each one) and in this choosen region model have to locate eartquake epicenter (I created an agent called earthquake).

1- How can I type this code in my body function?

2- Which type of collection do I need to choose (e.g. "Linked List", "Tree map". etc.) ?

3- How can I create after this, earthquake latitude and longitude (I need to send Tir agent on epicenter) ?
I upload below pics to make understandable.

enter image description here

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小伙你站住 2025-02-07 23:47:24

自发的想法:
我将使用一个数组列表,每行都是字符串的区域。
然后使用另一个变量来找出您需要的区域(例如使用正态分布,如果值高于阈值,则为区域B,否则是A)。
由于区域A和B处于集合的不同行,因此您的i对于以下代码更改:collection.get(i);

Spontaneous idea:
I would work with an array list, each line is a region as a string.
Then use another variable to find out which region you need (e.g. use a normal distribution, if the value is above a threshold it is region B, otherwise it is A).
As region A and B are in different lines of the collection, your i for the following code changes: collection.get(i);.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文