Please copy and paste this embed script to where you want to embed

A REPORT ON

A RESEARCH PRACTICE ON INVESTIGATION OF EFFECTIVENESS OF GENETIC ALGORITHMS FOR RESOURCE ALLOCATION IN COGNITIVE RADIO BY ANANT BHUSHAN N 2013H140053G PREPARED FOR THE PARTIAL FULFILLMENT OF THE REQUIREMENTS OF BITS G540: RESEARCH PRACTICE COURSE UNDER GUIDANCE OF DR. M K DESHMUKH PROFESSOR DEPARTMENT OF EEE & I

Birla Institute of Technology and Science, Pilani K.K. Birla, Goa Campus 29rd April, 2014

1

2

Table of Contents List of Figures---------------------------------------------------------------------------------------------------------------------4 Acknowledgements-------------------------------------------------------------------------------------------------------------5 Abstract----------------------------------------------------------------------------------------------------------------------------6 3. Introduction-------------------------------------------------------------------------------------------------------------------7 3.1. Basics of Cognitive Radio---------------------------------------------------------------------------------------------7 3.1.1. Introduction To Cognitive Radio--------------------------------------------------------------------------------7 3.1.2. Software Defined Radio-------------------------------------------------------------------------------------------7 3.1.3. A More Elaborate Explanation on Cognitive Radio---------------------------------------------------------8 3.1.4. Requirements of Cognitive Radio-------------------------------------------------------------------------------9 3.2. Genetic Algorithms------------------------------------------------------------------------------------------------------9 3.2.1. Mapping Terminologies in Genetic Algorithms to Biology-----------------------------------------------10 3.2.2. Search Space and GA Operators---------------------------------------------------------------------------------11 3.2.2.1 A Note on Crossover----------------------------------------------------------------------------------------------11 4. Literature Survey-------------------------------------------------------------------------------------------------------------13 5. Work Done---------------------------------------------------------------------------------------------------------------------14 5.1. Study of Basics------------------------------------------------------------------------------------------------------------14 5.2. Hardware Implementation Methodology-------------------------------------------------------------------------14 5.3. Implementation of Genetic Algorithm-----------------------------------------------------------------------------15 5.3.1. Implementation1----------------------------------------------------------------------------------------------------16 5.3.2 Implementation2----------------------------------------------------------------------------------------------------16 5.3.2.1. Constraint Handling in GA-MPC-----------------------------------------------------------------------------18 5.3.2.2 Challenges faced in implementation2----------------------------------------------------------------------19 5.4. Results-----------------------------------------------------------------------------------------------------------------------22 5.4.1. Results for Implementation1---------------------------------------------------------------------------------------22 5.4.2. Results for Implementation2--------------------------------------------------------------------------------------23 5.4.2.1. Problem Statement 1--------------------------------------------------------------------------------------------23 5.4.2.2. Problem Statement 2--------------------------------------------------------------------------------------------29 5.5. Broad Conclusion---------------------------------------------------------------------------------------------------------34 6. Research Related Activities-----------------------------------------------------------------------------------------------36 7. Development Related Activities-----------------------------------------------------------------------------------------37 Research Proposal---------------------------------------------------------------------------------------------------------------38 References-------------------------------------------------------------------------------------------------------------------------39

3

List of Figures Figure 1: Block Diagram of communication System. .................................................................................................................... 7 Figure 2: One point Crossover .................................................................................................................................................... 12 Figure 3 : Two Point Crossover ................................................................................................................................................... 12 Figure 4: Cut and Splice .............................................................................................................................................................. 12 Figure 5: The Mathscript node in LABView that allows porting of M-Script files generated by MATLAB .................................. 15 Figure 6: Mathematical Model of the optimization problem that GA-MPC can solve ............................................................... 17 Figure 7: The proposed crossover in GA-MPC. Here β is a random number generated by the Gaussian Function ................... 17 Figure 8:The diversity operator in GA-MPC. Here, PS=Population Size, D=No. of elements in each population, rand is a random number generated from uniform distribution. ............................................................................................................. 17 Figure 9 : The GA-MPC Algorithm .............................................................................................................................................. 18 Figure 10: The penalty function for constraint handling ............................................................................................................ 19 Figure 11: The flow chart to generate population for next iteration from offspring ................................................................. 21 Figure 12: Final Result for Implemntation1 ................................................................................................................................ 22 Figure 13: Problem Statement1 for Implementation2 ............................................................................................................... 23 Figure 14: Initial Population for Sample output1 for Problem Statement1 of Implementation2 .............................................. 24 Figure 15 : Final Population for Sample output1 for Problem Statement1 of Implementation2 ............................................... 24 Figure 16: Parameters for Sample output1 for Problem Statement1 of Implementation2 ....................................................... 24 Figure 17: Initial Population for Sample output2 for Problem Statement1 of Implementation2 .............................................. 25 Figure 18: Final Population for Sample output2 for Problem Statement1 of Implementation2 ............................................... 25 Figure 19: Parameters for Sample output2 for Problem Statement1 of Implementation2 ....................................................... 25 Figure 20: Initial Population for Sample output3 for Problem Statement1 of Implementation2 .............................................. 26 Figure 21: Final Population for Sample output3 for Problem Statement1 of Implementation2 ............................................... 26 Figure 22: Parameters for Sample output3 for Problem Statement1 of Implementation2 ....................................................... 26 Figure 23: Initial Population for Sample output4 for Problem Statement1 of Implementation2 .............................................. 27 Figure 24: Final Population for Sample output4 for Problem Statement1 of Implementation2 ............................................... 27 Figure 25: Parameters for Sample output4 for Problem Statement1 of Implementation2 ....................................................... 27 Figure 26: Initial Population for Sample output5 for Problem Statement1 of Implementation2 .............................................. 28 Figure 27: Final Population for Sample output5 for Problem Statement1 of Implementation2 ............................................... 28 Figure 28: Parameters for Sample output5 for Problem Statement1 of Implementation2 ....................................................... 28 Figure 29: Problem Statement2 for Implemenation2 ................................................................................................................ 29 Figure 30: Initial Population for Sample output1 for Problem Statement2 of Implementation2 .............................................. 29 Figure 31 : Final Population for Sample output1 for Problem Statement2 of Implementation2 ............................................... 30 Figure 32 : Parameters for Sample output1 for Problem Statement2 of Implementation2 ...................................................... 30 Figure 33: Initial Population for Sample output2 for Problem Statement2 of Implementation2 .............................................. 30 Figure 34 : Final Population for Sample output2 for Problem Statement2 of Implementation2 ............................................... 31 Figure 35 : Parameters for Sample output2 for Problem Statement2 of Implementation2 ...................................................... 31 Figure 36: Initial Population for Sample output3 for Problem Statement2 of Implementation2 .............................................. 31 Figure 37 : Final Population for Sample output3 for Problem Statement2 of Implementation2 ............................................... 32 Figure 38 : Parameters for Sample output3 for Problem Statement2 of Implementation2 ...................................................... 32 Figure 39: Initial Population for Sample output4 for Problem Statement2 of Implementation2 .............................................. 32 Figure 40 : Final Population for Sample output4 for Problem Statement2 of Implementation2 ............................................... 33 Figure 41 :Parameters for Sample output4 for Problem Statement2 of Implementation2 ....................................................... 33 Figure 42 : Initial Population for Sample output5 for Problem Statement2 of Implementation2 ............................................. 33 Figure 43 : Final Population for Sample output5 for Problem Statement2 of Implementation2 ............................................... 34 Figure 44: Parameters for Sample output5 for Problem Statement2 of Implementation2 ....................................................... 34 Figure 45: A plot of average fitness function for 1000 iterations for problem statement1. ...................................................... 35 Figure 46 : A plot of average fitness function for 1000 iterations for problem statement2. ..................................................... 35

4

1. ACKNOWLEDGEMENTS I sincerely thank Dr. M K Deshmukh for the continued support and the able guidance he has provided throughout my research practice course. I render my deep felt gratitude to Mr. Nitin N Sharma for providing me with invaluable inputs, suggestions and an amicable platform to successfully complete my research practice course. I thank the entire faculty of the EEE&I department of BITS Pilani – K K Birla Goa Campus for the immense support they have provided during the course of this research practice. I render my deepest sense of gratitude to all the scientists, engineers, industrialists and mathematicians who have directly or indirectly contributed to the fields of both, cognitive radio and genetic algorithms for the remarkable contribution you have done in your respective fields. Without your successful accomplishments, I would not have had this wonderful field to work upon.

5

2. Abstract Genetic algorithms are used for optimizing functions pertaining to various complex problems in different fields. My research practice aims at directing these algorithms to answer the question as to whether these algorithms will be able to successfully contribute to optimizing fitness functions that arise from constraints imposed by cognitive radio communication. An algorithm known as GA-MPC, which is a fitness function optimization technique is implemented on MATLAB. For getting acclimatized with genetic algorithms, another basic fitness function has been considered, whose value has been attempted to be maximized. Both implementations have provided outputs with reasonable degree of success. An error of 17% and an error of 5% exist for both the implementation. The implementation has been tried upon two fitness functions which are considered to be benchmark problems. The GA-MPC algorithm addresses issues corresponding to both, inequality and equality constraints. The implementation so done can address inequality constraints only. The implementation is done using the M-Script file in MATLAB. The ultimate goal of this implementation is to be able to direct these algorithms to work for fitness functions that arise from Cognitive Radio. Keywords: Cognitive Radio, Genetic Algorithms, GA-MPC, Inequality Constraints.

6

3. Introduction 3.1. Basics of Cognitive Radio 3.1.1. Introduction to Cognitive Radio Underutilization of radio spectrum in traditional wireless communications systems along with the increasing spectrum demand from emerging wireless applications is driving the development of new spectrum allocation policies for wireless communications. These new spectrum allocation policies, which will allow unlicensed users (i.e., secondary users) to access the radio spectrum when it is not occupied by licensed users (i.e., primary users), will be exploited by the cognitive radio (CR) technology. [1] Cognitive radio will improve spectrum utilization in wireless communications systems while accommodating the increasing amount of services and applications in wireless networks. A cognitive radio transceiver is able to adapt to the dynamic radio environment and the network parameters to maximize the utilization of the limited radio resources while providing flexibility in wireless access. The key features of a CR transceiver include awareness of the radio environment (in terms of spectrum usage, power spectral density of transmitted/received signals, wireless protocol signalling) and intelligence. This intelligence is achieved through learning for adaptive tuning of system parameters such as transmit power, carrier frequency, and modulation strategy (at the physical layer), and higher-layer protocol parameters.

3.1.2. Software Defined Radio The basic premise on which cognitive radio works is based on SDR’s or Software defined Radio. The practical implementation of cognitive radios require that one needs hardware that has adaptive capabilities like the FPGA and the software defined Radio provides such a platform. A conventional communication system appears as follows:

Figure 1: Block Diagram of communication System.

Here is a short explanation on the functionalities of the different blocks available:

7

The antenna section, which receives (or transmits) information encoded in radio waves. The RF front-end section, which is responsible for transmitting/receiving radio frequency signals from the antenna and converting them to an intermediate frequency (IF). The ADC/DAC section, which performs analog-to-digital/digital-to-analog conversion. The digital up-conversion (DUC) and digital down-conversion (DDC) blocks, which essentially perform modulations of the signal on the transmitting path and demodulation of the signal on the receiving path. The baseband section, which performs operations such as connection setup, equalization, frequency hopping, coding/decoding, and correlation, while also implementing the link layer protocol.

