runcontest_actual

runcontest_actual - function [message,results,timeElapsed] =

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
function [message,results,timeElapsed] = runcontest(drawboard) %RUNCONTEST Test an entry. % [MESSAGE,RESULTS,TIME] = 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. % % Copyright 2005 The MathWorks, Inc. % % Argument parsing. if (nargin < 1) drawboard = 0; end e % Define constants. scentDecay = 1; range = -2:2; secret = 8; load testsuite_actual testsuite l % 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(main,scent,food,locs,1); end nAnts = sum(ants(:)); for timeCtr = 1:1000 for antCtr = 1:nAnts
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/12/2010 for the course ME master taught by Professor Mon during the Spring '09 term at Hanyang University.

Page1 / 4

runcontest_actual - function [message,results,timeElapsed] =

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online