You are on page 1of 25

Mat-2.

108 Independent research projects in


applied mathematics
Applying a Genetic Algorithm in Cellular
Radio Network Optimization
Esa Tuomaala
45783P
28th January 2002

Abstract
This project studies the application of the genetic algorithm in
optimizing cellular radio networks. The aim of the algorithm is to
allocate the available frequency channels in such a way that the average
quality of the signals that the mobile stations receive is maximized,
while meeting the minimum requirement even for the worst signals.
In this study, a genetic algorithm for solving the channel allocation
problem is implemented in MATLAB environment and the parameters
of the genetic algorithm are tuned so that the algorithm converges
nicely. Also, results for an example case are presented. The MATLAB
code written for this project is given in appendix.

1
CONTENTS

Contents
1 Introduction 3
2 The network 4
2.1 Topology of the network . . . . . . . . . . . . . . . . . 4
2.2 Propagation modeling . . . . . . . . . . . . . . . . . . 4
3 On the Genetic Algorithm 6
4 Implementation 9
4.1 Initialization . . . . . . . . . . . . . . . . . . . . . . . 9
4.2 Crossover . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.3 Mutation . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.4 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.5 Selection . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5 GA parameter tuning 12
5.1 Crossover probability . . . . . . . . . . . . . . . . . . . 12
5.2 Mutation probability . . . . . . . . . . . . . . . . . . . 13
5.3 Number of generations . . . . . . . . . . . . . . . . . . 14
6 Results 15
6.1 Maximum tness with dierent numbers of frequency
channels . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6.2 Comments on the performance . . . . . . . . . . . . . 16
7 Summary and discussion 17
A MATLAB code 18
A.1 rungene.m . . . . . . . . . . . . . . . . . . . . . . . . . 18
A.2 crossover.m . . . . . . . . . . . . . . . . . . . . . . . 19
A.3 mutate.m . . . . . . . . . . . . . . . . . . . . . . . . . 20
A.4 scores.m . . . . . . . . . . . . . . . . . . . . . . . . . 21
A.5 NWsetup.m . . . . . . . . . . . . . . . . . . . . . . . . . 22
A.6 hexarandom.m . . . . . . . . . . . . . . . . . . . . . . . 23

2
1 INTRODUCTION

