Netlogo 在不同坐标x y中平滑移动,并有间隙计时
简化问题 每个代理都有离散的勾号列表、x列表、y列表。 例如,对于代理1 t-list[1 5 10 15] x名单[2 3 4 5] y名单[6789] 我们想要 1,检查此代理是否在当前勾号和下一个勾号之间移动 2,如果移动,则填充未记录勾号之间的移动路径。 3、先填充道路,然后避开障碍物和人群 代码是Netlogo 在不同坐标x y中平滑移动,并有间隙计时,netlogo,Netlogo,简化问题 每个代理都有离散的勾号列表、x列表、y列表。 例如,对于代理1 t-list[1 5 10 15] x名单[2 3 4 5] y名单[6789] 我们想要 1,检查此代理是否在当前勾号和下一个勾号之间移动 2,如果移动,则填充未记录勾号之间的移动路径。 3、先填充道路,然后避开障碍物和人群 代码是 to go ; check if updates are needed ask turtles [ let dex item 1 x-list - item 0 x-list
to go
; check if updates are needed
ask turtles [
let dex item 1 x-list - item 0 x-list
let dey item 1 y-list - item 0 y-list
if ( first t-list = ticks and dex = 0 and dey = 0 ) [
; update agent's location
set xcor first x-list
set ycor first y-list
set t-list but-first t-list
set x-list but-first x-list
set y-list but-first y-list
]
if (ticks > first t-list and dex != 0 or dey != 0)[
move-to patch-at (xcor + dex) (ycor + dey)
;; according to raw data, the interval of recorded t is fixed and equal to 12
fd ( dex + dey ) / 12
set t-list but-first t-list
set x-list but-first x-list
set y-list but-first y-list
]
pendown
]
; stop if lists for all agents are empty
if all? turtles [ ticks > last t-list ] [
stop
]
tick
end
检查dex后我需要帮助!=0并干燥!=0,我想让代理在每个勾号的第一个t-list+1处按xcor+dex/det ycor+dry/det逐步移动
谢谢你的帮助 我在这里没有看到任何Java。对不起,A-star路径查找算法包是由Java编写的,并用作Netlogo中的扩展:将这个问题标记为java对您没有任何好处。查看java标记的人将无法帮助您使用netlogo程序。谢谢David,我在17分钟前删除了java标记。再次感谢你!对不起,我不能理解你的问题。“如何填充道路并使其平滑”-这是什么意思?