In a generic radio, each one of the above modules was implemented using dedicated hardware. Such devices were one of the first few to come to the market as communication devices. As time elapsed and technology grew, the programmable digital radio came into the fore. Such devices use ASIC’s for the digital up conversion and down conversion and the baseband operations are done using software. Software-defined radio refers to technologies wherein these functionalities are performed by software modules running on field programmable gate arrays (FPGAs), digital signal processors (DSP), general-purpose processors (GPP), or a combination thereof. SDR’s enable programmability of both DDC/DUC and baseband processing blocks. Hence, operation characteristics of the radio, such as coding, modulation type, and frequency band, can be changed at will, simply by loading new software. Also multiple radio devices using different modulations can be replaced by a single radio device that can perform the same task.

3.1.3. A More Elaborate Explanation on Cognitive Radio As a principle cognitive radio is an extension of the idea of Software Defined Radio. Software defined Radio enables changing the network communication parameters by providing appropriate controls through software. However, Cognitive radio automates this principle and the communication device can alter its communication parameters depending upon the status of the channel. This invokes various challenges. First of all, the communication device should be able to sense the channel and estimate the various parameters within which the communication is already happening. If the primary users are already communicating, the secondary user within which the cognitive radio algorithm is running will have two choices depending upon the strategy that the algorithm provides. One of the choices, is that the secondary users abstain from communicating till the primary users communicate. Or the second choice is that the secondary users communicate within acceptable limits of interference to the primary users. It means that the secondary users communicate in manner that the communication of the primary users happens undeterred simultaneously on the same channel. Mitola was among the few who suggested such a technology as an evolution of the Software Defined Radio. He envisioned a technology with which the “Cognition” of a device regarding its communicating environment will enable it to utilize the spectrum allotted to it in a more effective manner. According to Mitola’s early vision, a CR would be realized through the integration of model-based reasoning with software radio and would be trainable in a broad sense, instead of just programmable. Mitola also outlined a cognitive cycle through which such radio can reconfigure itself through an on-going process of awareness (both of itself and the outside world), perception, reasoning, and decision making. Today, however, CR has become an all-encompassing term for a wide variety of technologies that enable radios to achieve various levels of self-configuration, and with an emphasis on different functionalities, ranging from ubiquitous wireless access, to automated radio resource optimization, to dynamic spectrum access for a future device-centric interference management, to the vision of an ideal CR. 8

Haykin, for example, defines CR as a radio capable of being aware of its surroundings, learning, and adaptively changing its operating parameters in real time with the objective of providing reliable anytime, anywhere, and spectrally efficient communication.[1] The U.S. Federal Communications Commission (FCC) uses a narrower definition for this concept: “A Cognitive Radio (CR) is a radio that can change its transmitter parameters based on interaction with the environment in which it operates. The majority of cognitive radios will probably be SDR (Software Defined Radio) but neither having software nor being field programmable is requirements of a cognitive radio.”[2]

3.1.4. Requirements of Cognitive Radio In a broad sense, a cognitive radio can be termed to have the following functionalities:

Reconfigurability: The ability of a device to alter the functionality it is implementing on the fly.

Intelligent Adaptive Behaviour: The ability to alter the parameters of communication without been a priori programmed to do so.

More particularly, any device that intends to behave as a cognitive radio should have the following functionalities or features:

Flexibility and agility: It is the ability to change the waveform and other radio operational parameters on the fly. In contrast, there is a very limited extent that the current multichannel multiradio (MC-MR) can do this. Full flexibility becomes possible when CRs are built on top of SDRs. Another important requirement to achieve flexibility is reconfigurable or wideband antenna technology. (A point which is less discussed)

Sensing: It is the ability to observe and measure the state of the environment, including spectral occupancy. Sensing is necessary if the device is to change its operation based on its new situation, not only based on precoded algorithms but also as a result of a learning mechanism.

Learning and adaptability: The ability to analyse sensory input, to recognize patterns, and modify internal operational behaviour based on the analysis of a new situation, not only based on precoded algorithms but also as a result of a learning mechanism. In contrast, the IEEE 802.11 MAC layer allows a device to adapt its transmission activity to channel availability that it senses. But this is achieved by using a predefined listen-before-talk and exponential back-off algorithm instead of a cognitive cycle.

The cognitive radio so introduced here is what I would like to work on. Such a cognitive radio poses various optimization constraint problems to which an amicable solution needs to be determined. This functionality can be done through either operations research techniques or the Genetic Algorithm technique. The genetic algorithm technique is known to be more generic and can cater to a wider class of problems than the operations research technique. Hence the first part of my research practice was to understand the behaviour or Genetic Algorithms whose introduction is followed suit.

3.2. Basics of Genetic Algorithms Genetic Algorithms belong to a wider class of algorithms known as Evolutionary Algorithms. Machine Learning and Neural Networks are the other two that cater to the same category. These evolutionary algorithms are used for solving various computational and real world problems such as Optimization, Artificial Intelligence, Stockmarket prediction, Bioinformatics, Encryption and Decryption of ciphers etc… Genetic Algorithms are popular for solving optimization problems for which I will be using them in Cognitive Radio.

9

Genetic Algorithms get their name from the way they are modelled. They are modelled using the genetic structure of biological species.

3.2.1. Mapping of terminologies in Genetic Algorithms to Biology All biological species consist of cells. These cells are in turn composed of chromosomes. Chromosomes can be modelled as entities that consist of “Characteristic features” of an organism known as gene. They are strings of a protein known as DNA. (Deoxyribonucleic acid). The structure and the attribute of the gene characterize the organism. The gene is a particular setup of proteins that has the ability to completely characterize a creature. The characterizations that it can provide are such as the colour of our skin, the colour of our eye, our thumbprint, the structure and proportion of our body etc… The different setup of the genes to encode a character is known as an allele, and the chromosome can now be considered to be consisting of a sequence of genes in the form of DNA that constitute unique alleles corresponding to that individual which exist as a combination inside a cell-the tiniest living component of a living organism. Advanced species such as mammals and reptiles consist of a class of chromosomes known as diploids. The chromosomes of more primitive species belong to a class known as haploids. Diploids consist of a pair of chromosomes, where each chromosome is indicating one property. For example, a human cell consists of 46 chromosomes, where 23 chromosomes completely characterize various feature of our human body; another 23 chromosomes are an exact replica of the first 23 to form a diploid structure. In contrast to this diploid structure, the haploids consist of no replication and all the chromosomes required to characterize the specie is available singularly. The type of reproduction that happens between two organisms depends upon whether their genome (The total genetic structure) is diploid or haploid. In computation theory, a mapping similar to the genetic structure in biological species can be created and the resulting model is used to create a genetic algorithm. We first model a chromosome as a string of bits. Each bit in this string is a gene and the value that the bit has taken; either a 0 or a 1 is the allele of the gene. A set of such chromosomes forms a population. Such a model in which the chromosomes are modelled as a string of bits is called as binary genetic algorithms. In contrast we can model a chromosome as a string of real valued number and each real value in a definite position as its allele. A population can now consist of various such row vectors of real valued numbers, where each row vector is a chromosome. Depending upon the application any one of the two modes can be considered. It is this population upon which genetic algorithms are acted upon. SI. No. 1.

Biological Terminology Chromosome

2.

Gene

3.

Allele

4.

Population

5.

Fitness

Strings of DNA

Binary Genetic Algorithms String of Bits

Encodes a protein

Each bit in the string

The trait the protein conveys A collection of organisms of the same kind The ability of an organism to reproduce

The value the bit can take (0 or 1) A collection of chromosomes of the same kind

Floating Point (FP) Genetic Algorithms String of FP Numbers Each FP Number in the chromosome The real values that the FP Number can take A collection of chromosomes of the same kind

The evaluation of a logical function

The evaluation of a mathematical function

Meaning in Biology

10

Most Genetic Algorithms (GA) attempt to solve computational problems by making species which are characterized by their chromosomes (as defined by the binary or the floating point GA’s above) to reproduce in a manner that the Haploids reproduce. Haploids reproduce by parents exchanging their single strand chromosomes. Offspring so formed are subject to mutation or copying errors. Similar kinds of operation dictate the functioning of a genetic algorithm.

3.2.2. Search Space and GA Operators Search space involves finding a candidate solution among all the possible solutions possible. All definitions of search space involve a set of values that can act as a solution to a problem and a notion of distance defined between the actual solution and the different solutions in the search space. The candidate solution is that solution in the search space that has the minimum distance or that which has a distance which lies within a predefined limit. All possible set of chromosomes that can appropriately evaluate a fitness function to a nominal value is the search space for genetic algorithms. The fitness function is the objective function which defines a particular problem. The genetic algorithm should have the capability to solve the problem by evaluating the fitness function according to the problem. Optimization problems involve evaluating fitness function to its minimum value/maximum value/a value within a particular range etc… within some predefined constraints. Each iteration of the Genetic Algorithm should take us closer to the required solution. Every iteration of a genetic algorithm involves the following three Genetic Algorithm operators: 1. Selection: Selection is the principle in which elements of the population are selected for crossover (The next operator). 2. Crossover: Crossover is mathematical/logical operation that causes new element to be reproduced from existing elements in the population. The simplest crossover mechanism can be to exchange bits in a definite position. More complex crossover mechanisms exist in different genetic algorithms. 3. Mutation: Random flipping of a certain bits in the population is called mutation. Other methods of mutation are also suggested in different papers. Application of such Genetic Algorithms for the fitness functions provided by cognitive radio is the main motto of this research practice.

3.2.2.1 A Note on Crossover One of the most important GA operators is the crossover operator. Every genetic algorithm in principle searches for a candidate solution among a host of solutions that are possible. A search space is defined for this purpose and the genetic algorithm has to navigate through such a search space and provide the best solution. Crossover is that operator that can extensively navigate through a large search space. The crossover operator can be both exploratory and exploitative. For it to be exploitative, it uses the offspring generated as children from the parents before and moves ahead in a definite direction. However been exploitative is just not enough. It has to be exploratory too. The crossover operator has to be able to navigate from one region of the search space to another swiftly. This will ensure that probable good candidates may miss out from been considered as “fit parents” for further reproduction/crossover for obtaining better solutions. To cater to such challenging needs of this operator, different crossover mechanisms have been developed.[14]

11

a. One Point Crossover: A single crossover point on both parents' organism strings is selected. All data beyond that point in either organism string is swapped between the two parent organisms. The resulting organisms are the children.

Figure 2: One point Crossover

b. Two Point Crossover: Two-point crossover calls for two points to be selected on the parent organism strings. Everything between the two points is swapped between the parent organisms, rendering two child organisms

Figure 3 : Two Point Crossover

c. Cut and Splice: Another crossover variant, the "cut and splice" approach, results in a change in length of the children strings. The reason for this difference is that each parent string has a separate choice of crossover point.

Figure 4: Cut and Splice

While the above techniques are for two parent crossovers, methods similar to this are available for three parent crossover too. One of the methods for three parent crossover has been provided later in this text. It is a part of an implementation of a classic genetic algorithm.

12