1 Introduction
The received signal quality in cellular radio networks depends basically
on three things: the received signal power, the interference power, and
the level of background noise. The received signal power depends on
the distance between the transmitter and the receiver, and thus, it can-
not be optimized. Also, the level of background noise is something that
cannot be changed. Therefore, optimizing the signal quality must be
done by minimizing the interference. In this project, only co-channel
interference is taken into account.
The sources of the interference that the mobile stations receive are the
other connections on the same frequency channel in the other parts
of the network. The closer the interferer, the higher the interference
it causes. This gives rise to a question of `how should the available
frequency channels be allocated to the mobile stations so that the per-
formance of the network is optimized'. In any matured cellular network
the number of users is much larger than the number of frequency chan-
nels. Therefore, each channel is shared by several users, but if their
connections do not take place too close to each other, then they do not
interfere each other too much.
In this project the applying of genetic algorithms for radio network
optimization problems is studied. Given the network topology and the
locations of the mobile stations in it, one of the available frequency
channels is allocated for each mobile. If the number of available chan-
nels is and the number of mobile stations in the network is , then
N M

there are N possible allocation combinations. For any real life net-
M

work N
M
is such a big number that there is no way to go through
all the combinations in searching the most suitable one. Genetic algo-
rithms provide means for solving the problem more eectively.
This study includes the formulation of the cellular network optimiza-
tion problem in such a way that it can be solved using a genetic algo-
rithm, and the implementation of the algorithm in MATLAB environ-
ment. The behavior of the algorithm is studied, and the its parameters
are tuned accordingly. Results for an example network are also pre-
sented.
This document has the following structure: Section 2 gives the setup
of the example network under study and introduces some basic prop-
agational results that are used. In Section 3, the basics of the genetic
algorithms are introduced. The implementation of the algorithm is ex-
plained in Section 4, and its parameters are tuned in Section 5. Some
results for the example network are presented in Section 6. Section 7
summarizes the work done.

3
2 THE NETWORK

2 The network
2.1 Topology of the network
The topology of the network under study is presented in Figure 1 be-
low. The network consists of 19 base transceiver stations, each serving
one cell with a radius of one kilometer. The cells form a hexagonal
grid.
In each cell there are three mobile stations. The locations of the mo-
biles are chosen at random from a distribution that is uniform over the
corresponding hexagonal cell.
4

1
y [km]

−1

−2

−3

−4

−5 −4 −3 −2 −1 0 1 2 3 4 5
x [km]

Figure 1: The topology of the network under study. Base transceiver stations
are in the middle of the cells, and mobile stations are marked by crosses.

2.2 Propagation modeling


The amount of attenuation that the signal experiences in the air in-
terface between the transmitter and the receiver, pathloss, can be cal-
culated using the following model [1]:
Lp = 40(1 , 0 004 ) log( ) , 18 log( ) + 21 log( ) + 80dB (1)
: h R h f ;

where

4
2.2 Propagation modeling

Lp is the attenuation in dB,


 is the height of the base station antennas above the
h

rooftop level in meters,


R is the distance between the transmitter and the receiver
in kilometers, and
f is the carrier frequency in MHz.
This formula gives the attenuation on average, i.e., possible fading
eects are not taken into account.
Assuming  equal to 15 meters and a UMTS carrier frequency of
h

2000 MHz, and adding the antenna gain of 9 dB [5], we get the total
loss, , as a function of only:
L R

L = 119 1 + 37 6 log( )
: : R : (2)

Furthermore, the signal power at the receiver, Rx , is P

P Rx = Tx ,
P L (3)
where Tx is the transmission power of 43 dBm.
P

The quality of the received signal not only depends on the received
signal power, Rx , but also on the amount of interference and noise.
P

For this, a concept of signal-to-interference-and-noise ratio, SINR [2]


is needed:
SINR = P Rx C [mW] P ;
(4)
j
[mW] + [mW]
i 2I PRx ;i N 0
;

where
SINR is the SINR for mobile station j on the linear scale,
j

PRx C [mW] is the received carrier power in mW,


;

PRx i [mW] is the received power of the interfering signal ar-


;

riving from base station in mW, i

I is the group of connections using the same frequency chan-


nel, and
N 0 [mW] is the thermal noise in mW.
Switching between the linear (mW) and decibel (dB/dBm) scales can
be done with the following, well known relations:
x[dBm] = 10  log ( [mW]) x (5)
x [mW] = 10^( [dBm] 10) x = : (6)

5
3 ON THE GENETIC ALGORITHM

3 On the Genetic Algorithm


Genetic algorithms are based on the biological idea of the survival of
the ttest: evolution is a result of competition among a population,
where the weakest individuals are eliminated [4]. In the genetic al-
gorithms new generations of individuals are produced through genetic
operations that are analogous to gene transfer in sexual reproduction.
A tness function evaluates each individual to decide whether it will
contribute to the next generation or not.
The general form of genetic algorithms is presented in Figure 2. The
contents of the blocks in the ow chart are explained in greater details
in the next paragraphs.

Initialization

Carry out crossover


Mutate with a Evaluate the
procedure with a
defined probability candidates
defined probability

Select the strongest Is the termination


No
candidates condition met?

Yes

Terminate

Figure 2: Flow chart of a general form of the genetic algorithm.

Initialization
In the initialization, one generates, often randomly, a population from
which new generations are formed. At this point one also needs to de-
ne the terminating condition so that the the algorithm stops running
once an acceptable solution is found.
Crossover
Crossover is one of the genetic operator used in producing new candi-
dates using the features of the existing ones. The crossover procedure
is illustrated in Figure 3 below.

6
3 ON THE GENETIC ALGORITHM

Pick up two parents 1 1 1 1 1 1 1 1 1

2 2 2 2 2 2 2 2 2

Select the crossover 1 1 1 1 1 1 1 1 1


points

2 2 2 2 2 2 2 2 2

Switch the values 1 1 2 2 2 1 1 1 1

2 2 1 1 1 2 2 2 2

Figure 3: Crossover procedure.

The crossover procedure consists of three parts. First one selects two
parents from the population. Then the crossover points are selected.
The selection of crossover points is done at random, usually so that
the distribution from which the points are drawn from is uniform. In
Figure 3 two crossover points are marked with dotted lines. Once the
points are dened two osprings are generated by interchanging the
values between the two parents as illustrated in the gure.
In the genetic algorithm crossover is the operator that spreads the
advantageous characteristics of the members around the population.
Mutation
In the genetic algorithm mutation is the operator that causes totally
new characteristics to appear in the members of the population. In
many cases the mutations, of course, result in osprings that are worse
than the other members, but sometimes the result has such character-
istics that make it better.
Figure 4 below demonstrates the mutation operation. First, one selects
a member from the population to be mutated and a point of mutation.
Then the values at the point of mutation is replaced by another value
that is picked randomly from the set of all possible values.

7
3 ON THE GENETIC ALGORITHM

1 1 1 1 1 1 1 1 1

1 1 2 1 1 1 1 1 1

Figure 4: Mutation.

Evaluation
After the population is manipulated using the genetic operators, the
tness of each of the new osprings is evaluated. For this one needs
to have a numerical function, tness function.
Selection
In the selection the weakest individuals in the population are elimi-
nated. The most t osprings survive to the next generation.

8
4 IMPLEMENTATION

4 Implementation
A genetic algorithm that searches for optimal channel allocations for
the example network presented in Subchapter 2.1 was implemented
in MATLAB environment. In this section the details of the imple-
mentation are presented, the complete MATLAB code is given in Ap-
pendix A.

4.1 Initialization
The population is formed so that there are 12 individuals that are
represented as vectors. The length of each of the individuals is the
same as the number of mobile stations connected to the network. The
ith value in the vector gives the frequency channel that mobile station
i is using.
Because one of the purposes of this project is to study the performance
of the genetic algorithm, the individuals are initialized corresponding
to a worst case situation, i.e., such case in which all the mobile stations
are allocated to the same channel. In this case the one selected is the
channel number one.
The terminating condition is dened by the number of generations to
be produced. In order to better compare the dierent evolutions the
length of the run should be constant. Later, this `age' of the population
is selected so that the algorithm works optimally.

