# Coordination in Emergency Response System Design:
## 6 Genetic Algorithm  
In this section, a genetic algorithm will be developed to solve the proposed model for large scale problem instances. Below, we describe the algorithm. 1. Setting the Size of the Population: There are two populations. One population consists of the location of ambulance stations. Let \(NP^{AS}\) be the number of ambulance station location populations (ASLP), which means that the number of chromosomes of the ASLP is \(NP^{AS}\). The other population consists of the location of fire stations (FSLP). Let \(NP^{FS}\) be the number of fire station location populations. The number of chromosomes of the FSLP is \(NP^{FS}\). The total number of population chromosomes is \(NP^{AS}\) plus \(NP^{FS}\)  
Figure 4: The response times of ambulance stations (_RTAS_) and fire stations (_RTFS_) for the 13 nodes in the example. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \multicolumn{4}{c}{**Location**} \\ \cline{2-5}
**[NA,NF]** & \multicolumn{1}{c}{**Ambulance Station, \(o_{i}\)**} & \multicolumn{1}{c}{**Fire Station, \(p_{j}\)**} & \multicolumn{1}{c}{**Poor \(\rightarrow\) Pref**} & \multicolumn{1}{c}{**Adeq \(\rightarrow\) Pref**} \\ \hline
[1,1] & \(i=11\) & \(j=4\) & — & — \\
[1,2] & \(i=11\) & \(j=4\), 11 & — & [4,11] \\
[2,1] & \(i=4\), 11 & \(j=4\) & [6,15] & [4,11] \\
[2,2] & \(i=7\), 11 & \(j=4\), 9 & [5,6,7,8,9,10] & — \\
[2,3] & \(i=9\), 11 & \(j=4\), 9, 11 & [5,6,7,8,9,10] & [4,11] \\
[3,2] & \(i=4\), 9, 11 & \(j=4\), 9 & [5,6,7,8,9,10,15] & [4,11] \\
[3,3] & \(i=9\), 11, 13 & \(j=4\), 7, 13 & [5,6,7,8,9,10,15,16] & [4,11] \\
[4,3] & \(i=9\), 11, 14 & \(j=4\), 9, 15 & [5,6,7,8,9,10,15,16] & [4,11] \\
[3,4] & \(i=9\), 11, 14 & \(j=4\), 9, 13 & [5,6,7,8,9,10,15,16] & [4,11] \\
[4,4] & \(i=9\), 11, 14 & \(j=4\), 9, 13 & [5,6,7,8,9,10,15,16] & [4,11] \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Optimal solution to the illustrative example. 2. Coding Scheme of Chromosome: A chromosome consists of genes. Each chromosome of the ASLP has two gene parts. One part is the location of the existing ambulance stations, and the other part is the location of new ambulance stations. The length of the ASLP chromosome is the number of ambulance stations. Every gene of the ASLP chromosome gives the exact location of the ambulance station. The chromosome of the FSLP has the same setting. For instance, as shown in Table 4, when NA = 3 and NF = 3, the coding scheme of the chromosome is as follows:  ASLP Chromosome Example: 11 I 9 13 FSLP Chromosome Example: 4 I 7 13 The genes left of the vertical line, called Forbidding Crossing Genes, are the location of the existing facilities, and the genes right of the vertical line, called Crossing Genes, are the location of the new facilities. Forbidding Crossing Genes means that the genes cannot be crossed. Crossing Genes means that the genes can be crossed. 3. Fitness Function: The fitness function is for selecting the outstanding chromosome in the ASLP and FSLP. We consider the number of nodes in the preferred area plus those in the adequate area minus the total number of facilities as the fitness function. It is important to note that there could be more than one ambulance-fire station pair that can be used for moving node k from the poor (or, adequate) zone to the preferred zone. To this end, we consider three user preference options: minimum _RTAS_, minimum _RTFS_, and minimum WT.