4. Literature Survey The title of this research practice clearly indicates that two essential fields whose extensive study is required to address any problem in the chosen topic, viz. Cognitive Radio and Genetic Algorithms. Innumerable literature of varied length and structure exist on the topics, both individually and as a combination. Basics about cognitive radio are given in [1] and [2]. While the principle evolution and the way cognitive radio is an advancement of the idea of software defined radio is clearly explained in [1], a more elaborate discussion on cognitive radio as network architecture and the manner in which the protocol stack will have to be altered for cognitive radio communications is better explained in [2]. A general overview of cognition and the idea of adaptability is provided by an invited paper written by Dr. Simon Haykin, esteemed professor and researcher, McMaster University. [3]. A research report written in [4] explains in length, the need and the challenges in cognitive radios. Extensive MATLAB simulations on spectrum sensing and dynamic resource allocation are some broad contents of the report. [5], [6] and [7] are some references that specially focus on resource allocation in cognitive radio. They offer possible fitness functions that one can consider for single or multi-objective optimization problems. Though, due to constraints of time these fitness functions could not have been tried on the implementation done as a part of this research practice, the literature survey of the same has been conducted and they offer good scope for further research on the topic. [8] Offers a good introduction to genetic algorithms. Various sections of the introduction in this text are an adaptation of this text material. The reference further proceeds to explain the history, development and the reasoning behind genetic algorithms. The manner in which genetic algorithms has been adapted from Darwinian Theory of genetic evolution has been lucidly explained in the text. One of the example implementations in this text is borrowed from this reference. Reference [9], a text written by Mr Colin Reeves offers a strong mathematical framework for genetic algorithms. Reasoning and methodology of functioning of all popular techniques in genetic algorithms has been extensively covered in [10]. A challenging part in any genetic algorithm is that of constraint handling. [11], [12] and [13] offer extensive review over the same. A pseudo-code for constraint handling in optimization for genetic algorithms is given in [11]. A penalty based constrained handling approach without any penalty parameters is developed in [12]. A broad survey on the different constraint handling techniques is provided in [13]. The different methods of crossover is given in [14].

13

5. Work Done 5.1.

Study of Basics

Various basics pertaining cognitive Radio and Genetic Algorithms was extensively studied. The premise on which cognitive radio works was studied at length. Various fields and applications in which cognitive radio is applicable were looked upon. Genetic Algorithms as an implementable methodology was investigated. Various kinds of crossover mechanisms were considered. Various techniques for genetic algorithm operators were investigated upon. Introduction to the above topics were covered in Section 3.

5.2.

Hardware Implementation Methodology

The idea of simulating algorithms developed for cognitive radio based on various optimizations was considered. A NI USRP board was considered for hardware implementation. An NI USRP board is a device that can convert standard computers such as desktop and laptop to a wireless prototyping platform. It is an efficient and an easy to use hardware provided by National Instruments Company for effective prototyping of wireless access protocols. The hardware is LABView Compliant. LABView is copyright simulation software from National Instruments Company that allows prototyping various mathematical functionalities required for different processes, including communication – a field pertinent to the thesis in question. LABView is used for loading prototyping algorithms developed using it for loading it onto many LABView hardware. Investigating the possibility of such a hardware implementation was a part of my research practice course. My research practice included converting codes written for algorithms in MATLAB to be ported onto the NI USRP board using the compliant software - LABView. MATLAB is another simulation based software that allows textual coding in contrast to the graphical approach provided by LABView. MATLAB is a software developed by MathWorks.inc. It’s a company that provides efficient tool for code scripting of algorithms with less focus on implementation. Such a software essentially focuses on simulation and results than the implementation constraints. Converting a code written in MATLAB to LAbView for investigating the possibility of procuring NI USRP boards was a part of my research practice. The Mathscript node available in LABView will suffice for this purpose. LABView allows us to do the same M-Scripting that MATLAB allows. Certain functionalities that are available in MATLAB M-Script was not available in LABView. Genetic Algorithms get their name from the way they are modelled. They are modelled using the genetic structure of biological species.

14

Figure 5: The Mathscript node in LABView that allows porting of M-Script files generated by MATLAB

5.3.

Implementation of Genetic Algorithm

The main part of my research practice has been to use M-Scripting in MATLAB to effectively simulate a genetic algorithm. As explained is section 3.2.2. , all genetic algorithms involve three GA operators: 1. Selection 2. Crossover 3. Mutation As a first step, a fitness function that needs to be maximized or minimized (In the case of optimization problems only) is evaluated on a randomly generated population. Based on the evaluated fitness functions, a select few elements are considered for an operation known as “Crossover”. This principle of selecting elements based on a certain criteria is called as “Selection”. For example, if the objective of our GA is to minimize a fitness function, the GA takes a select few where each one of them are ordered in the increasing order of their fitness with the first element in the selected set been the fittest as it is the least value (Most minimum). The second operation is crossover. A Mathematical operation that can lead to betterment of the values of the fitness function is crossover. There exists, single point crossover, multipoint crossover and various other crossover techniques. The third operator is “Mutation”. Mutation is an inherent activity that happens during generation of offspring during reproduction of haploid type in organisms. These mutations generate better or worse species as compared to normal offspring. It happens stochastically and the randomness in the same also has a definite pattern. The inherent randomness in mutation allows it to enter better areas of the search space and hence 15

enable us to obtain better fitness functions for complex problems. Mutations of varied kind are suggested in literature. Both crossover and Mutation happens with a definite probability known as crossover probability and Mutation probability. Generally crossover probability will be greater than 70% and Mutation probability be less than 10%.

5.3.1. Implementation1 To get acclimatized with genetic algorithms a very simple implementation solving a trivial problem was considered. The implementation was done with the objective to understand the working of the three GA operators. The problem that was attempted is as follows: Implement a genetic algorithm that generates a random population of chromosomes of a definite bit width and increase the number of “ones” generated in the population till it reaches the maximum number of bits. a) Selection: The selection mechanism considered is Roulette wheel Sampling (RWS). This is a kind of fitness proportionate selection. RWS is based on the method in which a roulette wheel selects a number embossed on the circular disk after it is rotated. What we can imagine is that depending upon the value of the fitness, a sector of the circular disk proportionate to the value is provided.

b) Crossover: The crossover methodology considered is that any two of the elements selected using RWS will behave as parents. At a randomly chosen point of these two parents, the corresponding bits will be exchanged to form two new offspring. In the event generated to define the crossover probability, if the outcome is unsuitable, the two parents so selected will themselves become the offspring. c) Mutation: In the happening that the outcome for the event generated to define is favourable, a randomly selected bit in that element in the population will be flipped.

5.3.2. Implementation2 The second implementation so done involves a genetic algorithm for minimizing fitness functions. An algorithm called GA-MPC (Genetic Algorithm with Multi point crossover) [15] was considered. This algorithm solves complex problems of optimization with constraint handling. The implementation done so far can cater to all systems that can handle inequality constraints. The GA-MPC can handle equality constraints too but the same has not been implemented as a part of this research practice implementation. A more elaborate discussion on constraint handling is considered later. A randomly generated floating point numbers of length equal to the number of variables that the fitness function depends upon is considered. The algorithm acts upon this set of floating point numbers which is the initial population to generate an array of numbers which gives a minimum value to this fitness function. The mathematical model of the same is a shown below:

16

Figure 6: Mathematical Model of the optimization problem that GA-MPC can solve

.

a) Selection: The selection mechanism considered is Roulette wheel Sampling (RWS) method as done in implementation1. As part of selection GA-MPC also suggests generating an archive pool. Out of the total population, a section of the population comprising of the fittest of elements is stored in section known as archive pool. This archive pool is used for mutation that encompasses a technique known as diversity operator. b) Crossover: GA-MPC considers a multi-point crossover technique. Using the RWS method, for every crossover operation, three parents are considered and three offspring are generated. The crossover mechanism is as shown below:

Figure 7: The proposed crossover in GA-MPC. Here β is a random number generated by the Gaussian Function

c) Mutation: Mutation is done by an operator known as the diversity operator. This operator, defines a “Diversity Probability”, under whose satisfaction, a random element from the offspring generated is replaced by a random element in the archive pool.

Figure 8:The diversity operator in GA-MPC. Here, PS=Population Size, D=No. of elements in each population, rand is a random number generated from uniform distribution.

17

The whole algorithm is now illustrated in the figure below:

Figure 9 : The GA-MPC Algorithm

5.3.2.1 Constraint Handling in GA-MPC As Figure (3) shows, the fitness function

⃗ that needs to be minimized is subject to:

1. Inequality Constraints ⃗ 2. Equality Constraints ⃗ 3. Limits in value constraints Constraints 1 and 3 are handled in this implementation. There exists a similarity between the method in which constraints one and two are handled. Both of them are handled by adding a suitable penalty function. GA-MPC explains how to generate the population within constraint 3 but doesn’t explain how to maintain the same in successive iteration. The constraint handling in GA-MPC is done as shown in Fig. 7.

Where,

18

Figure 10: The penalty function for constraint handling

5.3.2.2

Challenges Faced in Implementation2:

a) Limit Violations: As Step1 in Fig 6. Indicates the initial population so generated satisfies the limits stated in an optimization problem. However the offspring generated after crossover may or may not violate the limits stated in the problem. Those elements from the offspring that can provide the best fitness functions are considered for the next iteration to navigate into better regions of the search space. If however these elements violate the condition imposed on the limits within which the values in the population can take, further iterations can worsen the situation and the population so considered may no longer be a part of the search space. To GAMPC states nothing about this problem and hence it doesn’tt provide a suitable solution. In view of this difficulty, I tried various possible solutions. The different solutions that I tried are as follows. i.

Solution1: “Out of all the offspring generated, purge all elements that violate the limits. “ . However, this solution did not work. The reason being that many elements who were providing good fitness values were been purged because of limit violations. For E.g. out of the total 10 elements considered in the population size, 30 offspring were generated… Out of these 30 elements only 3-4 elements (On an average) were within the limits imposed. This severely reduced the selection for the next iteration.

ii.

Solution2: “Attenuate all elements which are beyond the required limits to exactly the limit end points”. Let me illustrate the idea with an example. If an element in one of the offspring is 5.8 and the limit for the offspring is 5, then we attenuate the value to 5. If however the element has a value of 1.4, then the value will be scaled up to 3. This technique provides better results than solution1 but saturates very quickly… Hence successive iterations don’t cause large movements in the search space or they may not provide any movement at all, a case in which successive iterations provide the same element.

iii.

Solution3: “Scale values outside the limits to a value within the limits by an amount proportional to the extent by which it has violated the limits. Lesser Violations obtain values which are closer to the average of the two bounds while larger violations will obtain values closer to the extremities”. The above methodology can be best explained through a pseudo code written below: 19

For a population P= {p1, p2, p3, p4… pPS, }, having PS number of elements, where pi={ pi(1) , pi(2) , pi(3) ,…. pi(D) }, where D is each element of the chromosome of the population having conditioned to be within the limits , we generate an offspring O having elements, O={ o1, o2, o3, o4,… o3PS, }, where each element oi={ oi(1) , oi(2) , oi(3) ,…. oi(D) }, on which we operate the following pseudo-code: Lower Limit Violation: If (( k=0; While(( While(( k=k+1; End While End While End if

) )

Upper Limit Violation: If (( k=0; While(( While((

) )

k=k+1; End While End While End if

This solution provided the best results. Values were within the limits and a value which lies in the extremities in the fractional part of the offspring allowed it to go closer to the extremities in the new offspring and vice versa. b) Saturation of the constraint violations: The penalty function so added to the fitness function, should cater to the problem of constraint handling. However, after a few iterations, all elements generated as population from the offspring were found to have the same number of constraint violations and further iterations failed to reduce the same. The solution to this problem as I found was that one can purge about 30% of the total population generated and replace it with new elements for the population. One has to be careful that the new population so generated doesn’t violate the limit constraints. One can exploit the randomness in the generated population to alter the saturation. This alteration, further propagates as new offspring are generated in successive iterations thus finally leading us to a search space where all the population so generated satisfy the constraints that the problem poses. This fractional generation of new population should continue until the jinx is broken and the number of constraints begins to reduce further with successive iterations. This turned out to be a major disadvantage of the technique suggested afore, as the number of iterations taken to navigate to a search space that has no constraint violations became very large. What was 30-40 iterations that it took to stabilize to constant value, now took 70-90 iterations to just navigate to the appropriate search space. c)

Generation of population for successive iteration after offspring generation: Challenge (a) and (b) so mentioned before were a smaller part of the larger problem as posed by challenge(c). The fact that the GA-MPC algorithm doesn’t suggest a method by which one decides the best elements of the offspring to be selected as population for successive iterations is a cause for confusion. The flowchart for the method I have followed for generating the population from the offspring generated is as follows:

20

Figure 11: The flow chart to generate population for next iteration from offspring

21

5.4.

Results

As explained in section 5.3, there are two implementations as a part of my research practice.

5.4.1. Results for Implementation1 Following are the parameters considered for the 1st Implementation: a) b) c) d) e)

Crossover Probability=0.7 Mutation Probability=0.001 Population length : 8 bits Population Size-4 No. of iterations=50

A detailed explanation on what implementation1 is all about is provided in section 5.3.1. Output Obtained:

22 Figure 12: Final Result for Implemntation1

5.4.2. Result for Implementation2 As stated earlier, I have solved only for inequality constraints. Out of the 24 benchmark problems given in [], I have considered two of them. The parameters for the implementation are as follows: a) b) c) d)

