从任何logic中的集合中选择一个对象?
我需要在GIS地图上模拟地震。我已经在GIS地图上创建了一些区域,并且创建了一个放置这些区域的集合。现在,我需要创建一个函数,该函数选择其中一个区域(每个区域可能是概率),在此选择的区域模型中必须找到Eartquake Epicenter(我创建了一个称为地震的代理)。
1-如何在身体功能中键入此代码?
2-我需要选择哪种类型的集合(例如“链接列表”,“树地图”。等等)?
3-在此之后,我该如何创建地震纬度和经度(我需要在Epicenter上发送TIR代理)? 我在图片下上传以使其可理解。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
自发的想法:
我将使用一个数组列表,每行都是字符串的区域。
然后使用另一个变量来找出您需要的区域(例如使用正态分布,如果值高于阈值,则为区域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);
.