资源简介
蚁群算法工具箱蚁群算法资料:蚁群算法工具箱蚁群算法资料:蚁群算法工具箱蚁群算法资料:蚁群算法工具箱蚁群算法资料:蚁群算法工具蚁群算法工具箱蚁群算法资料:箱蚁群算法资料:蚁群算法工具蚁群算法工具箱蚁群算法资料:箱蚁群算法资料:蚁群算法工具箱蚁群算法资料:蚁群算法工具箱蚁群算法资料:

代码片段和文件信息
function [messageresultstimeElapsed] = runcontest(drawboard)
%RUNCONTEST Test an entry.
% [MESSAGERESULTSTIME] = RUNCONTEST(DRAWBOARD) runs the M-file
% solver.m against all the problems defined in testsuite_sample.mat. The
% input DRAWBOARD specifies if you want to graphically visualize the results.
% MESSAGE returns a summary of the testing. RESULTS measures how well the
% entry solved the problem and TIME measures the time the entry took to
% compute its answer.
% Argument parsing.
if (nargin < 1)
drawboard = 0;
end
% Define constants.
scentDecay = 1;
range = -2:2;
load testsuite_sample testsuite
% Run the submission for each problem in the suite.
score = zeros(size(testsuite));
time0 = cputime;
for i = 1: numel(testsuite)
main = testsuite(i).main;
food = testsuite(i).food;
scent = testsuite(i).scent;
ants = testsuite(i).ants;
locs = testsuite(i).locs;
if drawboard viewsolution(mainscentfoodlocs1); end
nAnts = sum(ants(:));
for timeCtr = 1:1000
for antCtr = 1:nAnts
y = locs(antCtr1);
x = locs(antCtr2);
yv = y + range;
xv = x + range;
mainMap = main(yvxv);
foodMap = food(yvxv);
antMap = ants(yvxv);
scentMap = scent(yvxv);
% call ant micro-program
clear global
[dydxmarkcarry] = solver(mainMapfoodMapantMapscentMap);
% figure out the new ant position
ny = y;
nx = x;
if dy>0
ny = ny+1;
elseif dy<0
ny = ny-1;
end
if dx>0
nx = nx+1;
elseif dx<0
nx = nx-1;
end
% validate move
if main(nynx)<0
ny = y;
nx = x;
end
% move food when carry is true
if carry & food(yx)
food(yx) = food(yx) -1;
food(nynx) = food(nynx)+1;
end
% leave scent
mark = min(max(real(round(mark))0)100);
if mark
scent(yx) = scent(yx)+mark;
end
% move ant
locs(antCtr:)=[ny nx];
ants(yx) = ants(yx) -1;
ants(nynx) = ants(nynx)+1;
end % next ant
% time passes reduce scent
scent = max(0scent - scentDecay);
if drawboard
viewsolution(mainscentfoodlocs0)
drawnow
end
end % next time step
score(i) = grade(mainfood);
end % next problem in testsuite
% report the time
timeElapsed = cputime-time0;
if drawboard
% time is not accurate when drawing the board
timeElapsed = NaN;
end
% Report results.
results = sum(score);
message =
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 59512 2005-05-10 23:40 testsuite_sample.mat
文件 5091 2005-05-11 00:39 runcontest.m
文件 750 2005-05-11 00:33 solver.m
文件 68392 2005-05-19 23:10 testsuite_validation.mat
文件 58952 2005-05-10 23:40 testsuite_actual.mat
文件 5296 2005-05-19 23:12 runcontest_actual.m
- 上一篇:鲍德里亚 模拟物与拟像
- 下一篇:QQ自动回复机器人易语言源码
相关资源
- 基于蚁群算法的开采沉陷计算参数反
- 基于蚁群算法优化SVM的瓦斯涌出量预
- 蚁群算法论文合集
- 蚁群算法模型美赛B题C问,可直接调用
- 基于改进蚁群算法的车间调度研究方
- 基于蚁群算法优化控制的研究及其在
- 基于改进蚁群算法的QoS组播路由问题
- 连续域蚁群算法
- 智能优化算法蚁群算法、狼群算法、
- 蚁群算法在机器人路径规划中的应用
- 蚁群算法.ppt蚁群算法.ppt
- 蚁群算法-车辆路径问题
- 线程池实现蚁群算法的简单并行
- 数学建模方法:蚁群算法
- Ant Colony Optimization书籍-英文版中文版
- 蚁群算法原理及其应用+2005[1].pdf,4
- 蚁群算法原理和应用段海滨版.pdf
- 蚁群算法原理及其应用.pdf
- 蚁群算法原理及其应用(完整版.高清
- 蚁群算法在配电网重构中的应用 书籍
- 蚁群算法原理及应用_段海滨_高清
- 车辆路径问题蚁群算法
- 蚁群算法研究综述 发展历史和特点
- 基于蚁群算法的二维路径规划算法
- 蚁群算法-TSP旅行商
- 基于蚁群算法的三维路径规划算法
- 蚁群算法的三维路径寻优
- 各种智能算法程序以求函数最值为例
- 多约束下多车场车辆路径问题的蚁群
- eil51.tsp.txt
评论
共有 条评论