# Dynamic Path Planning for Unmanned Surface Vehicles with a Modified Neuronal Genetic Algorithm
## 4 Method
### Proposed Methodology  
In this research, we combine basic neural network algorithm methods and genetic algorithms. The neural network is the basis for generating USV motion parameter values, acceleration, and turning angle. The input for the network is the value obtained from the number of \(n\) sensors. The sensor used in this research platform is a ray cast. This sensor's real-world implementation is the same as that of a ray sensor that detects distance values (radar or lidar). Figure 4 shows the configuration of the sensor embedded in the agent. The three-sensor configuration has direction angles of \(45^{\circ}\), \(0^{\circ}\), and \(-45^{\circ}\). The five-sensor configuration has direction angles of \(45^{\circ}\), \(22.5^{\circ}\), \(0^{\circ}\), \(-22.5^{\circ}\), and \(-45^{\circ}\). The seven-sensor configuration has direction angles of \(67.5^{\circ}\), \(45^{\circ}\), \(22.5^{\circ}\), \(0^{\circ}\), \(-22.5^{\circ}\), \(-45^{\circ}\), and \(-67.5^{\circ}\). The angle \(0^{\circ}\) is in the same direction as the USV's rectilinear motion direction. A neural network consists of three main layers, including the input layer, hidden layer (single or multiple), and output layer [1]. The inputs from the sensor embedded in USVs are fed to the network with n neurons and m number of layers. During the learning process, the network is optimized based on the parameter of weights and biases. The initial values for weight and bias are randomly generated. In this configuration, the activation function for acceleration is sigmoid, while the steering angle uses the TanH function. The output values range from 0 to 1 for acceleration and from \(-1\) to 1 for the steering angle. Figure 5 provides a visual representation of the neural network utilized in this study. In each individual process, the neural network generates a weight value represented as \(w\) and a bias value represented as \(b\). The agent, such as an unmanned surface vehicle (USV), associated with a particular neural network model constitutes an individual genome within the population of the genetic input algorithm. In a broader view, the genetic algorithm process is illustrated in Figure 6 [27]. Figure 4: Ray cast sensor configuration on the USV (agent) implemented in a 3D simulation environment: (**a**) three sensors, (**b**) five sensors, and (**c**) seven sensors. Figure 5: Fundamental framework for neural network with \(n\) input (from the distance-based ray cast sensor) and two outputs (acceleration, \(\alpha\) [0,1], and the steering angle, \(\theta\) [\(-\)1,1]). 1. Generate Initial Population  
As shown in Figure 6, the genetic algorithm begins with the process of generating an initial population. In this context, \"population\" refers to neural networks characterized by random weight and bias parameters. Each genome, representing either an agent or a USV, is depicted using its dedicated neural network model. Each model will be expected as our solution for the path planning task. In our experiment, we continued to create the initial population until we reached the maximum number of genomes within a single generation, which was set at 40 agents. Once this maximum value was reached for a generation, we either reset the process to the current genome or assigned the first genome from the existing population to the new generation's USV. The main novelty in this research is related to the fitness function modification. To assess the performance of the pathfinding model generated by the network, we employed a fitness function. A higher fitness value for a generated path or solution indicates a more accurate representation of the path, while a lower fitness value suggests the opposite [30]. The fitness function is related to the variables of speed, distance, and sensors.