## 2 Methodology
### Performance Evaluation Metrics  
The detection rate is a crucial metric for assessing the accuracy of target and obstacle detection in both SNNs and STDPs. It measures the percentage of accurately detected targets and obstacles out of the total number entered [36]. Similarly, the false positive rate is an important metric that calculates the percentage of incorrectly detected targets and obstacles relative to the total number of non-targets and non-obstacles in the input [37]. When evaluating the ability of SNNs and STDPs to detect targets and obstacles accurately, the false-positive rate is a key consideration. Algorithm 1 illustrates the initial algorithm for the simulation of an SNN controlling a mobile robot in an RL task. This algorithm outlines the structure of the simulation, allowing the SNN to learn how to control the mobile robot through trial and error. The SNN improves its performance over time by adjusting its synaptic weights based on spike timing, Within this algorithm, the line \"For j in fired_neurons\" plays a crucial role. It signifies a loop that iterates over a set of neurons that have exhibited firing activity during a specific iteration or time step. By utilizing the loop variable \"j\", each fired neuron within the set can be accessed and processed individually. The specific operations performed within the loop, such as updating firing thresholds or adjusting synaptic weights, depend on the algorithm's unique requirements and objectives (as mentioned in Step 1: Time Frame, as explained in Figure 4). ``` Steps  Code
1: Determine fired neurons. 2: Determine motor torques. 3: Update robot location. 4: Update target and obstacle position in the robot view. 5: Give currents to sensory neurons based on robot location. 6: Update STDP (Spike-Timing-Dependent Plasticity) based on fired neurons. 7:if Target Error < specific threshold then
8: Set dopamine to 1. 9:if Obstacle Distance < specific threshold then
10: Set dopamine to \(-\)1. 11:for j in fired neurons do
12: Update synaptic weights derivation based on LTP (Long-Term Potentiation) and LTD (Long-Term Depression) rules. 13: Update membrane potentials based on currents. 14: Update synaptic weights based on values of synaptic weights derivation and dopamine. 15: Decrease STDP, dopamine, and synaptic weights derivation exponentially. ## 3 Results and Discussion

The performance of our proposed SNN-based approach has been extensively evaluated to determine its effectiveness. This section provides unique details about our experiments and engages in in-depth discussions regarding the results obtained. ### Parameters in SNN Learning Algorithm

The SNN learning algorithm relies on adjustable parameters that significantly impact the behavior and performance of the SNN during the learning process. These parameters include the learning rate, number of neurons in each layer, initial network weights, activation function, synapse type, and STDP learning rule parameters. Modifying these parameters can improve the SNN's learning capabilities for specific tasks or enhance its overall performance. Table 2 presents a comprehensive list of these parameters and their corresponding values. Among the parameters, the number of sensory neurons (100) and motor neurons (200) are particularly crucial as they form the basic building blocks of the SNN model and determine its complexity. The maximal synaptic weight (4) and the recovery variable's time scale (0.02) are also essential in defining the network's connection strength and the time it takes for a neuron to recover after firing. Table 2 also includes essential learning parameters such as initial synaptic weights (1), reward constants (1), and punishment constants (\(-\)1). These parameters influence the rewards and punishments given to the network during learning and the time steps for various adjustments. They play a critical role in determining the network's learning rate and ability to adapt to the environment.