4.2 Crossover
In crossover procedure the population of 12 parents is collected into
pairs of two so that the rst parent is paired with the twelfth one,
the second parent with the eleventh one, and so on. The crossover is
executed twice for each pair of parents. Therefore, they will get four
children.
Overall, the size of the population of children is 24. The order of the
children is mixed so that the siblings are not always next to each other
in the new generation, see Figure 5.
In crossover there is also a probability, namely crossover probability,
involved. With this probability the crossover is done, otherwise the
children are identical to their parents. The crossover probability is
one of the parameters of the algorithm to be tuned later on.
A MATLAB implementation of crossover is presented in Appendix A.2.

9
4.3 Mutation

1 12 2 11 3 10 4 9 5 8 6 7

X−over X−over X−over X−over X−over X−over

1 7 13 19 2 8 14 20 3 9 15 21 4 10 16 22 5 11 17 23 6 12 18 24

Figure 5: Crossovers.

4.3 Mutation
Mutation is carried out for the individuals after the crossover proce-
dure. In mutation one changes one of the values in a vector represent-
ing an individual. This is carried out with a pre-dened probability,
mutation probability. Just like crossover probability, this mutation
probability is one of the parameters of the algorithm.
A MATLAB implementation of mutation is presented in Appendix A.3.

4.4 Evaluation
A smart channel allocation has basically two characteristics. Firstly,
the average signal-to-interference-and-noise ratio, SINR, that mobile
stations receive must be as high as possible. This reects the overall
performance of the network. On the other hand, the minimum SINR
requirement for all the users must be met. In this case the minimum
requirement is set at SINR = 9 dB.
The tness function in this case has the following form:
tness d + penalty + jitter
= SINR ; (7)
where
d
SINR is the SINR that the mobile stations experience on
average in dB,
penalty decreases the tness if some mobiles experience a
SINR that is lower than 9 dBm, and
jitter adds randomness.
The penalty and jitter, respectively, are calculated with the following
formulas:
  
penalty = ,5  9 , min 9 min (SINR ) ; (8)
 
10
jitter =
# +1  G
U; (9)
where
10
4.5 Selection

# is the order number of the corresponding generation,


G

and
U is a random number from a uniform distribution between
0 and 1.
Obviously, the eect of jitter becomes negligible in higher generations.
In the beginning however, when # is small, jitter has an eect on
G

