简体   繁体   English

如何在anylogic中计算两个代理的相对速度

[英]how to calculate the relative velocity of two agents in anylogic

now I use the pedsource to generate pedestrians in anylogic.现在我使用 pedsource 在 anylogic 中生成行人。 I want to calculate the relative velocity of two specific pedestrians.我想计算两个特定行人的相对速度。 ("getspeed()" seems not consider the direction) is there any way to calculate it? (“getspeed()”似乎没有考虑方向)有什么方法可以计算吗?

thanks!谢谢!

I have looked at the Pedestrian API and under Coordinates you can get the 3D (X, Y, Z) positions of the pedestrians (in meters) and their target (tX, tY, tZ) so why don't you use them to extract the direction you want.我查看了Pedestrian API ,在坐标下,您可以获得行人的 3D(X、Y、Z)位置(以米为单位)及其目标(tX、tY、tZ),那么为什么不使用它们来提取你想要的方向。

Functions:功能:

For pedestrians location: getX() , getY() , getZ()对于行人位置: getX()getY()getZ()

For their targets: getTargetX() , getTargetY() , getTargetZ()对于他们的目标: getTargetX()getTargetY()getTargetZ()

So by calculating the directional vector for two points in 3D space you can draw it.因此,通过计算 3D 空间中两个点的方向矢量,您可以绘制它。

Ref:参考:

determining-a-vector-given-two-points 确定一个向量给定的两点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM