第39行: |
第39行: |
| == 算法的实现 == | | == 算法的实现 == |
| | | |
− | === HOW TO USE IT(NetLogo使用教程) === | + | === NetLogo使用教程 === |
| First, determine the number of birds you want in the simulation and set the POPULATION slider to that value. Press SETUP to create the birds, and press GO to have them start flying around. | | First, determine the number of birds you want in the simulation and set the POPULATION slider to that value. Press SETUP to create the birds, and press GO to have them start flying around. |
| | | |
第55行: |
第55行: |
| ** VISION 视力是每只鸟能360度看到的距离。 | | ** VISION 视力是每只鸟能360度看到的距离。 |
| | | |
− | | + | ==== THINGS TO NOTICE(注意事项) ==== |
− | === THINGS TO NOTICE(注意事项) === | |
| Central to the model is the observation that flocks form without a leader. | | Central to the model is the observation that flocks form without a leader. |
| | | |
第78行: |
第77行: |
| 有时鸟儿会从鸟群中飞走。这是怎么发生的?为了观察这种现象,您可能需要放慢模型的速度或一步一步地运行它。 | | 有时鸟儿会从鸟群中飞走。这是怎么发生的?为了观察这种现象,您可能需要放慢模型的速度或一步一步地运行它。 |
| | | |
− | === 代码实现 === | + | ==== 代码实现 ==== |
| [http://www.netlogoweb.org/launch#http://ccl.northwestern.edu/netlogo/models/models/Sample%20Models/Biology/Flocking.nlogo Netlogo Web - Flocking]<syntaxhighlight line="1" lang="lisp"> | | [http://www.netlogoweb.org/launch#http://ccl.northwestern.edu/netlogo/models/models/Sample%20Models/Biology/Flocking.nlogo Netlogo Web - Flocking]<syntaxhighlight line="1" lang="lisp"> |
| turtles-own [ | | turtles-own [ |
第204行: |
第203行: |
| | | |
| | | |
− | === EXTENDING THE MODEL(模型的延伸) === | + | ==== EXTENDING THE MODEL(模型的延伸) ==== |
| Currently the birds can "see" all around them. What happens if birds can only see in front of them? The <code>in-cone</code> primitive can be used for this. | | Currently the birds can "see" all around them. What happens if birds can only see in front of them? The <code>in-cone</code> primitive can be used for this. |
| | | |
第231行: |
第230行: |
| | | |
| | | |
− | === NETLOGO FEATURES(NetLogo默认设定) === | + | ==== NETLOGO FEATURES(NetLogo默认设定) ==== |
| Notice the need for the <code>subtract-headings</code> primitive and special procedure for averaging groups of headings. Just subtracting the numbers, or averaging the numbers, doesn't give you the results you'd expect, because of the discontinuity where headings wrap back to 0 once they reach 360. | | Notice the need for the <code>subtract-headings</code> primitive and special procedure for averaging groups of headings. Just subtracting the numbers, or averaging the numbers, doesn't give you the results you'd expect, because of the discontinuity where headings wrap back to 0 once they reach 360. |
| | | |