Crossover Probability=1 Diversity Probability=0.001 Population Size=10 No. of iterations=150+No. of iterations it takes to navigate the population into the search space. (The value is random. It depends upon the quality of the initial population. Repeated simulations have shown it to vary between any value less than 10 to any value between 90 and 100 )

5.4.2.1. Problem statement1: The first problem statement is provided in the following figure: [16]

Figure 13: Problem Statement1 for Implementation2

As the above problem, indicates, the function ⃗ , is the fitness function and there exists nine constraints. Each element in the population will have to be an array of thirteen elements as the fitness function and constraints depends upon these thirteen variables. Five sample solutions are shown below:

23

Sample output 1 for problem statement1:

Figure 14: Initial Population for Sample output1 for Problem Statement1 of Implementation2

Figure 15 : Final Population for Sample output1 for Problem Statement1 of Implementation2

Figure 16: Parameters for Sample output1 for Problem Statement1 of Implementation2

24

Sample output 2 for problem statement1:

Figure 17: Initial Population for Sample output2 for Problem Statement1 of Implementation2

Figure 18: Final Population for Sample output2 for Problem Statement1 of Implementation2

Figure 19: Parameters for Sample output2 for Problem Statement1 of Implementation2

25

Sample output 3 for problem statement1:

Figure 20: Initial Population for Sample output3 for Problem Statement1 of Implementation2

Figure 21: Final Population for Sample output3 for Problem Statement1 of Implementation2

Figure 22: Parameters for Sample output3 for Problem Statement1 of Implementation2

26

Sample output 4 for problem statement1:

Figure 23: Initial Population for Sample output4 for Problem Statement1 of Implementation2

Figure 24: Final Population for Sample output4 for Problem Statement1 of Implementation2

Figure 25: Parameters for Sample output4 for Problem Statement1 of Implementation2

27

Sample output 5 for problem statement1:

Figure 26: Initial Population for Sample output5 for Problem Statement1 of Implementation2

Figure 27: Final Population for Sample output5 for Problem Statement1 of Implementation2

Figure 28: Parameters for Sample output5 for Problem Statement1 of Implementation2

28

5.4.2.2. Problem statement2: The second problem statement is provided in the following figure: [16]

Figure 29: Problem Statement2 for Implemenation2

Sample output 1 for problem statement2:

Figure 30: Initial Population for Sample output1 for Problem Statement2 of Implementation2

29

Figure 31 : Final Population for Sample output1 for Problem Statement2 of Implementation2

Figure 32 : Parameters for Sample output1 for Problem Statement2 of Implementation2

Sample output 2 for problem statement2:

Figure 33: Initial Population for Sample output2 for Problem Statement2 of Implementation2

30

Figure 34 : Final Population for Sample output2 for Problem Statement2 of Implementation2

Figure 35 : Parameters for Sample output2 for Problem Statement2 of Implementation2

Sample output 3 for problem statement2:

Figure 36: Initial Population for Sample output3 for Problem Statement2 of Implementation2

31

Figure 37 : Final Population for Sample output3 for Problem Statement2 of Implementation2

Figure 38 : Parameters for Sample output3 for Problem Statement2 of Implementation2

Sample output 4 for problem statement2:

Figure 39: Initial Population for Sample output4 for Problem Statement2 of Implementation2

32

Figure 40 : Final Population for Sample output4 for Problem Statement2 of Implementation2

Figure 41 :Parameters for Sample output4 for Problem Statement2 of Implementation2

Sample output 5 for problem statement2:

Figure 42 : Initial Population for Sample output5 for Problem Statement2 of Implementation2

33

Figure 43 : Final Population for Sample output5 for Problem Statement2 of Implementation2

Figure 44: Parameters for Sample output5 for Problem Statement2 of Implementation2

5.5.

Broad Conclusion

Implementation two been a more crucial implementation, some broad inferences regarding the same will be essential. Implementation two has been run for two problem statements as mentioned in sections 5.4.2.1 and 5.4.2.2 respectively. As problem statement 1 indicated the value of the fitness function should be -15. Under 1000 iterations of the same genetic implementation, with each iteration giving a different average fitness value, a plot of the kind shown in figure 45 appears. If the average error is computed with respect to all the 1000 iterations, we are obtaining value of 2.63. So an average, the fitness function is capable of stabilizing to a value of 12.37. If the saturation in successive values can be reduced by making the operator more diversified, we would probably be able to decrease the error. One can see that the value has touched -15 or gone very close to it a good number of times.

34

Figure 45: A plot of average fitness function for 1000 iterations for problem statement1.

When the same experiment was conducted for problem statement2, a plot of the kind shown in figure 46 appeared. An error of 5.01% occurred for this problem statement in contrast to 17% error for problem statement1. This can be due to the fact that there are very little constraint violations in implementation2.

Figure 46 : A plot of average fitness function for 1000 iterations for problem statement2.

35

6. Research Related Activities The various kinds of Research related Activities that I have undertaken as a part of my research practice are: i.

I have done a reasonably extensive literature survey on Cognitive Radio and Genetic Algorithms. As a part of future work that I would like to undertake, I have read quite a few papers on resource allocation on cognitive radio.

ii.

I have simulated a genetic algorithm by the name GA-MPC (Genetic Algorithm with multi parent crossover) within reasonable degree of accuracy. The general functioning of a genetic algorithm can be understood if one navigates through the code and sees the final output.

iii.

A general scan through section 5.3.; of my report shows that I have initially implemented a simple algorithm after whose successful completion, I have gone for a more complicated algorithm. This procedure that I have undertaken shows that I have followed the important methodology in any research, i.e. “Take small steps that can be conquered to reach the final goal”.

36

7. Development Related Activities The various development related activities that I have undertaken are: i.

I have investigated the use of Mathscript node available in LABView. If the NI USRP boards that are required for physical simulation are made available, the Mathscript node in which I have implemented certain elementary functionalities can be used to port M-scripts available in MATLAB directly onto LABView, which in turn is compliant with all National Instrument Boards.

ii.

If provided with an opportunity, I have equipped myself with sufficient knowledge to be able to provide a seminar or presentation on basics of Genetic Algorithms. Opportunities for generating sufficient text material to make it a part of any course work that caters to optimization theory also exist.

iii.

Section 5.3.2.2 of this report caters to the various challenges that exist in implementation of GAMPC algorithm. This text material can be a suitable aid for anyone interested in simulation of genetic algorithms for single optimization functions. Very little literature exist that explains the methodology for generating population for the next iteration from offspring generated. Various issues regarding constraint violations ate also discussed at length in the concerned section.

37

Research Proposal Name: Anant Bhushan N

ID No. : 2013H140053G

Place of Research Work and Organization: BITS Pilani – K K Birla Goa Campus, Goa, India Proposed Supervisor: Mr. Nitin Sharma, Lecturer, BITS Pilani – K K Birla Goa Campus Title: Comparison and Evaluation of optimization techniques for Cognitive Radio with special focus on genetic algorithms. Objective: The important objective of this research includes comparing the effectiveness of genetic algorithms with other optimization techniques for cognitive radio. Various methodologies for optimization exist in the broad field of genetic algorithms itself. An extensive evaluation of these techniques will be a part of my research. Identifying gaps in the literature with respect to optimization techniques available for cognitive radio and proposing new techniques and evaluating them will also be conducted in this research activity. Background: I have undertaken an extensive literature survey on genetic algorithms. I have successfully implemented a single objective genetic algorithm by the name GA-MPC. I have identified various optimization parameters that exist in cognitive radio. I have also done a brief study on the Perot Cycle which is a necessary optimization requirement for cognitive radio. Methodology: Simulation studies of various optimization techniques will be undertaken. As of now, all work that has been conducted is in single function optimization. A special focus on multi-function optimization will be considered. Various benchmark parameters that influence the efficiency of optimization will be set. The benchmark parameters that will be set will be based on efficiency with which cognitive radios can achieve flexibility, agility, learnability and adaptability. Expected Outcome: Extensive set of results from various simulations will be generated from this research activity. Gaps in literature will be identified and new techniques for optimization for cognitive radio will be suggested. A new algorithm for cognitive radio implementation can also be one of the possible outcomes of this research activity.

38

References [1] Elsevier Publishers, “Cognitive Radio Communications and Networks”, Alexander M Wyglinski, Maziar Nevokee, Y Thomas Hou [2] Springer Publishers, “Cognitive Radio, Software Defined Radio and Adaptive Wireless Systems”, Huyesein Arlan(Ed.) [3]Simon Haykin, “Cognitive Radio: Brain Empowered Wireless Communications”, IEEE Journal on Selected Areas in Communication, Vol. 23, No.2, pp201-220 [4] Marja Mattinmikko et al. “Cognitive Radio: An Intelligent Wireless Communication System”, CHESS Research Report, NO-VTT-R-02219-08, 14.3.2008 [5] Timothy R Newman, “Multi Objective fitness functions for cognitive radio adaptation”, Thesis Report, Univ. of Kansas, Kansas. [6]Mengyao Ge and Shaowei Wang, “Fast Optimal Resource Allocation is Possible for Multiuser OFDM-Based Cognitive Radio Networks with Heterogeneous Services”, IEEE Transactions on Wireless Communications, VOL. 11, No. 4, April 2012, pp1500-1509 [7]Hong Xu and Baochun Le ,“ Resource Allocation with Flexible Channel Cooperation in Cognitive Radio Networks”, IEEE Transactions on Mobile Computing, VOL. 12, No. 5, May 2013,pp957-970 [8] The MIT Press, Brandford Book, “An Introduction to Genetic Algorithms”, Melanie Mitchell. [9]Colin Reeves, “Chapter 3: Genetic Algorithms” School of mathematical and Information Sciences, Coventry University, Coventry, England [10] World Scientific Publishing Ltd. “Genetic Algorithms for Scientists and Engineers”, David A Coley [11] Carlos A Coello Coello et al. “Handling Constraints in Genetic Algorithms using Dominance-Based Tournaments”,

Depto. de Ingeniería Eléctrica. Mexico [12] Kalyanmoy Deb, “An efficient constraint handling method for genetic algorithms”, Computer Methods in applied Mechanics and Engineering, Elsevier, 2000,pp311-338 [13]Carlos A Coello Coello, “A Survey of Different Constraint Handling Techniques used with Evolutionary Algorithms” Laboratorio Nacional de Informatica Avanzada, Mexico [14]Wikipedia, Ret. From 28.4.2014, http://en.wikipedia.org/wiki/Crossover_%28genetic_algorithm%29 [15]Saber M Elsayed, Ruhul A Sarker, Daryl L Essam, “A New Genetic Algorithm for solving optimization problems”, Engineering Applications of Artificial Intelligence, Elsevier,2014, pp57-69 [16]JJ Lian et al. “Problem Defnitions and Evaluation Criteria for the CEC 2006 Special Session on Constrained RealParameter Optimization”, Technical Report, September 18, 2006

39

