NEIGHBOUR Find neighbour for simulated annealing algorithm. We will change one active frequency to a random passive frequency. (I tried more sophisticated neighbour schemes, but they worked less good, because they constrained the search too much.) The frequency selections are represented by arrays of type logical, where active frequencies are flagged true, inactive frequencies are flagged false. FORMAT snew = neighbour(sold) OUT snew New frequency selection. IN sold Old frequency selection.

- pick_random_freq PICK_RANDOM_FREQ Pick a random frequency.

- find_best_freq_set_anneal FIND_BEST_FREQ_SET_ANNEAL

0001 % NEIGHBOUR Find neighbour for simulated annealing algorithm. 0002 % 0003 % We will change one active frequency to a random passive 0004 % frequency. 0005 % 0006 % (I tried more sophisticated neighbour schemes, but they worked 0007 % less good, because they constrained the search too much.) 0008 % 0009 % The frequency selections are represented by arrays of type 0010 % logical, where active frequencies are flagged true, inactive 0011 % frequencies are flagged false. 0012 % 0013 % FORMAT snew = neighbour(sold) 0014 % 0015 % OUT snew New frequency selection. 0016 % IN sold Old frequency selection. 0017 0018 % 2008-09-24 Created by Stefan Buehler. 0019 0020 function snew = neighbour(sold) 0021 0022 % Pick random active frequency 0023 r_active = pick_random_freq(sold); 0024 0025 % Pick random inactive frequency 0026 r_inactive = pick_random_freq(~sold); 0027 0028 % Activate inactive frequency and inactivate active frequency 0029 snew = sold; 0030 snew(r_active) = 0; 0031 snew(r_inactive) = 1;

Generated on Fri 06-Jun-2014 14:06:19 by