the tness ; this way none of the individuals do not start to dominate
the others too much at a point when all of the individuals are equally
bad.
A MATLAB implementation for tness function, scores.m, is pre-
sented in Appendix A.4.

4.5 Selection
A simple selection scheme is utilized. Of the 24 individuals the worse
half is eliminated and the rest will contribute to the next generation.
In the MATLAB implementation, selection is carried out in function
rungene.m, see Appendix A.1 for details.

11
5 GA PARAMETER TUNING

5 GA parameter tuning
There are three parameters related to the implementation of the ge-
netic algorithm that must be tuned before the algorithm is used. These
parameters are crossover probability (Subsection 4.2), mutation proba-
bility (Subsection 4.3), and the number of generations to be produced
(Subsection 4.1). Crossover and mutation probability aect on how
the population evolves in time, and the number of generation must be
chosen so that the optimal, or at least a good one, solution is found
but not too many generations are produced in vain.

5.1 Crossover probability


In order to study the eect of crossover probability on the evolution,
the algorithm is run with dierent crossover probabilities ranging from
0.2 to 1.0. For these runs the mutation probability is equal to 0.4, and
the maximum tness for each generation is traced. The results are
shown in Figure 6 below.
30

20

10

0
Score

−10

−20

P(crossover)=0.2
−30 P(crossover)=0.4
P(crossover)=0.6
P(crossover)=0.8
P(crossover)=1.0
−40
0 50 100 150 200 250 300 350 400 450 500
Generation

Figure 6: Evolution of tness with dierent crossover probabilities ranging


from 0.2 to 1.0.

From Figure 6 it can be seen that with all the values of crossover
probability the evolution converges pretty nicely. Even though there
are some dierences between the runs, the time of convergence seems
to be mostly a matter of luck. With the crossover probabilities closer
to one the evolution converges slightly faster, and therefore, a value of
0.8 is chosen to be the crossover probability with which the nal results

12
5.2 Mutation probability

are generated. A probability of 1.0 is not selected because it seems to


behave somewhat chaotically even though it converges fastest.

5.2 Mutation probability


The eect of mutation probability is studied similarly to that for
crossover probability in the previous subsection. The algorithm is run
with ve dierent mutation probabilities from ranging 0.2 to 1.0. The
maximum tness as a function of generation is presented in Figure 7
for all of the ve runs.
30

20

10

0
Score

−10

−20

P(mutation)=0.2
−30 P(mutation)=0.4
P(mutation)=0.6
P(mutation)=0.8
P(mutation)=1.0
−40
0 50 100 150 200 250 300 350 400 450 500
Generation

Figure 7: Evolution of tness with dierent mutation probabilities ranging


from 0.2 to 1.0.

Figure 7 shows that the evolution of the population signicantly de-


pends on the mutation probability. With high mutation rate the better
values of tness are reached faster but, on the other hand, the pop-
ulation acts chaotically and the maximum is not reached in the later
generations. This shows that if the mutation probability is very high,
then some of the advantageous characteristics of the generations are
eliminated by mutation and the tness of the population does not
converge.
With lower values of mutation probability the tness evolves more
slowly but the the population do not act chaotically. Therefore, the
requirement of convergence is met.
A good compromise between fast avolution and nice convergence seems
to be at a mutation probability of 0.4.

13
5.3 Number of generations

5.3 Number of generations


The number of generation to be produced is selected so that the al-
gorithm almost always converges to a good value of tness. From
Figure 6 and Figure 7 it can be seen that with reasonable values of
crossover and mutation probability the algorithm has easily converged
before the 300th generation. To be absolutely sure about the conver-
gence the algoritm is run over 400 generations. Such high condence
margin can be selected because the computations for a system of this
size do not take very long for a starndard computer of today. For
larger systems a less conservative approach may be selected.

14
6 RESULTS

6 Results
The performance of the algorithm in optimizing cellular radio networks
is studied in this section. In the system to be optimized there are 19
base stations as illustarted in Figure 1 and three mobile stations in
each cell. The locations of the mobile stations are chosen randomly,
but the coordinates have been the same in every case. Because the
mobile positions aect on the tness, having the locations unchanged
decreases the unwanted variability in the results.

6.1 Maximum tness with dierent numbers of