View more...
A RESEARCH PRACTICE ON INVESTIGATION OF EFFECTIVENESS OF GENETIC ALGORITHMS FOR RESOURCE ALLOCATION IN COGNITIVE RADIO BY ANANT BHUSHAN N 2013H140053G PREPARED FOR THE PARTIAL FULFILLMENT OF THE REQUIREMENTS OF BITS G540: RESEARCH PRACTICE COURSE UNDER GUIDANCE OF DR. M K DESHMUKH PROFESSOR DEPARTMENT OF EEE & I

Birla Institute of Technology and Science, Pilani K.K. Birla, Goa Campus 29rd April, 2014

1

2

Table of Contents List of Figures---------------------------------------------------------------------------------------------------------------------4 Acknowledgements-------------------------------------------------------------------------------------------------------------5 Abstract----------------------------------------------------------------------------------------------------------------------------6 3. Introduction-------------------------------------------------------------------------------------------------------------------7 3.1. Basics of Cognitive Radio---------------------------------------------------------------------------------------------7 3.1.1. Introduction To Cognitive Radio--------------------------------------------------------------------------------7 3.1.2. Software Defined Radio-------------------------------------------------------------------------------------------7 3.1.3. A More Elaborate Explanation on Cognitive Radio---------------------------------------------------------8 3.1.4. Requirements of Cognitive Radio-------------------------------------------------------------------------------9 3.2. Genetic Algorithms------------------------------------------------------------------------------------------------------9 3.2.1. Mapping Terminologies in Genetic Algorithms to Biology-----------------------------------------------10 3.2.2. Search Space and GA Operators---------------------------------------------------------------------------------11 3.2.2.1 A Note on Crossover----------------------------------------------------------------------------------------------11 4. Literature Survey-------------------------------------------------------------------------------------------------------------13 5. Work Done---------------------------------------------------------------------------------------------------------------------14 5.1. Study of Basics------------------------------------------------------------------------------------------------------------14 5.2. Hardware Implementation Methodology-------------------------------------------------------------------------14 5.3. Implementation of Genetic Algorithm-----------------------------------------------------------------------------15 5.3.1. Implementation1----------------------------------------------------------------------------------------------------16 5.3.2 Implementation2----------------------------------------------------------------------------------------------------16 5.3.2.1. Constraint Handling in GA-MPC-----------------------------------------------------------------------------18 5.3.2.2 Challenges faced in implementation2----------------------------------------------------------------------19 5.4. Results-----------------------------------------------------------------------------------------------------------------------22 5.4.1. Results for Implementation1---------------------------------------------------------------------------------------22 5.4.2. Results for Implementation2--------------------------------------------------------------------------------------23 5.4.2.1. Problem Statement 1--------------------------------------------------------------------------------------------23 5.4.2.2. Problem Statement 2--------------------------------------------------------------------------------------------29 5.5. Broad Conclusion---------------------------------------------------------------------------------------------------------34 6. Research Related Activities-----------------------------------------------------------------------------------------------36 7. Development Related Activities-----------------------------------------------------------------------------------------37 Research Proposal---------------------------------------------------------------------------------------------------------------38 References-------------------------------------------------------------------------------------------------------------------------39

3

List of Figures Figure 1: Block Diagram of communication System. .................................................................................................................... 7 Figure 2: One point Crossover .................................................................................................................................................... 12 Figure 3 : Two Point Crossover ................................................................................................................................................... 12 Figure 4: Cut and Splice .............................................................................................................................................................. 12 Figure 5: The Mathscript node in LABView that allows porting of M-Script files generated by MATLAB .................................. 15 Figure 6: Mathematical Model of the optimization problem that GA-MPC can solve ............................................................... 17 Figure 7: The proposed crossover in GA-MPC. Here β is a random number generated by the Gaussian Function ................... 17 Figure 8:The diversity operator in GA-MPC. Here, PS=Population Size, D=No. of elements in each population, rand is a random number generated from uniform distribution. ............................................................................................................. 17 Figure 9 : The GA-MPC Algorithm .............................................................................................................................................. 18 Figure 10: The penalty function for constraint handling ............................................................................................................ 19 Figure 11: The flow chart to generate population for next iteration from offspring ................................................................. 21 Figure 12: Final Result for Implemntation1 ................................................................................................................................ 22 Figure 13: Problem Statement1 for Implementation2 ............................................................................................................... 23 Figure 14: Initial Population for Sample output1 for Problem Statement1 of Implementation2 .............................................. 24 Figure 15 : Final Population for Sample output1 for Problem Statement1 of Implementation2 ............................................... 24 Figure 16: Parameters for Sample output1 for Problem Statement1 of Implementation2 ....................................................... 24 Figure 17: Initial Population for Sample output2 for Problem Statement1 of Implementation2 .............................................. 25 Figure 18: Final Population for Sample output2 for Problem Statement1 of Implementation2 ............................................... 25 Figure 19: Parameters for Sample output2 for Problem Statement1 of Implementation2 ....................................................... 25 Figure 20: Initial Population for Sample output3 for Problem Statement1 of Implementation2 .............................................. 26 Figure 21: Final Population for Sample output3 for Problem Statement1 of Implementation2 ............................................... 26 Figure 22: Parameters for Sample output3 for Problem Statement1 of Implementation2 ....................................................... 26 Figure 23: Initial Population for Sample output4 for Problem Statement1 of Implementation2 .............................................. 27 Figure 24: Final Population for Sample output4 for Problem Statement1 of Implementation2 ............................................... 27 Figure 25: Parameters for Sample output4 for Problem Statement1 of Implementation2 ....................................................... 27 Figure 26: Initial Population for Sample output5 for Problem Statement1 of Implementation2 .............................................. 28 Figure 27: Final Population for Sample output5 for Problem Statement1 of Implementation2 ............................................... 28 Figure 28: Parameters for Sample output5 for Problem Statement1 of Implementation2 ....................................................... 28 Figure 29: Problem Statement2 for Implemenation2 ................................................................................................................ 29 Figure 30: Initial Population for Sample output1 for Problem Statement2 of Implementation2 .............................................. 29 Figure 31 : Final Population for Sample output1 for Problem Statement2 of Implementation2 ............................................... 30 Figure 32 : Parameters for Sample output1 for Problem Statement2 of Implementation2 ...................................................... 30 Figure 33: Initial Population for Sample output2 for Problem Statement2 of Implementation2 .............................................. 30 Figure 34 : Final Population for Sample output2 for Problem Statement2 of Implementation2 ............................................... 31 Figure 35 : Parameters for Sample output2 for Problem Statement2 of Implementation2 ...................................................... 31 Figure 36: Initial Population for Sample output3 for Problem Statement2 of Implementation2 .............................................. 31 Figure 37 : Final Population for Sample output3 for Problem Statement2 of Implementation2 ............................................... 32 Figure 38 : Parameters for Sample output3 for Problem Statement2 of Implementation2 ...................................................... 32 Figure 39: Initial Population for Sample output4 for Problem Statement2 of Implementation2 .............................................. 32 Figure 40 : Final Population for Sample output4 for Problem Statement2 of Implementation2 ............................................... 33 Figure 41 :Parameters for Sample output4 for Problem Statement2 of Implementation2 ....................................................... 33 Figure 42 : Initial Population for Sample output5 for Problem Statement2 of Implementation2 ............................................. 33 Figure 43 : Final Population for Sample output5 for Problem Statement2 of Implementation2 ............................................... 34 Figure 44: Parameters for Sample output5 for Problem Statement2 of Implementation2 ....................................................... 34 Figure 45: A plot of average fitness function for 1000 iterations for problem statement1. ...................................................... 35 Figure 46 : A plot of average fitness function for 1000 iterations for problem statement2. ..................................................... 35

4

1. ACKNOWLEDGEMENTS I sincerely thank Dr. M K Deshmukh for the continued support and the able guidance he has provided throughout my research practice course. I render my deep felt gratitude to Mr. Nitin N Sharma for providing me with invaluable inputs, suggestions and an amicable platform to successfully complete my research practice course. I thank the entire faculty of the EEE&I department of BITS Pilani – K K Birla Goa Campus for the immense support they have provided during the course of this research practice. I render my deepest sense of gratitude to all the scientists, engineers, industrialists and mathematicians who have directly or indirectly contributed to the fields of both, cognitive radio and genetic algorithms for the remarkable contribution you have done in your respective fields. Without your successful accomplishments, I would not have had this wonderful field to work upon.

5

2. Abstract Genetic algorithms are used for optimizing functions pertaining to various complex problems in different fields. My research practice aims at directing these algorithms to answer the question as to whether these algorithms will be able to successfully contribute to optimizing fitness functions that arise from constraints imposed by cognitive radio communication. An algorithm known as GA-MPC, which is a fitness function optimization technique is implemented on MATLAB. For getting acclimatized with genetic algorithms, another basic fitness function has been considered, whose value has been attempted to be maximized. Both implementations have provided outputs with reasonable degree of success. An error of 17% and an error of 5% exist for both the implementation. The implementation has been tried upon two fitness functions which are considered to be benchmark problems. The GA-MPC algorithm addresses issues corresponding to both, inequality and equality constraints. The implementation so done can address inequality constraints only. The implementation is done using the M-Script file in MATLAB. The ultimate goal of this implementation is to be able to direct these algorithms to work for fitness functions that arise from Cognitive Radio. Keywords: Cognitive Radio, Genetic Algorithms, GA-MPC, Inequality Constraints.

6

3. Introduction 3.1. Basics of Cognitive Radio 3.1.1. Introduction to Cognitive Radio Underutilization of radio spectrum in traditional wireless communications systems along with the increasing spectrum demand from emerging wireless applications is driving the development of new spectrum allocation policies for wireless communications. These new spectrum allocation policies, which will allow unlicensed users (i.e., secondary users) to access the radio spectrum when it is not occupied by licensed users (i.e., primary users), will be exploited by the cognitive radio (CR) technology. [1] Cognitive radio will improve spectrum utilization in wireless communications systems while accommodating the increasing amount of services and applications in wireless networks. A cognitive radio transceiver is able to adapt to the dynamic radio environment and the network parameters to maximize the utilization of the limited radio resources while providing flexibility in wireless access. The key features of a CR transceiver include awareness of the radio environment (in terms of spectrum usage, power spectral density of transmitted/received signals, wireless protocol signalling) and intelligence. This intelligence is achieved through learning for adaptive tuning of system parameters such as transmit power, carrier frequency, and modulation strategy (at the physical layer), and higher-layer protocol parameters.

3.1.2. Software Defined Radio The basic premise on which cognitive radio works is based on SDR’s or Software defined Radio. The practical implementation of cognitive radios require that one needs hardware that has adaptive capabilities like the FPGA and the software defined Radio provides such a platform. A conventional communication system appears as follows:

Figure 1: Block Diagram of communication System.

Here is a short explanation on the functionalities of the different blocks available:

7

The antenna section, which receives (or transmits) information encoded in radio waves. The RF front-end section, which is responsible for transmitting/receiving radio frequency signals from the antenna and converting them to an intermediate frequency (IF). The ADC/DAC section, which performs analog-to-digital/digital-to-analog conversion. The digital up-conversion (DUC) and digital down-conversion (DDC) blocks, which essentially perform modulations of the signal on the transmitting path and demodulation of the signal on the receiving path. The baseband section, which performs operations such as connection setup, equalization, frequency hopping, coding/decoding, and correlation, while also implementing the link layer protocol.

