简介
“蚂蚁觅食”这个多智能体模型主要模拟的现象是:
When an ant finds a piece of food, it carries the food back to the nest, dropping a chemical as it moves. When other ants “sniff” the chemical, they follow the chemical toward the food. As more ants carry food to the nest, they reinforce the chemical trail.
当一只蚂蚁找到一块食物时,它会把食物带回巢穴,并在移动过程中丢弃一种化学物质。当其他蚂蚁 "嗅到 "这种化学物质时,它们就会跟着化学物质向食物的方向移动。当更多的蚂蚁把食物运回巢穴时,它们就会加强化学痕迹。
本文意图是在重新在NetLogo实现“蚂蚁觅食”这个多智能体模型时掌握NetLogo相关技术。
NetLogo 实现分析
参照NetLogo模型库中的"Ants"模型实现来分析,可以大概分析出以下实现部分:
mindmap
实现
输入
按钮触发
参数调控
输出
模拟图形移动
数据图表
其中,显著的两个区分部分分别是:
- 输入
- 输出
输入的调控包括:
- 按钮事件触发
- 初始化设置
setup - 开始运行
go
- 初始化设置
- 参数调控
- 蚂蚁人口
population - 信息素扩散率
diffusion-rate - 信息素蒸发率
evaporation-rate
- 蚂蚁人口
例程
mindmap
setup
setup-patches
setup-nest
setup-food
recolor-patch