{'fraction_non_alphanumeric': 0.0376192786673136, 'fraction_numerical': 0.014103186155587902, 'mean_word_length': 4.779771919985044, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Application of reinforcement learning for effective vaccination strategies of coronavirus disease 2019 (COVID-19)

Since December 2019, the new coronavirus has raged in China and subsequently all over the world. From the first days, researchers have tried to discover vaccines to combat the epidemic. Several vaccines are now available as a result of the contributions of those researchers. As a matter of fact, the available vaccines should be used in effective and efficient manners to put the pandemic to an end. Hence, a major problem now is how to efficiently distribute these available vaccines among various components of the population. Using mathematical modeling and reinforcement learning control approaches, the present article aims to address this issue. To this end, a deterministic Susceptible-Exposed-Infectious-Recovered-type model with additional vaccine components is proposed. The proposed mathematical model can be used to simulate the consequences of vaccination policies. Then, the suppression of the outbreak is taken to account. The main objective is to reduce the effects of Covid-19 and its domino effects which stem from its spreading and progression. Therefore, to reach optimal policies, reinforcement learning optimal control is implemented, and four different optimal strategies are extracted. Demonstrating the efficacy of the proposed methods, finally, numerical simulations are presented.


Introduction
Since the first reported case of coronavirus disease 2019  in early December 2019 in China, it has resulted in an ongoing crisis that unprecedentedly spreads all around the world [1][2][3][4]. Acute respiratory syndrome can occur in patients with serious illness, leading to multiple organ failures and death in some cases. [5,6]. It has been established that the present pandemic's spread rate is much higher than similar previously reported epidemics in 2003 and 2012, namely SARS coronavirus (SARS-CoV) and MERS coronavirus (MERS-CoV). Until now, the epidemic crisis has resulted in a growing number of deaths all over the globe [7,8].
Mathematical simulations have long been used to obtain insight into the mechanisms of disease transmission [9][10][11][12][13][14][15][16][17][18][19][20][21][22]. The essence of modeling lies in defining a set of equations that mimic the system's spread or dynamic in reality [23,24]. From the beginning of the current epidemy, the mathematical models which show its spread have been at the forefront for prediction and control of the novel coronavirus outbreak [25][26][27][28][29]. Through the available data on the reported number of infections and information that we already know about the virus spread, as well as the confirmed number of deaths and hospitalizations, we can get an accurate insight for the future of the virus spread [30,31].
Up to now, to effectively mitigate the spread of COVID-19, decision makers in all countries have applied various control policies such as mandatory lockdowns, quarantining and isolating infected people, maintaining a minimum social distancing, imposing strict and encouraging and strictly enforcing, avoiding crowded events, and forcing people to use face masks while in public [32][33][34][35]. Recently, several effective vaccines have been introduced for battling the pandemic. Some of them have passed all criteria, and now countries are using them. However, now with the advent of confirmed vaccines, governments and decision makers face new challenges. Now, to apply vaccines in effective ways, several questions have to be answered quickly and accurately. Which policies should be taken for vaccination? How can decision making choose different components of people? How can the vaccine be distributed throughout the time? How will the vaccine be able to decrease the risk of being infected? Since the disease's dynamic is complicated, and its spread is affected by several factors, answering these equations requires to be considered as optimization problems, which motivated the current study. The present study aims to solve these questions by proposing reinforcement learning-based optimal policies.

COVID-19 model with controls
In this study, an extended version of "Susceptible-Exposed-Infectious-Recovered" (SEIR) compartmental model is introduced. In this model, the spread of COVID-19 has been investigated. Using the Markov Chain Monte Carlo (MCMC) method and fitting the proposed model to the real data, the dynamic system's coefficients have been derived.
As mentioned in [36] and [27], the total population is considered as N which can be classified into eight different epidemiological subclasses: the humans who are not infected but susceptible S, exposed E, asymptomatic infected having no clinical symptoms but can infect healthy people A, infected people showing clinical symptoms I , the quarantined humans who are not infected but susceptible S q , the quarantined humans who are exposed to the infection E q , the hospitalized individuals H and the recovered individuals R. Under these assumptions, the model is given by defining q as a rate of quarantined, β as the probability of transmission per contact, as the likelihood of having symptoms among infected people, σ as the proportion of individuals who move to the infected class, λ as the released rate of the quarantined uninfected contacts and c as the person-to-person contact rate. The diseaseinduced death rate of people is α. In this work, δ I and δ q stand for the transition of infected people and exposed people to the quarantined infected class, respectively. The recovery rate of asymptomatically infective patients is γ A and the γ H is the rate at which infected individuals get recovery, while γ H is the rate at which hospitalized individuals get recovery. Based on these coefficients, the epidemic model that proposes the transmission dynamics is given by represents the person-to-person contact rate (c) and detection rate δ I , respectively. Equation (2) and (3) include six parameters defined as follows: • c 0 : initial contact rate • c b : final contact rate that is larger than c 0 • r 1 : exponentially decreasing rate of contact rate • δ I0 : initial diagnosis rate • δ I f : fastest diagnosis rate • r 2 : exponentially increasing rate of diagnosis rate It is assumed that the contact rate exponentially decreases over time and the diagnose rate exponentially increases with respect to time. Furthermore, we rewrite system (1) as follows: are considered as the state vector. In this paper, this model has been selected because this model can describe the ongoing situation better. Firstly, this model has a higher reproduction rate over the other models [36,37] that make this compartment model reasonable and superior. To be more specific, in this case, the reproduction rate was found too unstable [37], and some new variants of the novel coronavirus have a higher reproduction rate. Consequently, when we consider a model with a high reproduction rate and impose vaccination as a controlling variable, the optimal controller can be adopted for the worst-case scenario [38,39]. Moreover, this model could estimate the confirmed case very well from 23 to 29 January 2020 because it considered different parameter variations, and its data collection was performed during intensive social events [39]. Therefore, this model can reflect the real situation better than others. In Sect. 4, we consider vaccination as a control input and discuss the system's input signal and how to impose the vaccination to the nonlinear system.

Optimal control problem
Consider the system dynamics described bẏ with x ∈ R n denoting the state, f (x) ∈ R n , g(x) ∈ R n×m and the inputu ∈ U ⊂ R m . Consider U as a set that is defined for the control input saturation.
Assumption 1 f (.) and g(.) are differentiable in their argument with f (0) 0 and g(0) 0, and they are Lipschitz continuous on their set, so f (x) + g(x)u is Lipschitz continuous on a set ⊆ R n containing the origin, so there exists a continuous control function u such that the dynamics (5) is asymptotically stable on and controllable. Assumption 2 The control matrix g(x) and f (x) are bounded over the compact set; g (x) ≤ g , g(x) ≤ f Definition 1 In this paper, we define infinite horizon integral cost as follows: where r (x(τ ), u(τ )) Q(x(τ )) + u(x(τ )) T Ru(x(τ )) and Q(x(τ )) is a positive definite monotonically increasing function. R is a symmetric positive definite matrix and Q(0) 0. Definition 2 (Admissible Control Policy) [40,41] u is the control policy that can be said to be admissible with respect to the cost function (6) on , written as u, if u is continuous on a compact set ⊂ R n and differentiable on , u(0) 0, u stabilizes (5) and for every x 0 ∈ , the V (x(0), u(0)) is finite.
According to the differentiability and continuity of cost function, the infinitesimal version of (7) is the nonlinear Lyapunov equation with (0) 0. In Eq. (6), the notation ∇ x (.) means the gradient operator with respect to x and is equivalent to ∂(.) ∂ x . Consider the Hamiltonian of (5) The optimal performance index function of (5) can be formulated as According to the Bellman optimal control theory, the optimal value function V * (x(t), u(t)) can be obtained by solving the Hamilton-Jacobi-Bellman (HJB) equation: Assume that the minimum value on the right-hand side of Eq. (10) exists and is unique. By differentiating the HJB, the optimal control for the given problem can be expressed as where V * (x(t), u(t)) is formulated in the following HJB equation This nonlinear partial differential HJB equation is extremely difficult to solve and, in general, maybe it is impossible to be computed in some cases. Moreover, complete knowledge of the system's dynamics is required. According to [42], the IRL algorithm is presented to estimate value function iteratively in the following section.
Definition 3 (UUB Stability [43,44]) For nonlinear system (5), with the equilibrium point x e its solution is said to be UUB if there exists a compact set ⊂ R n , so that for every x 0 ∈ , there exists a positive bound √ and a timeT √, x 0 > 0, independent oft 0 , such that x In this article, partially model-free integral reinforcement learning (IRL) has been introduced to obtain the optimal value function approximation V * (x) and a continuous optimal control policy u * (x).

Value function approximation using Critic network
The critic control design with neural networks generally is acceptable to determine the optimal approximation for control problems [45,46]. With the higher-order Weierstrass approximation theorem [47], a single-layer neural network can be utilized to reconstruct the cost function V * (x).
where w * c ∈ R l is suitable coefficients with l neurons, φ c (x) ∈ R l provides the activation function of the neural network(NN), and ε c (x) ∈ R is the reconstruction error. Assuming w * According to the [48], for x ∈ one can infer that ε c (x) and its gradient ∇ε While generally, the optimal coefficient w * c is unknown, the estimated value function is given by where w c denotes estimated weights of these basis functions that are updated through the learning process. The updating rule will be formulated in the following section.

Policy approximation using Actor-network
Zhu et al. [49], have determined policy estimation by considering the fact that if the initial admissible policy is given, the policy function can be expressed by NN. NN approximation is a well-known method for policy estimation in optimal control [50][51][52]. Therefore, similar to value function, in order to Weirstrass high-order approximation theorem, the smooth policy can be uniformly approximated over a compact set as where w * a ∈ R l ×m is optimal coefficients with l neurons, φ c (x) ∈ R l provides the activation function of the neural network, and ε a (x) ∈ R is the approximation error that is bounded is a continuous activation function.
Assumption 3 : R m ∪ {±∞} → U is a function that is continuous monotonic bijective. The first derivative of this function is bounded (.) d0(.) d(.) and (0) 0. [53], and softsign [54] activation functions satisfy Assumption 3. In this case, because the input should be bounded by a constant u ≤ u , softsign is employed. Then, the estimated policy function is given by.

Remark 1 tanH,SQNL
where w a denotes estimated weights to learn w * a .

Learning rules for actor and critic networks
Updating Rule for the Critic Network: By substituting Eqs. (14) in (8), we have , while based on Eq. (7), ε H can be given by Assumption 4 Under the Lemma 1 that is mentioned in [55] and by using Assumption 7 in [56], the least-squares solution to (17) exists and is unique for any admissible control policy and the number of hidden layer neuronsN → ∞, φ c (x) gives the complete independent basis for V * c (x). Hence, can be estimated by NNs in view of the following assumption and the Weierstrass higher-order approximation theorem, so as [40]. Motivated by the research in [57], so as to find the updating laws for the critic weights, we define the error function for critic network as To train the critic networks, the squared residual error regarding the critic network training should be minimized.
The weight of the critic network w c is updated in a gradient descent algorithm to minimize where α c > 0 is the critic learning rate. Hence, in the light of (22) and (11) and inspired by [42], the nearly optimal policy can be obtained by where we used V c (x) instead of the optimal value function V * c (x). This nearly optimal policy is used in the following section to update Actor-Network.
Updating Rule for the Actor-Network: Similar to the training of critic network, one may define where e a is the output error between the policy function u c (x) and the nearly targeted control policy u c (x) To minimize the square actor error E a , the weights of the actor-network are tuned by gradient descent rule as follows: Theorem 1 Consider the system given by (5) and the updating actor law and critic law given by (22) and (26), respectively. Assumew a w * a − w a ,w c w * c − w c and let σ (σ T σ +1) be persistently exciting (PE) [44]. If Assumptions 1-4 hold, the actor-critic weight estimation errorsw a andw c are uniformly ultimately bounded and w a and w c converge to a residual set in the neighbor of w * a and w * c , respectively.
Proof For convenience, we define The convergence of the actor-critic network during learning is based on Lyapunov analysis. We consider the following Lyapunov candidate First, let us consider L c or equivalentlẏ The solution of the HJB by considering (12) can be rewritten as where ε HJB is the residual error due to the function approximation error, which is It is now desired to show that this error converges uniformly to zero as the number of hidden layer units N increases [40]. Hence, it can be demonstrated that ε HJB is bounded. ε HJB ≤ 1 By considering (34), one can derive where σ is bounded. σ ≤ σ Then, The second term is, Combining with (34), For the second term of (31), one can writė Consequently Based on (28)-(30), (41) becomeṡ Then, u * c (x) be can be written Based on (25), e a become Then, using (45) in (42) By applying the Young inequality to the second term, we have Then, we rewrite (46) By considering softsign as the activation function, (y) With these functions, one can then show that the first term of (48) can be given Next, using (38), (40), and (50) to rewrite (30), we get and Assumption 2 and 3, one can conclude where u , 1 , ε 1 , σ , w * c , ∇φ c , f and g are the upper bound of where λ Q is a positive constant such that Q(x(t)) > x T λ Q x for every x ∈ . If we choose ε K and R such that σ − 1 bigger than zero, thenL yieldṡ If the parameters are selected such that and G are positive, then the Lyapunov derivative is negative if By mathematical induction, it is now desired to show if we can bound the Lyapunov function, then for sufficiently large Z L is negative. Therefore, by using the standard Lyapunov extension theorem [58], it follows that the system state and the weights error are UUB, which completes the proof.

Remark 2
If Assumptions 1-4 hold, then the assumption of the nonlinear Lyapunov equation solution of (12) can be relaxed without loss of the stability performance, and the equilibrium point of (5) remains UUB.
Remark 3: By utilizing gradient descent rules (22), (26), and the backpropagation rule, the HJB error E c 1 2 e 2 c and the point-wise control error E a 1 2 e 2 a update the critic and actor networks. The error E c is convex with respect to w c . Hence, the critic network's weight converges to its global optimal point by applying the updating rule (22). The error E a is non-convex with respect to w a so the weights of the actor-network converge to a locally optimal point by applying the updating rule (26).

Optimal vaccination strategies
In this study, several optimal vaccination strategies are proposed. In each strategy, we consider four cost functions to formulate the main concerns and characterizations that should be considered and noted. Then, we define the appropriate model for each of them. It should be noted that the main objective is to reduce the effects of Covid-19 and its domino effects which stem from its spreading and progression. In this section, the optimal control principle provides an optimized approach that can hinder the impacts of Covid-19 outbreak. Therefore, to minimize defined objective functions, we implement reinforcement learning optimal control to reach the optimal policy. Here, by using the HJB equation which is described in each subsection, the necessary condition for optimality is satisfied.

Strategy 1
In view of the above discussion, we suppose the optimal control problem with vaccination as input control. Motivated from proposed model in [59] and [60], we introduce a mathematical model with end-point state constraint, control input inspired of [37], and considering vaccine efficiency. This model is shown in Fig. 1 and can be driven as follows: where u denotes the ratio of susceptible individuals vaccinated per day (0 ≤ u ≤ 1) and e v is the vaccine efficiency. This parameter demonstrates the effectiveness of vaccine which means that if this factor e v 1, the vaccine is fully effective. Note that the term (1 − e v )βcV a (I + θ A) represents the vaccinated people who can be infected due to vaccine incompleteness and expresses the fact that no vaccination is 100% effective. Moreover, in the introduced model, V a indicates the vaccinated sub-population. In this strategy, we wish to reduce the objective function which considers the infected individuals and the ratio of vaccinated people where I,s 1 and u,s 1 are the relative weight factors selected to balance the objective function over innervation time t f .

Strategy 2
The objective function (55) can be enhanced by assuming exposed individuals as a population that should be considered to be minimized. In fact, by employing a strategy whose aim is to reduce exposed people, we can find a better solution to minimize the number of infected individuals and the cost of vaccination. More precisely, we seek that the optimal control consists of minimizing the objective functional subject to the mathematical model proposed by (56). Similar to (57), I,s 2 , s,s 2 and u,s 2 are positive weights for balancing cost function.

Strategy 3
In this strategy, we consider quarantined vaccination as a method that can effectively be taken into account to reduce the cost of vaccination and the number of infected and exposed individuals. Hence, the vaccination control variable is imposed on quarantined individuals who are susceptible to the virus. Then, the epidemic model with two control input imposed is given byẋ Indeed, in this model, the vaccination will be distributed equally between the quarantined and non-quarantined individuals. By considering this fact that quarantined individuals are considered as one group which are vaccinated, the quadratic objective functional (56) is defined as where E q ,s 2 E q 2 (t) is the quadratic terms of quarantined exposed individuals representing the population that we wish to minimize besides infected and non-quarantined exposed individuals.

Strategy 4
Here, instead of the uniform allocation of vaccine proposed in Strategy 3, we use two independent control variables for the propagation control of the coronavirus. The resulting control model, after incorporating the aforementioned control variables, is formulated via the following system: −S, 0, 0, 0, 0, 0, 0, 0, (S) 0, 0, 0, 0, −S q , 0, 0, 0, S q T

T x(t) S(t), E(t), I (t), A(t), S q (t), E q (t), H (t), R(t), V a (t)
In this strategy, u q is the input variable which represents the fraction of quarantined susceptible individuals who vaccinated. By modifying Strategy 3 in the control variables assumption, the updated objective functional (60) is given as where the u q ,s 2 u 2 q stands for minimization of quarantined vaccination. This objective illustrates the importance of vaccination optimization. Moreover, the constant u q ,s 2 similar to the proposed strategies is the balancing factor, which measures the relative cost of quarantined vaccination. Figure 1 shows these strategies. In the next section, we will present the result of each strategy and compare the numerical results of their optimal solution.
These strategies are designed based on this assumption that susceptible people have been determined. Moreover, in this article, the susceptible people are considered as the only group of people who should be prioritized for getting the vaccine because they are more likely to be infected by the infection, and their infection will be more severe than the other people. After identification of the susceptible individuals, they should be classified. In this case, susceptibility can be decerned through potential risk factors such as age or pregnancy. Consequently, it will be necessary to monitor the susceptible individuals and prioritize them regarding their conditions.

Numerical results
In this section, we simulate the epidemiological model with vaccination based on the obtained data from the laboratory-confirmed case of 2019-nCoV that occurred in mainland China which is proposed by [36]. It should be noted that their research was based on a collected dataset and surveys until January 22, 2020. They employed the Markov Chain Monte Carlo to estimate the model parameters and their baselines. Based on these parameters, we implement these four strategies in python. In each strategy, the balancing factors are considered to countervail the imbalances between the magnitude of objectives' value. In this simulation, the embedded Runge-Kutta (RK5(4)) [61] has been used to model the dynamics of the epidemiological system. According to the research in [62], we assume vaccine efficacy e v 0.90, and the parameters in the optimal control framework are taken as The initial values of weights are as follows: Based on [36], the model's baselines and initial values are given in Tables 1 and 2. Here, we use them as baselines of the model and the initial values. Next, according to the defined cost functions (57), (58), (60), and (62), reinforcement learning optimal control has been applied as a feedback controller. Now, the time evolution of respective subpopulations and vaccination efforts are shown in Figs. 2, 3 and 4. In Fig. 2, the outcome of different optimal control strategies on the population of "stratified groups of people" is shown. First, in Fig. 2, the time evolution of the subpopulations illustrates that by using the vaccination strategies, susceptible, 1000 R(0) 2000 exposed, infected individuals (with or without a sign of disease), hospitalized, and recovered population fall. Moreover, the number of hospitalized individuals is reduced compared with the no-control strategy. It can be considered as a secondary effect of vaccination. Furthermore, at the beginning of public vaccination, it can successfully reduce the number of infected people, and as a consequence, people are less likely to be exposed to the infected people who can spread the disease. Therefore, the need for hospitalization will decrease in the long term. From Fig. 2a, it is precisely shown that the population of susceptible individuals declines more in Strategy 4, in which vaccine has been considered for both quarantined and nonquarantined susceptible individuals. This can explain that quarantined vaccination is one of the best options for eradicating the disease in the long run. In Fig. 3, the vaccinated population is shown in each control policy. As shown in this figure, the total population of vaccinated individuals in Strategy 3 is lower than the other optimal control strategies; however, Fig. 2c illustrates that the time evolution of infected individuals in all optimal strategies are close to each other. Thus, one can see after 110 days, the population of infected individuals in each strategy is similar to the others. Therefore, Strategy 3 will be suggested to be taken into account if restriction exists in vaccine supplements. In view of Fig. 2a, one can obtain that the tenth day can be supposed as the perfect trigger time for vaccination. On this day, the population of susceptible exceeds the minimum itself, and after that, the population of this compartment will rise gradually. In this context, if the cost of vaccination is important to governments, they can follow Strategy 3, which is the best option to bring down the cost of vaccination and reduce the number of infected people simultaneously. Based on this strategy, it would be better for governments and authorities to begin the public vaccination when the population of susceptible people reaches its minimum. Figure 4 shows the number of vaccinated population in each strategy per day presented to compare the time evolution of the vaccinated population in four different strategies. From Fig. 4a, we compare the control profiles of each strategy.
One can see that in Strategy 4, the number of susceptible people declines more than the others; this strategy requires more vaccination effort. In this case, this fact is shown that from the aspect of vaccination cost, Strategy 3 can be more satisfying than the other strategies. Note that in Strategy 4, the vaccination distributes among quarantined and non-quarantined  Fig. 4b. One can infer from this figure that in the primary phase, the authorities should give top priority to the quarantined susceptible individuals, although the non-quarantined susceptible individuals also should be considered for vaccination. As mentioned in the previous section, these strategies are formulated to be performed just for susceptible individuals. As a result, it should be noted that before performing, the susceptible people should be identified, stratified, and prioritized. This stratification can be performed based on their risk factor and their vulnerability. Moreover, ring vaccination is another strategy to control the outbreak [63,64].
To be more specific, utilizing smart surveillance monitoring can provide the authorities and governors with a great tool to identify the susceptible people. This method can be taken into Therefore, these proposed strategies can provide effective protection. In this sense, in Fig. 4a, Strategy 2 shows that its performance is better than the performance of Strategy 1 because this strategy reduces the number of susceptible people more than other strategies. This figure also demonstrates that if the exposed people are considered in the objective function, the optimal controller can perform better regarding the reduction in both susceptible and exposed populations. It should be noted that the more exposed the population decrease, the less susceptible individuals can be infected. Due to this fact, one can infer that both susceptible and exposed populations should be considered in objective functions.
Also, from a practical viewpoint, let us denote that the reinforcement learning optimal control can introduce a better policy for vaccination distribution regarding Pontryagin's minimum principle. For example, in [59,65,66], the proposed optimal controls suggest the time evolution vaccination whose initial proportion is high and significant. This high initial value of vaccine usage makes Pontryagin's minimum principle approach impractical and too harsh in the real world, but as presented in this article, reinforcement learning optimal control can propose a policy with smooth starting that provides functionality and practicality for public vaccination.
Graphical results depict the importance of vaccine allocation. In these graphical interpretation shows that if the vaccination is taken into account, the severity of infection can be reduced gradually. In the presented model, vaccination plays a vital role in the reduction in susceptible individuals. Consequently, one can see that when suspectable individuals who can transmit the virus and be infected start to fall, the number of infected people can decline in number. Decreasing the number of symptomatically infected people will reduce the expo-sure of uninfected people to infected people. Therefore, it can reduce the probability of being infected through the disease transmission too. As a result, the number of infected people is decreased significantly, which can end up with the elimination of the disease in society. It should be noted that due to the slow dynamic behavior of the epidemic model, it seems that the vaccine does not affect the population of infected people, but over time, the significance of vaccination effectiveness can be observable. Hence, this simulation highly suggests that governments and authorities should not be obsessed with the number of infected people during the early stage of vaccination because vaccines take time to induce immunity.

Conclusion
In this research, the significant challenge regarding vaccination strategies for COVID-19 has been investigated. Based on data from confirmed cases of 2019-nCoV in mainland China, a new deterministic SEIR model with additional vaccination components was developed. Following that, based on the reinforcement learning method, an optimal control was developed to discover the best policies. By implementing the dynamic model of the epidemiological system, numerical results for four different control strategies obtained by the proposed technique were demonstrated. The feasibility of the recommended method for designing optimal vaccine plans was clearly shown by these findings. As a future study, it would be useful to look at any of the behavioral or emotional side effects of quarantine, such as depression, which may impact depression or even suicide rate in society. Such investigations lead us to find an optimal trade-off for quarantine decisions.