netlogo与元胞自动机
以netlogo实现为主的,一系列仿真实验
尼卡尼卡尼
热爱生活,生活会给出答案!
展开
-
Netlogo笔记07:蚁群算法实现TSP问题可视化
实现效果:蚂蚁旅行商源码globals [count1 min1 min_list iteration holes_list prior changed]breed [ants ant]breed [holes hole]ants-own [age hos_already km moving nearest]holes-own [dis_list phe_list conbine_list]extensions [rnd]to setup ca set...原创 2022-05-06 13:05:33 · 1582 阅读 · 3 评论 -
Netlogo笔记06:狼羊追逐
向量定向法,更新狼的移动方向globals[flag]breed[cats cat]breed[dogs dog]to update_heading;red to find black let x1 1 let y1 1 let x2 1 let y2 1 let hea 0 ask turtles with [color = red][ set x1...原创 2020-02-28 11:40:44 · 3548 阅读 · 1 评论 -
Netlogo笔记05:火灾扩散模型样例
globals [ initial-trees ;; how many trees (green patches) we started with burned-trees ;; how many have burned so far]breed [fires fire] ;; bright red turtles -- the leading edge of th...原创 2020-02-27 17:21:45 · 3429 阅读 · 2 评论 -
Netlogo笔记04:羊吃草"S"增长模型
turtles-own [energy]to setup __clear-all-and-reset-ticks reset-ticks ask patches[ ifelse random-float 1 < 0.2 [ set pcolor green ] [ set pcolor black ] ] ...原创 2020-02-27 16:01:50 · 3209 阅读 · 1 评论 -
Netlogo笔记03:兰顿蚂蚁的实现
兰顿蚂蚁的规则:当前若为黑地,则向左转90度并设置当前块为白色,再向前进一个单位 当前若为白地,则向右转90度并设置当前块为黑色,再向前进一个单位特点:当模型进展到一定程度后,蚂蚁会挖掘一条High_Speed_Channelto setup __clear-all-and-reset-ticks reset-ticks create-turtles 1[ se...原创 2020-02-27 15:47:19 · 894 阅读 · 0 评论 -
Netlogo笔记02:生命游戏B3S23的实现
patches-own [living]to setup __clear-all-and-reset-ticks ask patches[;if rannum < 0.2,a cell born,else nothing happend ifelse random-float 1 < 0.2[ set pcolor black ] [ ...原创 2020-02-27 15:37:13 · 1529 阅读 · 0 评论 -
Netlogo笔记01:基本语句创建一个运动的圆点集
to setup __clear-all-and-reset-ticks create-turtles 50[ setxy random-xcor random-ycor ] set-default-shape turtles "circle"endto go ask turtles[ if random-float 1 < prob[...原创 2020-02-27 15:27:50 · 1249 阅读 · 0 评论