frequency channels
The network is optimized for dierent number of frequency channels
ranging from 5 to 21. Obviously, the larger the number of frequency
channels the better should the network perform. The number of inter-
ferers is smaller if there are more channels to allocate on.
35

30

25

20

15
Final Score

10

−5

−10

−15
4 6 8 10 12 14 16 18 20 22
Number of Frequencies

Figure 8: The resultins maximum tness as a function of the number of


frequency channels.

The results are plotted in Figure 8. With the lowest numbers of fre-
quency channels the maximum tness is very bad. In these cases not
all of the moibile stations experience a SINR higher than 9 dB. This
results in penalty term dominating the tness. In other worls, the mo-
bile stations are packed so tightly on the available frequency channels
that it is not possible to meet the minimum requirements for all the

15
6.2 Comments on the performance

of them. In cases where there are more than 9 frequency channels the
maximum tness increses with a slope smaller than that with cases
where there are less than 9 frequency channels. In this case the mini-
mum requirements of SINR = 9 dB is met for all the mobile stations
and the tness is dominated by the average SINR. The eect of jitter
10  1  0 025. Therefore, its eect can not be
is at most equal to 400+1 :

seen in Figure 8.

6.2 Comments on the performance


One can also see that the resulting maximum tness increases pretty
consistently with the number of frequency channels. This suggests
that the algorithm in each run nds a solution that is close to the
global maximum. Getting stuck with local maximums would cause
inconsistency in the curve.
The number of possible allocations is N
M
, where is the total num-
N

ber of available frequencies, and is the number of mobile stations


M

in the network. In the cases studied here this goes from 457  2  1034
to 2157  2  1075 . Clearly, nding the optimal allocations by going
through all the possibilities is not possible, which justies the use of
more intelligent methods such as genetic algorithms. With the imple-
mentation of a genetic algorithm used here the number of allocations to
be evaluated is 24  400 = 9600 even though a very conservative safety
margin was selected for the number of generations to be produded.

16
7 SUMMARY AND DISCUSSION

7 Summary and discussion


This project presented a cellular radio network optimization prob-
lem and studied the applicability of genetic algorithms on solving it.
Firstly, the problem was formulated so that solutions can be searched
using a genetic algorithm, and then a genetic algorithm was imple-
mented in MATLAB environment. The eects of three parameters,
namely crossover probability, mutation probability, and the number of
generations to be produced, were briey studied by tracing the evo-
lution of the initial population with dierent parameter values. The
most suitable parameter values were then suggested. Finally, the per-
formance of an example network was optimized with the genetic algo-
rithm.
The application of genetic algorithms in radio network optimization
sets two requirements for the network. Firstly, the propagation envi-
ronment must be known and a suitable model for it must be available.
In urban areas the attenuation that the signals experience in the air
interface is, of course, very dierent from that in urban areas. Sec-
ondly, the locations of the mobile stations must be known. In most
of the networks this is not the case yet. In the near future, however,
the locationing services will be launched, which among other things
enables the use of more advanced optimization methods.
The results reported show that the genetic algorithm works relatively
consistently in optimizing the network; the resulting performance of
the network increases with available resources (frequency channels) as
expected. The fact that the results form a smooth curve in Figure 8
prove that the algorithm in most cases converges close to the global
maximum.
Compared to the exhaustive search the performance of the genetic
algorithm in nding solutions to this problem is superb; with an ex-
haustive search the number of points to be checked would have risen
at least 2  1034 , depending on the case under study, whereas the ge-
netic algorithm found a good solution by checking 9600 points only.
Here, the genetic algorithm started with a worse-case initial popula-
tion; in a real life systems this should not be the case, which makes
the convergence even faster. Also, for the number of generations less
conservative safety margins may be used if the computational power
becomes an issue and if it is good enough just to nd a good solution
and not necessarily the very best one.

17
A MATLAB CODE

A MATLAB code
A.1 rungene.m
This is the core of the algorithm that runs the process and from which
the other functions are called. One should note that some parameters
must be initialized beforehand with NWsetup.m (Appendix A.5).

function MS_freq_pro = rungene(N_freqs, MS_cell, RxP_dB, N_gen);


%
% This function runs the genetic algorithm
%
% USAGE: rungene(N_freqs, BTS_loc, MS_loc, MS_cell, N_gen);
%
% N_freqs is the number of frequencies
% BTS_loc is a matrix with the coordinates of the BTSs
% MS_loc is a matrix with the coordinates of the MSs
% MS_cell is a vector that tells in which cell each MS is
% N_gen is the number of generations to be done
%