In a generic radio, each one of the above modules was implemented using dedicated hardware. Such devices were one of the first few to come to the market as communication devices. As time elapsed and technology grew, the programmable digital radio came into the fore. Such devices use ASIC’s for the digital up conversion and down conversion and the baseband operations are done using software. Software-defined radio refers to technologies wherein these functionalities are performed by software modules running on field programmable gate arrays (FPGAs), digital signal processors (DSP), general-purpose processors (GPP), or a combination thereof. SDR’s enable programmability of both DDC/DUC and baseband processing blocks. Hence, operation characteristics of the radio, such as coding, modulation type, and frequency band, can be changed at will, simply by loading new software. Also multiple radio devices using different modulations can be replaced by a single radio device that can perform the same task.

3.1.3. A More Elaborate Explanation on Cognitive Radio As a principle cognitive radio is an extension of the idea of Software Defined Radio. Software defined Radio enables changing the network communication parameters by providing appropriate controls through software. However, Cognitive radio automates this principle and the communication device can alter its communication parameters depending upon the status of the channel. This invokes various challenges. First of all, the communication device should be able to sense the channel and estimate the various parameters within which the communication is already happening. If the primary users are already communicating, the secondary user within which the cognitive radio algorithm is running will have two choices depending upon the strategy that the algorithm provides. One of the choices, is that the secondary users abstain from communicating till the primary users communicate. Or the second choice is that the secondary users communicate within acceptable limits of interference to the primary users. It means that the secondary users communicate in manner that the communication of the primary users happens undeterred simultaneously on the same channel. Mitola was among the few who suggested such a technology as an evolution of the Software Defined Radio. He envisioned a technology with which the “Cognition” of a device regarding its communicating environment will enable it to utilize the spectrum allotted to it in a more effective manner. According to Mitola’s early vision, a CR would be realized through the integration of model-based reasoning with software radio and would be trainable in a broad sense, instead of just programmable. Mitola also outlined a cognitive cycle through which such radio can reconfigure itself through an on-going process of awareness (both of itself and the outside world), perception, reasoning, and decision making. Today, however, CR has become an all-encompassing term for a wide variety of technologies that enable radios to achieve various levels of self-configuration, and with an emphasis on different functionalities, ranging from ubiquitous wireless access, to automated radio resource optimization, to dynamic spectrum access for a future device-centric interference management, to the vision of an ideal CR. 8

Haykin, for example, defines CR as a radio capable of being aware of its surroundings, learning, and adaptively changing its operating parameters in real time with the objective of providing reliable anytime, anywhere, and spectrally efficient communication.[1] The U.S. Federal Communications Commission (FCC) uses a narrower definition for this concept: “A Cognitive Radio (CR) is a radio that can change its transmitter parameters based on interaction with the environment in which it operates. The majority of cognitive radios will probably be SDR (Software Defined Radio) but neither having software nor being field programmable is requirements of a cognitive radio.”[2]

3.1.4. Requirements of Cognitive Radio In a broad sense, a cognitive radio can be termed to have the following functionalities:

Reconfigurability: The ability of a device to alter the functionality it is implementing on the fly.

Intelligent Adaptive Behaviour: The ability to alter the parameters of communication without been a priori programmed to do so.

More particularly, any device that intends to behave as a cognitive radio should have the following functionalities or features:

Flexibility and agility: It is the ability to change the waveform and other radio operational parameters on the fly. In contrast, there is a very limited extent that the current multichannel multiradio (MC-MR) can do this. Full flexibility becomes possible when CRs are built on top of SDRs. Another important requirement to achieve flexibility is reconfigurable or wideband antenna technology. (A point which is less discussed)

Sensing: It is the ability to observe and measure the state of the environment, including spectral occupancy. Sensing is necessary if the device is to change its operation based on its new situation, not only based on precoded algorithms but also as a result of a learning mechanism.

Learning and adaptability: The ability to analyse sensory input, to recognize patterns, and modify internal operational behaviour based on the analysis of a new situation, not only based on precoded algorithms but also as a result of a learning mechanism. In contrast, the IEEE 802.11 MAC layer allows a device to adapt its transmission activity to channel availability that it senses. But this is achieved by using a predefined listen-before-talk and exponential back-off algorithm instead of a cognitive cycle.

The cognitive radio so introduced here is what I would like to work on. Such a cognitive radio poses various optimization constraint problems to which an amicable solution needs to be determined. This functionality can be done through either operations research techniques or the Genetic Algorithm technique. The genetic algorithm technique is known to be more generic and can cater to a wider class of problems than the operations research technique. Hence the first part of my research practice was to understand the behaviour or Genetic Algorithms whose introduction is followed suit.

3.2. Basics of Genetic Algorithms Genetic Algorithms belong to a wider class of algorithms known as Evolutionary Algorithms. Machine Learning and Neural Networks are the other two that cater to the same category. These evolutionary algorithms are used for solving various computational and real world problems such as Optimization, Artificial Intelligence, Stockmarket prediction, Bioinformatics, Encryption and Decryption of ciphers etc… Genetic Algorithms are popular for solving optimization problems for which I will be using them in Cognitive Radio.

9

Genetic Algorithms get their name from the way they are modelled. They are modelled using the genetic structure of biological species.

3.2.1. Mapping of terminologies in Genetic Algorithms to Biology All biological species consist of cells. These cells are in turn composed of chromosomes. Chromosomes can be modelled as entities that consist of “Characteristic features” of an organism known as gene. They are strings of a protein known as DNA. (Deoxyribonucleic acid). The structure and the attribute of the gene characterize the organism. The gene is a particular setup of proteins that has the ability to completely characterize a creature. The characterizations that it can provide are such as the colour of our skin, the colour of our eye, our thumbprint, the structure and proportion of our body etc… The different setup of the genes to encode a character is known as an allele, and the chromosome can now be considered to be consisting of a sequence of genes in the form of DNA that constitute unique alleles corresponding to that individual which exist as a combination inside a cell-the tiniest living component of a living organism. Advanced species such as mammals and reptiles consist of a class of chromosomes known as diploids. The chromosomes of more primitive species belong to a class known as haploids. Diploids consist of a pair of chromosomes, where each chromosome is indicating one property. For example, a human cell consists of 46 chromosomes, where 23 chromosomes completely characterize various feature of our human body; another 23 chromosomes are an exact replica of the first 23 to form a diploid structure. In contrast to this diploid structure, the haploids consist of no replication and all the chromosomes required to characterize the specie is available singularly. The type of reproduction that happens between two organisms depends upon whether their genome (The total genetic structure) is diploid or haploid. In computation theory, a mapping similar to the genetic structure in biological species can be created and the resulting model is used to create a genetic algorithm. We first model a chromosome as a string of bits. Each bit in this string is a gene and the value that the bit has taken; either a 0 or a 1 is the allele of the gene. A set of such chromosomes forms a population. Such a model in which the chromosomes are modelled as a string of bits is called as binary genetic algorithms. In contrast we can model a chromosome as a string of real valued number and each real value in a definite position as its allele. A population can now consist of various such row vectors of real valued numbers, where each row vector is a chromosome. Depending upon the application any one of the two modes can be considered. It is this population upon which genetic algorithms are acted upon. SI. No. 1.

Biological Terminology Chromosome

2.

Gene

3.

Allele

4.

Population

5.

Fitness

Strings of DNA

Binary Genetic Algorithms String of Bits

Encodes a protein

Each bit in the string

The trait the protein conveys A collection of organisms of the same kind The ability of an organism to reproduce

The value the bit can take (0 or 1) A collection of chromosomes of the same kind

Floating Point (FP) Genetic Algorithms String of FP Numbers Each FP Number in the chromosome The real values that the FP Number can take A collection of chromosomes of the same kind

The evaluation of a logical function

The evaluation of a mathematical function

Meaning in Biology

10

Most Genetic Algorithms (GA) attempt to solve computational problems by making species which are characterized by their chromosomes (as defined by the binary or the floating point GA’s above) to reproduce in a manner that the Haploids reproduce. Haploids reproduce by parents exchanging their single strand chromosomes. Offspring so formed are subject to mutation or copying errors. Similar kinds of operation dictate the functioning of a genetic algorithm.

3.2.2. Search Space and GA Operators Search space involves finding a candidate solution among all the possible solutions possible. All definitions of search space involve a set of values that can act as a solution to a problem and a notion of distance defined between the actual solution and the different solutions in the search space. The candidate solution is that solution in the search space that has the minimum distance or that which has a distance which lies within a predefined limit. All possible set of chromosomes that can appropriately evaluate a fitness function to a nominal value is the search space for genetic algorithms. The fitness function is the objective function which defines a particular problem. The genetic algorithm should have the capability to solve the problem by evaluating the fitness function according to the problem. Optimization problems involve evaluating fitness function to its minimum value/maximum value/a value within a particular range etc… within some predefined constraints. Each iteration of the Genetic Algorithm should take us closer to the required solution. Every iteration of a genetic algorithm involves the following three Genetic Algorithm operators: 1. Selection: Selection is the principle in which elements of the population are selected for crossover (The next operator). 2. Crossover: Crossover is mathematical/logical operation that causes new element to be reproduced from existing elements in the population. The simplest crossover mechanism can be to exchange bits in a definite position. More complex crossover mechanisms exist in different genetic algorithms. 3. Mutation: Random flipping of a certain bits in the population is called mutation. Other methods of mutation are also suggested in different papers. Application of such Genetic Algorithms for the fitness functions provided by cognitive radio is the main motto of this research practice.

3.2.2.1 A Note on Crossover One of the most important GA operators is the crossover operator. Every genetic algorithm in principle searches for a candidate solution among a host of solutions that are possible. A search space is defined for this purpose and the genetic algorithm has to navigate through such a search space and provide the best solution. Crossover is that operator that can extensively navigate through a large search space. The crossover operator can be both exploratory and exploitative. For it to be exploitative, it uses the offspring generated as children from the parents before and moves ahead in a definite direction. However been exploitative is just not enough. It has to be exploratory too. The crossover operator has to be able to navigate from one region of the search space to another swiftly. This will ensure that probable good candidates may miss out from been considered as “fit parents” for further reproduction/crossover for obtaining better solutions. To cater to such challenging needs of this operator, different crossover mechanisms have been developed.[14]

11

a. One Point Crossover: A single crossover point on both parents' organism strings is selected. All data beyond that point in either organism string is swapped between the two parent organisms. The resulting organisms are the children.

Figure 2: One point Crossover

b. Two Point Crossover: Two-point crossover calls for two points to be selected on the parent organism strings. Everything between the two points is swapped between the parent organisms, rendering two child organisms

Figure 3 : Two Point Crossover

c. Cut and Splice: Another crossover variant, the "cut and splice" approach, results in a change in length of the children strings. The reason for this difference is that each parent string has a separate choice of crossover point.

Figure 4: Cut and Splice

While the above techniques are for two parent crossovers, methods similar to this are available for three parent crossover too. One of the methods for three parent crossover has been provided later in this text. It is a part of an implementation of a classic genetic algorithm.

12

4. Literature Survey The title of this research practice clearly indicates that two essential fields whose extensive study is required to address any problem in the chosen topic, viz. Cognitive Radio and Genetic Algorithms. Innumerable literature of varied length and structure exist on the topics, both individually and as a combination. Basics about cognitive radio are given in [1] and [2]. While the principle evolution and the way cognitive radio is an advancement of the idea of software defined radio is clearly explained in [1], a more elaborate discussion on cognitive radio as network architecture and the manner in which the protocol stack will have to be altered for cognitive radio communications is better explained in [2]. A general overview of cognition and the idea of adaptability is provided by an invited paper written by Dr. Simon Haykin, esteemed professor and researcher, McMaster University. [3]. A research report written in [4] explains in length, the need and the challenges in cognitive radios. Extensive MATLAB simulations on spectrum sensing and dynamic resource allocation are some broad contents of the report. [5], [6] and [7] are some references that specially focus on resource allocation in cognitive radio. They offer possible fitness functions that one can consider for single or multi-objective optimization problems. Though, due to constraints of time these fitness functions could not have been tried on the implementation done as a part of this research practice, the literature survey of the same has been conducted and they offer good scope for further research on the topic. [8] Offers a good introduction to genetic algorithms. Various sections of the introduction in this text are an adaptation of this text material. The reference further proceeds to explain the history, development and the reasoning behind genetic algorithms. The manner in which genetic algorithms has been adapted from Darwinian Theory of genetic evolution has been lucidly explained in the text. One of the example implementations in this text is borrowed from this reference. Reference [9], a text written by Mr Colin Reeves offers a strong mathematical framework for genetic algorithms. Reasoning and methodology of functioning of all popular techniques in genetic algorithms has been extensively covered in [10]. A challenging part in any genetic algorithm is that of constraint handling. [11], [12] and [13] offer extensive review over the same. A pseudo-code for constraint handling in optimization for genetic algorithms is given in [11]. A penalty based constrained handling approach without any penalty parameters is developed in [12]. A broad survey on the different constraint handling techniques is provided in [13]. The different methods of crossover is given in [14].

