Last change
on this file since 29 was 29, checked in by Rick van der Zwet, 15 years ago |
Crap files in wrong directory
|
File size:
519 bytes
|
Rev | Line | |
---|
[28] | 1 | % Monte-Carlo Search Algoritm on low-autocorrelation program
|
---|
| 2 | % BSDLicence
|
---|
| 3 | % Rick van der Zwet - 0433373 - <hvdzwet@liacs.nl>
|
---|
| 4 |
|
---|
| 5 | best_fitness = 0;
|
---|
| 6 | while (1)
|
---|
| 7 | % Generate a column s={-1,1}^n
|
---|
| 8 | n = 20;
|
---|
| 9 | s = rand(n,1);
|
---|
| 10 | s = round(s);
|
---|
[29] | 11 | s = (s == 0) .- 1;
|
---|
[28] | 12 |
|
---|
| 13 | % Find whether we are better than everything else
|
---|
[29] | 14 | fitness = SHG(s);
|
---|
[28] | 15 | if (fitness > best_fitness)
|
---|
| 16 | best_array = s;
|
---|
[29] | 17 | best_fitness = fitness
|
---|
[28] | 18 | % Little hack to display output nicely
|
---|
| 19 | disp(rot90(s,-1));
|
---|
| 20 | endif
|
---|
| 21 | endwhile
|
---|
| 22 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.