Research Article
The Mobile Water Quality Monitoring System Based on Low-Power Wide Area Network and Unmanned Surface Vehicle
Algorithm 1
Pseudocode for the method proposed.
| Genetic algorithm with improved crossover operator | | Input: | | Output: Achieve the chromosome with the best fitness value | | 1: Initialize the population | | 2: | | 3: whiledo | | 4: fordo | | 5: Calculate fitness F(t) | | 6: end for | | 7: fordo | | 8: Selection operations | | 9: end for | | 10: fordo | | 11: Get parent chromosomes p1, p2 | | 12: Select the crossover point and cut the parent chromosome into three segments | | 13: Select the first segment of p1 and the last segment of p2 insert into offspring 1 | | 14: Select the first segment of p2 and the last segment of p1 insert into offspring 2 | | 15: Calculate the local adaptation of the intermediate segments of p1 and p2 | | 16: Select the intermediate segment with high fitness as the intermediate segment of the offspring | | 17: Remove duplicate nodes | | 18: Insert missing nodes in the first or last segment according to the fitness value | | 19: Obtain offspring 1 and 2 | | 20: end for | | 21: fordo | | 22: Mutation operation | | 23: end for | | 24: fordo | | 25: F(t+1) = F(t) | | 26: end for | | 27: t = t +1 | | 28: end while |
|