13

5. Work Done 5.1.

Study of Basics

Various basics pertaining cognitive Radio and Genetic Algorithms was extensively studied. The premise on which cognitive radio works was studied at length. Various fields and applications in which cognitive radio is applicable were looked upon. Genetic Algorithms as an implementable methodology was investigated. Various kinds of crossover mechanisms were considered. Various techniques for genetic algorithm operators were investigated upon. Introduction to the above topics were covered in Section 3.

5.2.

Hardware Implementation Methodology

The idea of simulating algorithms developed for cognitive radio based on various optimizations was considered. A NI USRP board was considered for hardware implementation. An NI USRP board is a device that can convert standard computers such as desktop and laptop to a wireless prototyping platform. It is an efficient and an easy to use hardware provided by National Instruments Company for effective prototyping of wireless access protocols. The hardware is LABView Compliant. LABView is copyright simulation software from National Instruments Company that allows prototyping various mathematical functionalities required for different processes, including communication – a field pertinent to the thesis in question. LABView is used for loading prototyping algorithms developed using it for loading it onto many LABView hardware. Investigating the possibility of such a hardware implementation was a part of my research practice course. My research practice included converting codes written for algorithms in MATLAB to be ported onto the NI USRP board using the compliant software - LABView. MATLAB is another simulation based software that allows textual coding in contrast to the graphical approach provided by LABView. MATLAB is a software developed by MathWorks.inc. It’s a company that provides efficient tool for code scripting of algorithms with less focus on implementation. Such a software essentially focuses on simulation and results than the implementation constraints. Converting a code written in MATLAB to LAbView for investigating the possibility of procuring NI USRP boards was a part of my research practice. The Mathscript node available in LABView will suffice for this purpose. LABView allows us to do the same M-Scripting that MATLAB allows. Certain functionalities that are available in MATLAB M-Script was not available in LABView. Genetic Algorithms get their name from the way they are modelled. They are modelled using the genetic structure of biological species.

14

Figure 5: The Mathscript node in LABView that allows porting of M-Script files generated by MATLAB

5.3.

Implementation of Genetic Algorithm

The main part of my research practice has been to use M-Scripting in MATLAB to effectively simulate a genetic algorithm. As explained is section 3.2.2. , all genetic algorithms involve three GA operators: 1. Selection 2. Crossover 3. Mutation As a first step, a fitness function that needs to be maximized or minimized (In the case of optimization problems only) is evaluated on a randomly generated population. Based on the evaluated fitness functions, a select few elements are considered for an operation known as “Crossover”. This principle of selecting elements based on a certain criteria is called as “Selection”. For example, if the objective of our GA is to minimize a fitness function, the GA takes a select few where each one of them are ordered in the increasing order of their fitness with the first element in the selected set been the fittest as it is the least value (Most minimum). The second operation is crossover. A Mathematical operation that can lead to betterment of the values of the fitness function is crossover. There exists, single point crossover, multipoint crossover and various other crossover techniques. The third operator is “Mutation”. Mutation is an inherent activity that happens during generation of offspring during reproduction of haploid type in organisms. These mutations generate better or worse species as compared to normal offspring. It happens stochastically and the randomness in the same also has a definite pattern. The inherent randomness in mutation allows it to enter better areas of the search space and hence 15

enable us to obtain better fitness functions for complex problems. Mutations of varied kind are suggested in literature. Both crossover and Mutation happens with a definite probability known as crossover probability and Mutation probability. Generally crossover probability will be greater than 70% and Mutation probability be less than 10%.

5.3.1. Implementation1 To get acclimatized with genetic algorithms a very simple implementation solving a trivial problem was considered. The implementation was done with the objective to understand the working of the three GA operators. The problem that was attempted is as follows: Implement a genetic algorithm that generates a random population of chromosomes of a definite bit width and increase the number of “ones” generated in the population till it reaches the maximum number of bits. a) Selection: The selection mechanism considered is Roulette wheel Sampling (RWS). This is a kind of fitness proportionate selection. RWS is based on the method in which a roulette wheel selects a number embossed on the circular disk after it is rotated. What we can imagine is that depending upon the value of the fitness, a sector of the circular disk proportionate to the value is provided.

b) Crossover: The crossover methodology considered is that any two of the elements selected using RWS will behave as parents. At a randomly chosen point of these two parents, the corresponding bits will be exchanged to form two new offspring. In the event generated to define the crossover probability, if the outcome is unsuitable, the two parents so selected will themselves become the offspring. c) Mutation: In the happening that the outcome for the event generated to define is favourable, a randomly selected bit in that element in the population will be flipped.

5.3.2. Implementation2 The second implementation so done involves a genetic algorithm for minimizing fitness functions. An algorithm called GA-MPC (Genetic Algorithm with Multi point crossover) [15] was considered. This algorithm solves complex problems of optimization with constraint handling. The implementation done so far can cater to all systems that can handle inequality constraints. The GA-MPC can handle equality constraints too but the same has not been implemented as a part of this research practice implementation. A more elaborate discussion on constraint handling is considered later. A randomly generated floating point numbers of length equal to the number of variables that the fitness function depends upon is considered. The algorithm acts upon this set of floating point numbers which is the initial population to generate an array of numbers which gives a minimum value to this fitness function. The mathematical model of the same is a shown below:

16

Figure 6: Mathematical Model of the optimization problem that GA-MPC can solve

.

a) Selection: The selection mechanism considered is Roulette wheel Sampling (RWS) method as done in implementation1. As part of selection GA-MPC also suggests generating an archive pool. Out of the total population, a section of the population comprising of the fittest of elements is stored in section known as archive pool. This archive pool is used for mutation that encompasses a technique known as diversity operator. b) Crossover: GA-MPC considers a multi-point crossover technique. Using the RWS method, for every crossover operation, three parents are considered and three offspring are generated. The crossover mechanism is as shown below:

Figure 7: The proposed crossover in GA-MPC. Here β is a random number generated by the Gaussian Function

c) Mutation: Mutation is done by an operator known as the diversity operator. This operator, defines a “Diversity Probability”, under whose satisfaction, a random element from the offspring generated is replaced by a random element in the archive pool.

Figure 8:The diversity operator in GA-MPC. Here, PS=Population Size, D=No. of elements in each population, rand is a random number generated from uniform distribution.

17

The whole algorithm is now illustrated in the figure below:

Figure 9 : The GA-MPC Algorithm

5.3.2.1 Constraint Handling in GA-MPC As Figure (3) shows, the fitness function

⃗ that needs to be minimized is subject to:

1. Inequality Constraints ⃗ 2. Equality Constraints ⃗ 3. Limits in value constraints Constraints 1 and 3 are handled in this implementation. There exists a similarity between the method in which constraints one and two are handled. Both of them are handled by adding a suitable penalty function. GA-MPC explains how to generate the population within constraint 3 but doesn’t explain how to maintain the same in successive iteration. The constraint handling in GA-MPC is done as shown in Fig. 7.

Where,

18

Figure 10: The penalty function for constraint handling

5.3.2.2

Challenges Faced in Implementation2:

a) Limit Violations: As Step1 in Fig 6. Indicates the initial population so generated satisfies the limits stated in an optimization problem. However the offspring generated after crossover may or may not violate the limits stated in the problem. Those elements from the offspring that can provide the best fitness functions are considered for the next iteration to navigate into better regions of the search space. If however these elements violate the condition imposed on the limits within which the values in the population can take, further iterations can worsen the situation and the population so considered may no longer be a part of the search space. To GAMPC states nothing about this problem and hence it doesn’tt provide a suitable solution. In view of this difficulty, I tried various possible solutions. The different solutions that I tried are as follows. i.

Solution1: “Out of all the offspring generated, purge all elements that violate the limits. “ . However, this solution did not work. The reason being that many elements who were providing good fitness values were been purged because of limit violations. For E.g. out of the total 10 elements considered in the population size, 30 offspring were generated… Out of these 30 elements only 3-4 elements (On an average) were within the limits imposed. This severely reduced the selection for the next iteration.

ii.

Solution2: “Attenuate all elements which are beyond the required limits to exactly the limit end points”. Let me illustrate the idea with an example. If an element in one of the offspring is 5.8 and the limit for the offspring is 5, then we attenuate the value to 5. If however the element has a value of 1.4, then the value will be scaled up to 3. This technique provides better results than solution1 but saturates very quickly… Hence successive iterations don’t cause large movements in the search space or they may not provide any movement at all, a case in which successive iterations provide the same element.

iii.

Solution3: “Scale values outside the limits to a value within the limits by an amount proportional to the extent by which it has violated the limits. Lesser Violations obtain values which are closer to the average of the two bounds while larger violations will obtain values closer to the extremities”. The above methodology can be best explained through a pseudo code written below: 19

For a population P= {p1, p2, p3, p4… pPS, }, having PS number of elements, where pi={ pi(1) , pi(2) , pi(3) ,…. pi(D) }, where D is each element of the chromosome of the population having conditioned to be within the limits , we generate an offspring O having elements, O={ o1, o2, o3, o4,… o3PS, }, where each element oi={ oi(1) , oi(2) , oi(3) ,…. oi(D) }, on which we operate the following pseudo-code: Lower Limit Violation: If (( k=0; While(( While(( k=k+1; End While End While End if

) )

Upper Limit Violation: If (( k=0; While(( While((

) )

k=k+1; End While End While End if

This solution provided the best results. Values were within the limits and a value which lies in the extremities in the fractional part of the offspring allowed it to go closer to the extremities in the new offspring and vice versa. b) Saturation of the constraint violations: The penalty function so added to the fitness function, should cater to the problem of constraint handling. However, after a few iterations, all elements generated as population from the offspring were found to have the same number of constraint violations and further iterations failed to reduce the same. The solution to this problem as I found was that one can purge about 30% of the total population generated and replace it with new elements for the population. One has to be careful that the new population so generated doesn’t violate the limit constraints. One can exploit the randomness in the generated population to alter the saturation. This alteration, further propagates as new offspring are generated in successive iterations thus finally leading us to a search space where all the population so generated satisfy the constraints that the problem poses. This fractional generation of new population should continue until the jinx is broken and the number of constraints begins to reduce further with successive iterations. This turned out to be a major disadvantage of the technique suggested afore, as the number of iterations taken to navigate to a search space that has no constraint violations became very large. What was 30-40 iterations that it took to stabilize to constant value, now took 70-90 iterations to just navigate to the appropriate search space. c)

Generation of population for successive iteration after offspring generation: Challenge (a) and (b) so mentioned before were a smaller part of the larger problem as posed by challenge(c). The fact that the GA-MPC algorithm doesn’t suggest a method by which one decides the best elements of the offspring to be selected as population for successive iterations is a cause for confusion. The flowchart for the method I have followed for generating the population from the offspring generated is as follows:

20

Figure 11: The flow chart to generate population for next iteration from offspring

21

5.4.

Results

As explained in section 5.3, there are two implementations as a part of my research practice.

5.4.1. Results for Implementation1 Following are the parameters considered for the 1st Implementation: a) b) c) d) e)

Crossover Probability=0.7 Mutation Probability=0.001 Population length : 8 bits Population Size-4 No. of iterations=50

A detailed explanation on what implementation1 is all about is provided in section 5.3.1. Output Obtained:

22 Figure 12: Final Result for Implemntation1

5.4.2. Result for Implementation2 As stated earlier, I have solved only for inequality constraints. Out of the 24 benchmark problems given in [], I have considered two of them. The parameters for the implementation are as follows: a) b) c) d)

