第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何在大空間尺度上加速A *算法?

如何在大空間尺度上加速A *算法?

如何在大空間尺度上加速A *算法?從http://ccl.northwestern.edu/netlogo/models/community/Astardemo,我通過使用網(wǎng)絡(luò)中的節(jié)點(diǎn)來定義最低成本路徑來編碼A *算法。代碼似乎有效,但是當(dāng)我在大空間尺度上使用它時(shí)它太慢了。我的景觀有1000個(gè)補(bǔ)丁x 1000個(gè)補(bǔ)丁,1個(gè)補(bǔ)丁= 1個(gè)像素。即使我減少400補(bǔ)丁x 400補(bǔ)丁1補(bǔ)丁= 1像素,它仍然太慢(我不能修改我的景觀低于400補(bǔ)丁x 400補(bǔ)丁)。這是代碼:to find-path [ source-node destination-node] let search-done? falselet search-path []let current-node 0set list-open []set list-closed []  let list-links-with-nodes-in-list-closed []let list-links []set list-open lput source-node list-openwhile [ search-done? != true][    ifelse length list-open != 0[  set list-open sort-by [[f] of ?1 < [f] of ?2] list-open   set current-node item 0 list-open   set list-open remove-item 0 list-open   set list-closed lput current-node list-closed  ask current-node  [      if parent-node != 0[    set list-links-with-nodes-in-list-closed lput link-with parent-node list-links-with-nodes-in-list-closed     ]    ifelse any? (nodes-on neighbors4) with [ (xcor = [ xcor ] of destination-node) and (ycor = [ycor] of destination-node)]    [      set search-done? true     ]    [              ask (nodes-on neighbors4) with [ (not member? self list-closed) and (self != parent-node) ]        [          if not member? self list-open and self != source-node and self != destination-node        [          set list-open lput self list-open          set parent-node current-node          set list-links sentence (list-links-with-nodes-in-list-closed) (link-with parent-node)          set g sum (map [ [link-cost] of ? ] list-links)          set h distance destination-node           set f (g + h)        ]      ]    ]  ]][  user-message( "A path from the source to the destination does not exist." )  report [] ]]set search-path lput current-node search-pathlet temp first search-pathwhile [ temp != source-node ][ ask temp[  set color red]不幸的是,我不知道如何加快這段代碼。是否有解決方案在大空間尺度上快速計(jì)算最低成本路徑?
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 814 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號