source: liacs/nc/low-correlation/mcs-call.m@ 41

Last change on this file since 41 was 38, checked in by Rick van der Zwet, 15 years ago

Made it MatLab compatible

File size: 934 bytes
Line 
1% Monte-Carlo Search Algoritm on low-autocorrelation program
2% BSDLicence
3% Rick van der Zwet - 0433373 - <hvdzwet@liacs.nl>
4
5% Brute-force result of length 20
6% best_20 = [-1,1,1,-1,-1,-1,1,1,-1,1,-1,-1,-1,1,-1,1,1,1,1,1];
7
8% Basic variables
9iterations = [1:10:200];
10repetitions = 20;
11length = 20;
12
13% Plot the stuff
14fitnesses = [];
15for iteration = iterations
16 fitness = [];
17 for rep = 1:repetitions
18 fprintf('Iter:%i, Rep:%i\n',iteration,rep);
19 [new_fitness, value] = mcs(length,iteration);
20 fitness = [fitness, new_fitness];
21
22 % Little hack to display output nicely
23 % disp(rot90(value,-1));
24 end
25 fitnesses = [fitnesses,mean(fitness)];
26end
27
28plot(iterations,fitnesses);
29title(sprintf('Monte-Carlo Search on Low-Corretation set - repetitions %i',repetitions));
30ylabel('fitness');
31xlabel('iterations');
32grid on;
33legend(sprintf('Length %i',length));
34print('mcs-fitness.eps','-depsc2');
35
Note: See TracBrowser for help on using the repository browser.