# Double-Scale Adaptive Transmission in Time-Varying Channel for Underwater Acoustic Sensor Networks
## 5 Energy-Efficient Transmission Algorithm
### Modulation Coding Method Selection  
Problem (23) is an integer programming problem. This kind of problem can be solved by heuristic algorithms, such as particle swarm optimization and genetic algorithm. In this paper, an improved genetic algorithm is designed to solve the problem as shown in Algorithm 2. To accelerate the speed of obtaining the optimal solution, a rearrangement process is used.  
Firstly, \(G\) chromosomes are generated as the initial population. Modulation and coding modes are encoded as genes, and each chromosome is in the following form,\[MC=[mc_{1},mc_{2},\dots,mc_{L}], \tag{28}\]  
where \(mc_{i}\) is a modulation and coding mode for epoch \(i\). In order to ensure the diversity of the population, the combinations of various transmission modes are used as the initial population, while the required amount of delivered data are met.  
A rearrangement process is utilized on each chromosome to adjust the positions of genes according to the predicted large-scale channel states. The lower modulation coding methods are allocated to worse channel states, and higher modulation coding methods are adopted for better channel states, as shown in Figure 7. The rearrangement process accelerates the convergence speed of the algorithm.  
Then, the estimated energy cost and the expected amount of delivered data will be calculated. The packet error rate (PER) can be determined based on the received SNR by using an information-theoretic approach [47] or an empirical formula estimated by real data [1]. So, according to the scheduled modulation coding methods, the predicted large-scale channel states, and target PER, the transmission power can be set. Thus, energy cost and amount of delivered data can be estimated.  
For each chromosome, fitness is defined as  
\[fitness=\begin{cases}\frac{\hat{R}_{e}}{\hat{E}_{e}},&\hat{R}_{e}\geq A_{s},\\ 0,&\hat{R}_{e}<A_{s}.\end{cases} \tag{29}\]  
\(\hat{E}_{e}\) and \(\hat{R}_{e}\) are the estimated energy cost and the expected amount of delivered data for the scheduling time, respectively. Large fitness means that the chromosome has high energy efficiency, and the required amount of transmission data is satisfied.  
Figure 7: Rearrangement process for a transmission modes chromosome.  
\(K\) chromosomes with large fitness scores are preserved. \((G-K)/2\) pairs of chromosomes are selected with a probability according to fitness. Each pair of the selected chromosomes are crossed and mutated to produce two new chromosomes as offspring. For a pair of chromosomes, the standard crossover operation recombines them by interchanging portions of them, producing divergent solutions to explore the search space. The mutation operation is performed on a chromosome by changing an element at a random position of the chromosome. After crossover and mutation, the rearrangement process is utilized on each new chromosome.  
\(K\) preserved chromosomes and \(G-K\) new chromosomes form the next generation of the population. As the algorithm continues and the new population evolves, the fitness scores of chromosomes improve. Finally, after several rounds of selection, crossover, and mutation, a good solution is obtained.  
Before each transmission, given the scheduled modulation and coding mode for this large-scale epoch, the predicted channel state of the next slot, and target PER, the transmission power can be determined.  
```
Input: predicted large-scale channel state, buffer state, data arrival rate Output: modulation and coding modes
1 Generate initial population
2 Rearrange chromosomes
3 forcrosstime = 1:MaxCrossTimedo
4 Calculate fitness
5 Choose chromosomes with good fitness
6 Crossover and mutation
7 Rearrange new chromosomes
8 endfor
9 Choose the chromosome with the best fitness
```  
**Algorithm 2**Modulation and coding mode scheduling