N_MS = length(MS_cell);
co_prob = 0.8;
mt_prob = 0.4;

% Open result file


filename = ['GAresults_f' num2str(N_freqs) '.dat'];
fid = fopen(filename, 'w');

% Initialization
% Start with a population of 12
% Worst case individuals (in each combination all the
% MSs are using the same frequency)

MS_freq_sel = zeros(12, N_MS) + 1;


MS_freq_pro = zeros(2*12, N_MS);

%
% Run the algo here.
%

gen_number=1;
while (gen_number<=N_gen)

18
A.2 crossover.m

% Crossover
for i=1:6
temp=crossover(MS_freq_sel(i,:),MS_freq_sel((12-i+1),:),co_prob);
MS_freq_pro(i,:) = temp(1,:);
MS_freq_pro((i+6),:) = temp(2,:);
temp=crossover(MS_freq_sel(i,:),MS_freq_sel((12-i+1),:),co_prob);
MS_freq_pro(i+12,:) = temp(1,:);
MS_freq_pro((i+18),:) = temp(2,:);
end;

% Mutation
for i=1:24
MS_freq_pro(i,:) = mutate(MS_freq_pro(i,:), N_freqs, mt_prob);
end;

% Compute the scores


for i=1:24
score(i) = scores(MS_freq_pro(i,:), MS_cell, RxP_dB, gen_number);
end;

disp([num2str(gen_number) ' Gs... Score ' num2str(max(score))])


fprintf(fid, '%i %f\n', gen_number, max(score));

% Select 12 best rows from MS_freq_pro and


% save them in MS_freq_sel
sel_indices = find(score>=median(score));
j=1;
for i=sel_indices
MS_freq_sel(j,:) = MS_freq_pro(i,:);
j = j + 1;
end;

gen_number = gen_number + 1;

end;

A.2 crossover.m
This function carries out the crossover procedure.

function cc = crossover(vect1, vect2, prob);

19
A.3 mutate.m

%
% This function carries out a crossover for two vectors
% with a probability of prob.
%
% USAGE: crossover(vect1, vect2, prob)
%
% vect1 and vect2 are vectors of the same size
% prob is the crossover probability
%

if (length(vect1)~=length(vect2) | prob<0 | prob>1)


aa = sprintf('%s','Illegal input in crossover...')
return;
end;

if (rand<prob)
position1 = ceil((length(vect1)-2)*rand) + 1;
position2 = ceil((length(vect1)-2)*rand) + 1;
if (position1>position2)
temp = position1;
position1 = position2;
position2 = temp;
end;

for i=position1:position2
temp = vect1(i);
vect1(i) = vect2(i);
vect2(i) = temp;
end;
end;

cc = [vect1; vect2];

A.3 mutate.m
This function mutates the individual that is given as input.

function bb = mutate(vect, maxvalue, prob);

%
% This function mutates the values in vect with
% a probability of prob. Possible values go

20
A.4 scores.m

% from 1 to maxvalue.
%
% USAGE: mutate(vect, maxvalue, prob);
%

if (maxvalue<1 | prob<0 | prob>1)


aa = sprintf('%s','Illegal input in mutate...')
return;
end;

if (rand<prob)
position = ceil(length(vect)*rand);
vect(position) = ceil(maxvalue*rand);
end;

bb = vect;

A.4 scores.m
This function evaluates the individual that is given as input. The
tness is calculated by (7).

function dd = scores(MS_freq, MS_cell, RxP_dB, gen);

%
% This function computes the score for vector MS_freq
% in the genetic algorithm.
%
% USAGE: scores(MS_freq, MS_cell, RxP_dB)
%
% MS_freq is a vector that tells which frequency each MS
% is using
% MS_cell tells in which cell each MS is
% RxP_dB is a matrix with entry (i,j) how much power MS i
% receives from BTS j
% gen is the number of the corresponding generation
%

N_MS = length(MS_freq);

I_mW = zeros(N_MS, 1);


C_mW = zeros(N_MS, 1);

21
A.5 NWsetup.m