Crossover Probability=1 Diversity Probability=0.001 Population Size=10 No. of iterations=150+No. of iterations it takes to navigate the population into the search space. (The value is random. It depends upon the quality of the initial population. Repeated simulations have shown it to vary between any value less than 10 to any value between 90 and 100 )

5.4.2.1. Problem statement1: The first problem statement is provided in the following figure: [16]

Figure 13: Problem Statement1 for Implementation2

As the above problem, indicates, the function ⃗ , is the fitness function and there exists nine constraints. Each element in the population will have to be an array of thirteen elements as the fitness function and constraints depends upon these thirteen variables. Five sample solutions are shown below:

23

Sample output 1 for problem statement1:

Figure 14: Initial Population for Sample output1 for Problem Statement1 of Implementation2

Figure 15 : Final Population for Sample output1 for Problem Statement1 of Implementation2

Figure 16: Parameters for Sample output1 for Problem Statement1 of Implementation2

24

Sample output 2 for problem statement1:

Figure 17: Initial Population for Sample output2 for Problem Statement1 of Implementation2

Figure 18: Final Population for Sample output2 for Problem Statement1 of Implementation2

Figure 19: Parameters for Sample output2 for Problem Statement1 of Implementation2

25

Sample output 3 for problem statement1:

Figure 20: Initial Population for Sample output3 for Problem Statement1 of Implementation2

Figure 21: Final Population for Sample output3 for Problem Statement1 of Implementation2

Figure 22: Parameters for Sample output3 for Problem Statement1 of Implementation2

26

Sample output 4 for problem statement1:

Figure 23: Initial Population for Sample output4 for Problem Statement1 of Implementation2

Figure 24: Final Population for Sample output4 for Problem Statement1 of Implementation2

Figure 25: Parameters for Sample output4 for Problem Statement1 of Implementation2

27

Sample output 5 for problem statement1:

Figure 26: Initial Population for Sample output5 for Problem Statement1 of Implementation2

Figure 27: Final Population for Sample output5 for Problem Statement1 of Implementation2

Figure 28: Parameters for Sample output5 for Problem Statement1 of Implementation2

28

5.4.2.2. Problem statement2: The second problem statement is provided in the following figure: [16]

Figure 29: Problem Statement2 for Implemenation2

Sample output 1 for problem statement2:

Figure 30: Initial Population for Sample output1 for Problem Statement2 of Implementation2

29

Figure 31 : Final Population for Sample output1 for Problem Statement2 of Implementation2

Figure 32 : Parameters for Sample output1 for Problem Statement2 of Implementation2

Sample output 2 for problem statement2:

Figure 33: Initial Population for Sample output2 for Problem Statement2 of Implementation2

30

Figure 34 : Final Population for Sample output2 for Problem Statement2 of Implementation2

Figure 35 : Parameters for Sample output2 for Problem Statement2 of Implementation2

Sample output 3 for problem statement2:

Figure 36: Initial Population for Sample output3 for Problem Statement2 of Implementation2

31

Figure 37 : Final Population for Sample output3 for Problem Statement2 of Implementation2

Figure 38 : Parameters for Sample output3 for Problem Statement2 of Implementation2

Sample output 4 for problem statement2:

Figure 39: Initial Population for Sample output4 for Problem Statement2 of Implementation2

32

Figure 40 : Final Population for Sample output4 for Problem Statement2 of Implementation2

Figure 41 :Parameters for Sample output4 for Problem Statement2 of Implementation2

Sample output 5 for problem statement2:

Figure 42 : Initial Population for Sample output5 for Problem Statement2 of Implementation2

33

Figure 43 : Final Population for Sample output5 for Problem Statement2 of Implementation2

Figure 44: Parameters for Sample output5 for Problem Statement2 of Implementation2

5.5.

Broad Conclusion

Implementation two been a more crucial implementation, some broad inferences regarding the same will be essential. Implementation two has been run for two problem statements as mentioned in sections 5.4.2.1 and 5.4.2.2 respectively. As problem statement 1 indicated the value of the fitness function should be -15. Under 1000 iterations of the same genetic implementation, with each iteration giving a different average fitness value, a plot of the kind shown in figure 45 appears. If the average error is computed with respect to all the 1000 iterations, we are obtaining value of 2.63. So an average, the fitness function is capable of stabilizing to a value of 12.37. If the saturation in successive values can be reduced by making the operator more diversified, we would probably be able to decrease the error. One can see that the value has touched -15 or gone very close to it a good number of times.

34

Figure 45: A plot of average fitness function for 1000 iterations for problem statement1.

When the same experiment was conducted for problem statement2, a plot of the kind shown in figure 46 appeared. An error of 5.01% occurred for this problem statement in contrast to 17% error for problem statement1. This can be due to the fact that there are very little constraint violations in implementation2.

Figure 46 : A plot of average fitness function for 1000 iterations for problem statement2.

35

6. Research Related Activities The various kinds of Research related Activities that I have undertaken as a part of my research practice are: i.

I have done a reasonably extensive literature survey on Cognitive Radio and Genetic Algorithms. As a part of future work that I would like to undertake, I have read quite a few papers on resource allocation on cognitive radio.

ii.

I have simulated a genetic algorithm by the name GA-MPC (Genetic Algorithm with multi parent crossover) within reasonable degree of accuracy. The general functioning of a genetic algorithm can be understood if one navigates through the code and sees the final output.

iii.

A general scan through section 5.3.; of my report shows that I have initially implemented a simple algorithm after whose successful completion, I have gone for a more complicated algorithm. This procedure that I have undertaken shows that I have followed the important methodology in any research, i.e. “Take small steps that can be conquered to reach the final goal”.

36

7. Development Related Activities The various development related activities that I have undertaken are: i.

I have investigated the use of Mathscript node available in LABView. If the NI USRP boards that are required for physical simulation are made available, the Mathscript node in which I have implemented certain elementary functionalities can be used to port M-scripts available in MATLAB directly onto LABView, which in turn is compliant with all National Instrument Boards.

ii.

If provided with an opportunity, I have equipped myself with sufficient knowledge to be able to provide a seminar or presentation on basics of Genetic Algorithms. Opportunities for generating sufficient text material to make it a part of any course work that caters to optimization theory also exist.

iii.

Section 5.3.2.2 of this report caters to the various challenges that exist in implementation of GAMPC algorithm. This text material can be a suitable aid for anyone interested in simulation of genetic algorithms for single optimization functions. Very little literature exist that explains the methodology for generating population for the next iteration from offspring generated. Various issues regarding constraint violations ate also discussed at length in the concerned section.

37

Research Proposal Name: Anant Bhushan N

ID No. : 2013H140053G

Place of Research Work and Organization: BITS Pilani – K K Birla Goa Campus, Goa, India Proposed Supervisor: Mr. Nitin Sharma, Lecturer, BITS Pilani – K K Birla Goa Campus Title: Comparison and Evaluation of optimization techniques for Cognitive Radio with special focus on genetic algorithms. Objective: The important objective of this research includes comparing the effectiveness of genetic algorithms with other optimization techniques for cognitive radio. Various methodologies for optimization exist in the broad field of genetic algorithms itself. An extensive evaluation of these techniques will be a part of my research. Identifying gaps in the literature with respect to optimization techniques available for cognitive radio and proposing new techniques and evaluating them will also be conducted in this research activity. Background: I have undertaken an extensive literature survey on genetic algorithms. I have successfully implemented a single objective genetic algorithm by the name GA-MPC. I have identified various optimization parameters that exist in cognitive radio. I have also done a brief study on the Perot Cycle which is a necessary optimization requirement for cognitive radio. Methodology: Simulation studies of various optimization techniques will be undertaken. As of now, all work that has been conducted is in single function optimization. A special focus on multi-function optimization will be considered. Various benchmark parameters that influence the efficiency of optimization will be set. The benchmark parameters that will be set will be based on efficiency with which cognitive radios can achieve flexibility, agility, learnability and adaptability. Expected Outcome: Extensive set of results from various simulations will be generated from this research activity. Gaps in literature will be identified and new techniques for optimization for cognitive radio will be suggested. A new algorithm for cognitive radio implementation can also be one of the possible outcomes of this research activity.

38

References [1] Elsevier Publishers, “Cognitive Radio Communications and Networks”, Alexander M Wyglinski, Maziar Nevokee, Y Thomas Hou [2] Springer Publishers, “Cognitive Radio, Software Defined Radio and Adaptive Wireless Systems”, Huyesein Arlan(Ed.) [3]Simon Haykin, “Cognitive Radio: Brain Empowered Wireless Communications”, IEEE Journal on Selected Areas in Communication, Vol. 23, No.2, pp201-220 [4] Marja Mattinmikko et al. “Cognitive Radio: An Intelligent Wireless Communication System”, CHESS Research Report, NO-VTT-R-02219-08, 14.3.2008 [5] Timothy R Newman, “Multi Objective fitness functions for cognitive radio adaptation”, Thesis Report, Univ. of Kansas, Kansas. [6]Mengyao Ge and Shaowei Wang, “Fast Optimal Resource Allocation is Possible for Multiuser OFDM-Based Cognitive Radio Networks with Heterogeneous Services”, IEEE Transactions on Wireless Communications, VOL. 11, No. 4, April 2012, pp1500-1509 [7]Hong Xu and Baochun Le ,“ Resource Allocation with Flexible Channel Cooperation in Cognitive Radio Networks”, IEEE Transactions on Mobile Computing, VOL. 12, No. 5, May 2013,pp957-970 [8] The MIT Press, Brandford Book, “An Introduction to Genetic Algorithms”, Melanie Mitchell. [9]Colin Reeves, “Chapter 3: Genetic Algorithms” School of mathematical and Information Sciences, Coventry University, Coventry, England [10] World Scientific Publishing Ltd. “Genetic Algorithms for Scientists and Engineers”, David A Coley [11] Carlos A Coello Coello et al. “Handling Constraints in Genetic Algorithms using Dominance-Based Tournaments”,

Depto. de Ingeniería Eléctrica. Mexico [12] Kalyanmoy Deb, “An efficient constraint handling method for genetic algorithms”, Computer Methods in applied Mechanics and Engineering, Elsevier, 2000,pp311-338 [13]Carlos A Coello Coello, “A Survey of Different Constraint Handling Techniques used with Evolutionary Algorithms” Laboratorio Nacional de Informatica Avanzada, Mexico [14]Wikipedia, Ret. From 28.4.2014, http://en.wikipedia.org/wiki/Crossover_%28genetic_algorithm%29 [15]Saber M Elsayed, Ruhul A Sarker, Daryl L Essam, “A New Genetic Algorithm for solving optimization problems”, Engineering Applications of Artificial Intelligence, Elsevier,2014, pp57-69 [16]JJ Lian et al. “Problem Defnitions and Evaluation Criteria for the CEC 2006 Special Session on Constrained RealParameter Optimization”, Technical Report, September 18, 2006

39

Thank you for interesting in our services. We are a non-profit group that run this website to share documents. We need your help to maintenance this website.