# Navigation of Autonomous Tug via Evolutionary Algorithms with Radar Plot Fitness Evaluation
## 2 Determining a Local Passage Route Using Evolutionary Algorithms  
Evolutionary algorithms imitate the natural process of adaptation of a population of creatures to changing environmental conditions. As in the case of natural evolution, in its artificial equivalent, evolutionary pressure and the associated selection of the best adapted individuals play a key role. The individual is the basis for the operation of the evolutionary algorithm, and in the case of a genetic algorithm, which is a very frequently used type of evolutionary algorithm, the basis for the actions is the genome of a given individual. Unlike the genomes of living organisms, the genomes of individuals in evolutionary algorithms contain only the information necessary to solve a given problem. The most commonly used type of genome is a genome with binary coding, consisting of chromosomes containing genes that take the value 0 or 1. In order to be able to use a genetic algorithm to solve the problem of navigating a ship, the first step is to appropriately encode the variables describing the given problem on the chromosomes. Each variable used in the algorithm must be mapped to the appropriate number of bits, or genes. For example, if one wants to encode the course of a ship as one of 8192 possible values, we need 13 bits. Variables such as speed and turn point coordinates can also be represented as binary strings, where each gene corresponds to one bit of the variable, maintaining the appropriate resolution required by the size of the data. After the variables have been properly encoded, the genetic algorithm can begin the optimization process. A classic genetic algorithm consists of several basic steps: population initialization, fitness evaluation (objective function), selection, crossover, and mutation. The process begins with generating an initial population of individuals, where each individual has a random chromosome. The initial population usually consists of several dozen to several hundred individuals, and each genome represents one potential solution to the problem. In order to be able to compare different solutions, the algorithm must determine how well a given individual copes with the navigation task. For this purpose, a fitness function is used, which evaluates how well the genome of a given individual fulfills the assumptions of the problem. After assessing the fitness of individuals, the algorithm performs a selection, choosing those individuals that will participate in the reproduction process. One of the most commonly used selection mechanisms is roulette wheel selection. In this method, the probability of selecting a given individual is proportional to the value of its fitness--the better the solution, the greater the chance of its selection. Each individual corresponds to a segment of the roulette wheel, with the segment's size proportional to the individual's fitness value. In this way, individuals with higher fitness value have a greater chance of participating in subsequent genetic operations. The selected individuals are subjected to a crossover process, the purpose of which is to exchange genes between them, which gives new solutions. In the simplest variant of crossover (single-point crossover), the chromosomes of two parents are cut at a randomly selected point, and then fragments of chromosomes before and after the cut are exchanged, giving two new offspring individuals. The crossover operation is the first of the key features of a genetic algorithm, combining the features of different individuals, which in turn allows for the exploration of new solutions. To ensure diversity in the population and avoid the solution getting stuck in a local optimum, the genetic algorithm uses the second key operation--mutation, which is a random change in the values of some genes in the chromosome. For example, if one of the genes in the chromosome has a value of 0, the mutation can change it to 1.