for i=1:N_MS
for j=1:N_MS
if (MS_freq(j)==MS_freq(i) & j~=i)
I_mW(i) = I_mW(i) + 10^(RxP_dB(i,MS_cell(j))/10);
elseif (j==i)
C_mW(i) = 10^(RxP_dB(i,MS_cell(j))/10);
end;
end;
end;

I_mW = I_mW + 10^(-111/10); % Thermal noise added

for i=1:length(MS_freq)
I_dB(i) = 10 * log10(I_mW(i));
C_dB(i) = 10 * log10(C_mW(i));
CIR_dB(i) = C_dB(i) - I_dB(i);
end;

% Return the score plus a tiny jitter to prevent equal


% scores from appearing

dd = mean(CIR_dB)-5*(9-min(9,min(CIR_dB)))+10/(gen+1)*rand;

A.5 NWsetup.m
This script initializes some parameters and must be run before the
rungene.m (Appendix A.1). The base station coordinates and the
number of mobile stations per cell are dened here.

clear all;
cell_radius = 1; % Cell radius in km
cell_mobiles = 3; % Number of mobile staions per cell

% BTS coordinates

BTS_loc = [0 0;3/2 1;0 2;-3/2 1;-3/2 -1;0 -2;


3/2 -1;3 0;3 2;3/2 3;0 4;-3/2 3;-3 2;
-3 0;-3 -2;-3/2 -3;0 -4;3/2 -3;3 -2];
BTS_loc = BTS_loc*[cell_radius 0;0 (sqrt(3)/2)*cell_radius];

22
A.6 hexarandom.m

% Coordinates of the mobile stations

for i=1:(cell_mobiles*length(BTS_loc)),
j = ceil(i/3);
MS_loc(i,:) = BTS_loc(j,:) + hexarandom(cell_radius);
MS_cell(i) = j;
end;
MS_cell=MS_cell';

% Compute path losses and received DL powers for


% all MS-BTS pairs

N_BTS = length(BTS_loc); % Number of base stations


N_MS = length(MS_cell); % Number of mobile stations
dh = 15; % BTS antenna height (m)
f = 2000; % carrier frequency (MHz)
G = 30; % BTS antenna gain (dB)

p_losses = zeros(N_MS, N_BTS);

for i=1:N_MS
for j=1:N_BTS
R = max(0.015,sqrt(sum((MS_loc(i,:)-BTS_loc(j,:)).^2)));
p_losses(i,j) = 119.1+37.6*log10(R);
end;
end;

RxP_dB = 43 - p_losses;

A.6 hexarandom.m
This function randomly pick coordinates from a uniform distribution
inside a hexagon with a radius of 1. The implementation is such that
only two random numbers are generated, which makes it computation-
ally eective.

function aa = hexarandom(cell_radius);

x = rand;
y = 3 * rand;

23
A.6 hexarandom.m

if ( y<1 & x<(1-y) )


sector=1;
elseif ( y<1 )
sector=2;
elseif ( y<2 & x<(2-y) )
sector=3;
elseif ( y<2 )
sector=4;
elseif ( x<(3-y) )
sector=5;
else
sector=6;
end;

x = x + y/2;
y = y*sqrt(3)/2;

if (sector == 2)
x=x-1;
elseif (sector==3)
x=x-3/2;
y=y-sqrt(3)/2;
elseif (sector==4)
x=x-2;
y=y-sqrt(3);
elseif (sector>=5)
x=x-3/2;
y=y-3*sqrt(3)/2;
end;

aa = cell_radius*[x y];

24
REFERENCES

References
[1] European Telecommunications and Standards Institute, ETSI TR
101 112 version 3.2.0, Universal Mobile Telecommunications Sys-
tem (UMTS); Selection procedures for the choise of radio trans-
mission technologies for the UMTS, 1998
[2] Steven W. Smith, The Scientist and Engineer's Guide to Digital
Signal Processing, California Technical Publishing, 1998
[3] Hans-Paul Schwefel, Evolution and Optimum Seeking, John Wi-
ley & Sons, New York, 1994
[4] George F. Luger and William A. Stubbleeld, Articial Intelli-
gence: Structures and Strategies for Complex Problem Solving,
3rd ed., Addison-Wesley, Massachusetts, 1998
[5] www.mobilemark.com/PCS_WLL_Wireless_antennas.html1

1 link checked Jan 28th, 2002

25

You might also like