## 3 Materials and Methods
An image of an individual population represented by a network top-level label and simulating the operation of the configuration (\(T\), \(T\), \(RS\), \(RS\)) in the initial state (1, 1, 1, 0) is shown in Figure 2. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Configurations** & **Triggers** & **Initial State** & **Substitution** \\ \hline Configuration 1 & (\(T\), \(T\), \(RS\), \(RS\)) & (1, 1, 1, 0) & \(F_{1}=\left(\begin{array}{ccc}1&2&3&4\\ 2&1&4&3\end{array}\right)\) \\ \hline Configuration 2 & (\(RS\), \(T\), \(T\), \(D\)) & (0, 0, 0, 0) & \(F_{2}=\left(\begin{array}{ccc}1&2&3&4\\ 3&2&4&1\end{array}\right)\) \\ \hline Configuration 3 & (\(RS\), \(D\), \(RS\), \(RS\)) & (1, 0, 0, 1) & \(F_{3}=\left(\begin{array}{ccc}1&2&3&4\\ 1&2&4&3\end{array}\right)\) \\ \hline Configuration 4 & (\(RS\), \(D\), \(D\), \(D\)) & (0, 1, 0, 0) & \(F_{4}=\left(\begin{array}{ccc}1&2&3&4\\ 2&4&3&1\end{array}\right)\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Example of an initial population. Figure 2: Configuration 1 based on Petri net. Step 2. Choose the two best configurations. The input vector (0, 1, 1, 0) is fed to the input of each configuration and the distance (the sum of the modules of the coordinate differences) between the resulting output vector and the required output vector is calculated (1, 0, 1, 0). The smaller the distance, the better the configuration (see Table 2). The best configurations are 1, 2 and 4. Configurations 1 and 4 are randomly selected. Step 3. Crossing configurations. A split point is randomly selected--in the middle of the individual (see Table 3). As a result of crossing, Configurations 5 and 6 are obtained. The substitutions do not change (\(F_{1}=F_{5}\), \(F_{4}=F_{6}\)) (see Table 4). Step 4. Mutation of the descendant configuration. Configuration 6 is randomly selected. The last \(RS\) trigger is randomly selected and randomly changed to the \(D\) trigger. The result is Configuration 7 (see Table 5). Step 5. Reduction of configurations. The input vector (0, 1, 1, 0) is fed to the input of the descendant configurations and the distance (the sum of the modules of the coordinate differences) between the resulting output vector and the required output vector is calculated (1, 0, 1, 0) (see Table 6). \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Descendants** & **Triggers** & **State** & **Substitution** \\ \hline Configuration 5 & \((T,T,|D,D)\) & \((1,1,|0,0)\) & \(F_{5}=\left(\begin{array}{cccc}1&2&3&4\\ 2&1&4&3\end{array}\right)\) \\ \hline Configuration 6 & \((RS,D,|RS,RS)\) & \((0,1,|1,0)\) & \(F_{6}=\left(\begin{array}{cccc}1&2&3&4\\ 2&4&3&1\end{array}\right)\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Crossing result. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Configuration** & **Output Vector** & **Distance** \\ \hline Configuration 1 & \((1,0,0,1)\) & 2 \\ Configuration 2 & \((1,0,0,1)\) & 2 \\ Configuration 3 & \((0,1,0,1)\) & 4 \\ Configuration 4 & \((1,0,0,1)\) & 2 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The value of the fitness function of individuals of the initial population. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Configuration** & **Triggers** & **Initial state** & **Substitution** \\ \hline Configuration 7 & \((RS,D,RS,D)\) & \((0,1,1,0)\) & \(F_{7}=\left(\begin{array}{cccc}1&2&3&4\\ 2&4&3&1\end{array}\right)\) \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Mutation of the descendant configuration. Configuration 7 is the required configuration. Thus, the work of the model of the genetic algorithm based on nested Petri nets is performed. To simulate the operation of an artificial neural network, it is also advisable to use the mathematical apparatus of the theory of Petri nets. At the same time, it is necessary to provide for the possibility of training the network. Therefore, as a means of storing information about the weight of synapses, it is necessary to use labels that can be changed during network training without compromising the structure of the artificial neural network.