从http://ccl.northwestern.edu/netlogo/models/community/Astardemo ,我使用networking中的节点编码A *algorithm来定义成本最低的path。 该代码似乎工作,但它是太慢,当我在大的空间尺度使用它。我的景观有1000个补丁×1000个补丁的程度,1个补丁= 1个像素。 即使我减less400个修补程序×400个修补程序,1个修补程序= 1个像素,但它仍然太慢(我不能修改我的风景低于400个修补程序×400个修补程序)。 这里是代码: to find-path [ source-node destination-node] let search-done? false let search-path [] let current-node 0 set list-open [] set list-closed [] let list-links-with-nodes-in-list-closed [] let list-links [] set list-open lput source-node list-open while [ search-done? != true] [ ifelse length list-open != 0 [ set list-open sort-by [[f] […]