A receding horizon event-driven control strategy for intelligent traffic management

In this paper, the intelligent traffic management within a smart city environment is addressed by developing an ad-hoc model predictive control strategy based on an event-driven formulation. To this end, a constrained hybrid system description is considered for safety verification purposes and a low-demanding receding horizon controller is then derived by exploiting set-theoretic arguments. Simulations are performed on the train-gate benchmark system to show the effectiveness and benefits of the proposed methodology.

to predict and to cope with events. Smart city transformation relies on exploiting powerful analytical techniques to extract insights from real-world events in order to improve urban business processes. Creating and applying a unified information framework gives the possibility to obtain a more complete picture of urban activities, see Chourabi et al. (2012) and Morrissett and Abdelwahed (2018) and references therein.
Besides, smart cities need intelligent transport services which means proper movement of people, goods and services improving growth and development of a region. Transportation is indeed a human-oriented field with ample and distinct highly demanding problems requiring proper and efficient solutions. Features and performance of transport systems, services, costs, infrastructures, vehicles and control systems are usually defined on the basis of quantitative evaluation of their main effects. Most of the transport decisions take place under imprecision, uncertainty and partial truth. Some objectives and constraints are often difficult to be measured by precise values (Hoogendoorn and Bovy 2001).
Basically, Smart Cities whereas Intelligent Transportation Systems are large-scale eventdriven systems involving humans, information technology, and physical infrastructures, all interacting in complex ways. The dynamic behavior is usually and obviously affected by both uncertainty and nonlinearities, and significantly sensitive to perturbations. Such a complex infrastructure requires a set of applications related to newly decision support systems designed for emergency warning systems, public safety and many other human activities. Nonetheless a significant number of instances related to technical, economic, political, social aspects and so on, while determining a decision, must be taken into consideration. This is mainly due to inherent obstacles when collecting relevant, reliable and complete information (Dotoli and Fanti 2006;Di Febbraro et al. 2016).
From a methodological point of view, an adequate framework to formalize the description of the above event-driven phenomena relies on the use of the well-known hybrid system paradigm that characterizes plants involving both discrete and continuous dynamic behaviors (Antsaklis 2000). In the last two decades, hybrid systems analysis and control problems have grown in interest amongst the researchers mainly because the related theoretical tools require the intersection between mainstream engineering control theory methodologies and computer science verification techniques (Branicky et al. 1998;Tomlin et al. 1998;Balluchi et al. 2000;Engell et al. 2000). Hence, in order to understand the dynamical behaviour, to simulate first and to design then better performing control strategies, theoretical advances and numerical tools have assumed an increasing relevance. This essentially leads to the concept of formal verification that translates in solving reachability problems, see e.g. Alur et al. (1995). On the other hand such a problem is undecidable and, therefore, it is necessary to define modelling formalisms capable to be used so that related algorithms can be efficiently used. Along these lines, theoretical issues on hybrid automata have been formally discussed in Henzinger et al. (1998) where it has been proved that even slight generalizations of rectangular automata lead to undecidable reachability problems.
Following this reasoning, the Mixed Logical Dynamical (MLD) formalism (Di Cairano et al. 2009) is capable to specify the evolution of continuous variables through linear dynamic equations of discrete variables using propositional logic statements and automata. A relevant tool capable of building MLD models is HYSDEL (Hybrid System DEscription Language) developed in Torrisi and Bemporad (2004). Such toolbox is capable of modelling, in a human-readable fashion, the class of hybrid systems described by the interconnections of linear dynamic systems, automata, if-then-else statements and propositional logic rules. Moreover, any HYSDEL system can be formally and analytically translated into a MLD model for analysis and design purposes. Furthermore, since every well-posed MLD has been proved to have an equivalent Piecewise Affine (PWA) system representation (Heemels et al. 2001), any HYSDEL model can also be recast into a PWA characterized by a collection of affine system descriptions where each dynamics is defined over a polyhedral set (Bemporad et al. 2000).
From the control perspective, Model Predictive Control (MPC) provides the means to tackle some of the previously described Smart City/Intelligent Transportation Systems challenges, since it allows to directly take in to account constraints, preview information, as well as physical world models (Roncoli et al. 2015;Kamal et al. 2013Kamal et al. , 2014Papamichail et al. 2019).
As it is well known for hybrid linear systems, the MPC framework falls in the class of mixed integer linear programming (MILP) problems if the objective function is a linear function or in the class of mixed integer quadratic programming (MIQP) problems when the objective function is quadratic. Both MILP or MIQP problems are difficult to solve and some interesting properties like convexity are lost. Moreover, the complexity is NP-hard and, since no optimality conditions there exist, it is not possible to certificate the nature of a feasible solution.
As outlined in literature, see Lin and Antsaklis (2014) and references therein, the most common robust strategy to address such a class of optimization problems is Branch and Bound (Conforti et al. 2014;Fletcher and Leyffer 1998). In fact, in spite of poor control performance when an admissible optimization is considered, the algorithm is capable to achieve a global optimum or to asses its infesibility. On the other hand, Branch and Bound techniques solve an MIQP by constructing a search tree and at each node a Quadratic Program (QP) is solved to bound the objective function over a subset of the search space. This gives rise to non-trivial computational difficulties that essentially make such methods less appealing when plant dimensions increase.
Alternative approaches have been proposed to design MPC controllers. In particular, logic constraints have been addressed by exploiting constraint satisfaction problems in Bemporad and Giorgetti (2006). Whereas sub-optimal solutions have been derived by means of heuristic techniques: genetic algorithms (Cortés et al. 2010;Duzinkiewicz et al. 2009) and ant colony schemes (Sandou and Olaru 2007). have been used.
Due these unavoidable computational difficulties, the idea was to compute off-line the optimal control as done in e.g. Oberdieck and Pistikopoulos (2015). However, the application of these explicit methods is typically limited to low-dimensional systems, with very few discrete variables. The attempts to find explicit solutions for hybrid MPC controllers have been more successful when a PWA model is considered (Bemporad et al. 2002b;Wittmann-Hohlbein and Pistikopoulos 2014;Axehill et al. 2014). Unfortunately, it is obvious that the biggest drawback of this class of algorithms is the computational burden that grows exponentially as the prediction horizon increases: in fact by exploiting multi-parametric MILP approaches, the off-line complexity could become prohibitive for large-scale systems and real-time scenarios (Barić et al. 2008;Habibi et al. 2016).
Finally, it is important to recall that applications of hybrid MPC can be found in different fields. In automotive systems, hybrid MPC has been applied to traction control systems (Borrelli et al. 2006), adaptive cruise control (Corona et al. 2006), power systems to cogeneration plants (Ferrari-Trecate et al. 2004) or current converter control (Geyer et al. 2008), real-time optimization of public transport systems operations (Cortés et al. 2010), modeling and control of production-inventory systems (Nandola and Rivera 2011).
Starting from these considerations, in this paper we develop a set-theoretic receding horizon control strategy for the class of constrained PWA models capable to capture the dynamics of transportation systems for intelligent traffic management purposes. Accordingly, the main aim is to provide a solution capable to mitigate the computational obstacles arising when approximate explicit solutions are pursued. In fact from one hand the explicit framework is capable to reduce on-line computational burdens, on the other hand it gives rise to an off-line phase that could be computational intractable. Such an hitch is here tackled by exploiting controllability/reachability concepts combined with the polyhedral set description to move off-line most of computations. The advantage of such an approach is that off-line computational loads are also significantly weakened because it is not required to determine a feasible controller for each partition of the admissible state space region.
In the sequel, a formal verification of the underlying hybrid system is first presented and then the controller is designed by using reachability sets computations (Blanchini and Miani 2008). Essentially, the main contributions can be summarized as follows: -(Analysis) Forward and backward reachability concepts are used to address safety verification queries; -(Design) A real-time affordable MPC control scheme capable of regulating the plant state trajectory to a desired configuration, while prescribed safety requirements are fulfilled, is achieved.
Roughly speaking, the resulting control algorithm lies at the intersection of explicit (completely off-line) and MIP (completely on-line and based on MIP optimizations) strategies. In particular, most of the required computations are off-line moved while the on-line phase requires the solution of a simple and real-time affordable quadratic programming (QP) optimization problem, (Angeli et al. 2008;Lucia et al. 2017).
Finally, the simulation section is devoted to show the applicability of the proposed strategy to the train-gate system that is well-known in the timed automata verification literature, see e.g. Lygeros et al. (1996). Here, the traffic regulation management problem is of interest because it perfectly adapts to the proposed framework and MPC solution: since a train control system (see Baouya et al. 2019) has to be capable of -merging computer-based and network-based technologies for monitoring and controlling trains in a specific geographical area, -meeting safety requirements, the resulting hard constrains on the system variables can be efficiently addressed via receding horizon control arguments.
The paper is organized as follows. In Section 3 safety and regulation problems are formally stated; Section 4 describes algorithmic solutions to safety verification queries addressing reachability properties. In Section 5, the proposed set-theoretic receding horizon controller is presented, while Section 6 validates the effectiveness by means of numerical simulations carried on the train-gate benchmark system.

Preliminaries
Definition 1 (Polyhedron) A polyhedron is the intersection of a finite number of closed and/or open halfspaces. A polygon is the union of a finite number of polyhedra.
Definition 2 (Polyhedral partition) Let P be a polygon. A collection of polyhedra {P 1 , . . . , P l } is a polyhedral partition of P if P := i∈I P i and P i ∩ P j = ∅ ∀i = j .
Let us consider the discrete-time nonlinear plant description where and denote the state and input vectors, respectively, and . Without loss of generality, it is supposed that f is continuous in its arguments and f (0 n , 0 m ) = 0 n . Moreover, the following constraints are prescribed (2) with X and U compact polyhedra.
Definition 3 (Backward Reachability) Given a set T ⊆ X , the predecessor set of T , denoted as P re(T ), is the set of states for which there exists an input u(k) ∈ U such that Definition 4 (Forward Reachability) Given a compact set T ⊆ X , the successor set of T , denoted as P ost (T ), is the set of states reachable in one step from T by using an admissible input u ∈ U , i.e. (4) Definition 5 (Projection operator) Given a compact set , the projection of Z onto X , denoted as P roj X {Z}, is

Problem formulation
Let us consider the following controlled switching hybrid model T is state vector with , and w(t) ∈ W = denotes the continuous dynamics, the finite dynamics and w + the successor of w, i.e an event-driven signal. See Branicky et al. (1998) for technical details.
Moreover, the following assumptions are made: 1. switching input constraints are prescribed: with U (z(t), w(t)) a convex and compact set; 2. a subset of the system state space, namely , is unsafe and, starting from any admissible initial condition, the system trajectory never enters inside, i.e.
The following verification and control problems are considered: Verification and Control of Hybrid Systems Under Safety Requirements (VCHSSR) -Given the constrained hybrid model (6) capable to drive the state trajectory of Eq. 6 into Ξ in a finite number of steps while preserving the prescribed constraints (7)-(8).
In the sequel, these problems will be addressed by recasting the class of hybrid systems (6)-(7) as a discrete-time constrained PWA model.
For the sake of clarity, it is worth noticing that the plant (6)-(7) can be described as a discrete-time MLD or event-driven MLD (eMLD) system, see e.g. (Torrisi and Bemporad 2004). Then, each well-posed MLD model can be recast into an equivalent PWA representation and vice-versa (Heemels et al. 2001).
Therefore, the following state space description is achieved: where is the index set accounting for all convex polyhedra P i , i ∈ I, and P a polyhedral partition. Moreover, the safety constraint (8) is characterized by the following polyhedral region which leads to an additional non-convex state constraint on the plant model (9): with . Finally, it is important to remark that the required time instantt is in turn bounded, i.e there exists a finite time instant, say T max , such that 0 <t < T max < ∞.

Verification of constrained PWA systems
In this section, forward and backward reachability concepts are adapted to the constrained PWA plant description (9)-(10) with the aim to provide algorithmic answers to Queries 1-3 of the proposed VCHSSR-(P1) problem. Specifically, the following results come out.
Proposition 1 Let a polygon T = j ∈J T j ⊂ P roj x {P}, with {T j } j ∈J convex sets, be given. Then, the predecessor set P re(T ) is Proof -The proof directly follows from the backward reachability Definition 3. According to the PWA description (9), the predecessor set P re(T ) is the union of all admissible sets of states arising from the the polyhedral partition P. In fact for any element P i of P, one obtains the regions X i,j ⊆ P roj x {P i } compatible with Eq. 3. As a consequence, the set P re(T ) is a polygon built as the union of X i,j , ∀i ∈ I, ∀j ∈ J .

be given. Then, the successor set P ost (T ) is (13)
Proof -By resorting to Definition 4, similar arguments of Proposition 1 apply.

Query 1
Proposition 3 Let an initial state condition x(0) ∈ (X saf e ∩ P roj x {P }) and a positive integer N (prediction horizon) be given. Then, the following AQ-1 algorithm provides a solution to Query 1: Proof -Since the proof follows by construction, the graphical description of the AQ-1 algorithm in Fig. 1 will be hereafter considered for the sake of comprehension. Starting from the initial condition x(0) (the red star) and according to the following recursions: T 0 := x(0), T r := P ost (T r−1 ), r = 1, . . . , N, a family {T r } N r=1 of successor sets (green polyhedra) is computed via Steps 1-3. Then, the set X intersect := {T r } N r=1 ∩ X unsaf e is obtained by means of Step 5, where X unsaf e (the red polyhedron) is the unsafe region. Finally, Steps 7-8 provide the answer.

Query 2
Proposition 4 Let the unsafe region X unsaf e and a positive integer N (prediction horizon) be given. Then, the following AQ-2 algorithm provides a solution to Query 2: Proof -Starting from T 0 := X unsaf e , the predecessor sets sequence {T r } N r=1 (see green polyhedra of Fig. 2) is computed according to the following recursions: T 0 := X unsaf e , T r := P re(T r−1 ), r = 1, . . . , N  (16) is computed (Step 5) under the requirement that the state trajectory enters X unsaf e in at most N steps.

Proposition 5 Let a target set Ξ and a positive integer N (prediction horizon) be given. Then, the following AQ-3 algorithm provides a solution to Query 3:
Proof -The proof follows similar lines of Proposition 4 under the following customizations: -recursion (17) origins from the target set Ξ (green polyhedra in Fig. 3); -the predecessor set computation exploits the set-difference operator in order to rule out any state belonging to X unsaf e : T 0 := Ξ, T r := P re(T r−1 ) \ X unsaf e , r = 1, . . . , N

Fig. 3 Algorithm AQ-3: Illustration
Remark 1 The difference between the polygon P re(T r−1 ) and the polyhedron X unsaf e (Step 1 of AQ-3) is a set-difference for each polyhedron X i,j belonging to P re(T r−1 ) This, in principle, could give rise to a non convex setX i,j . Then, in order to overcome such a drawback and to ensure that T r is given by the union of convex polyhedra, the idea is to consider any non convex polyhedral setX i,j as the union of a finite number (p < ∞) convex polyhedra (see Fig. 4), i.e.

A receding horizon control scheme for PWA system
In this section, the constrained regulation problem VCHSSR-(P2) will be addressed via a low-demanding MPC strategy. The key idea is to off-line compute a family of predecessor sets {T r } N r=1 to be used during the on-line operations in a receding horizon fashion for determining sequences of control inputs {u(k)} compatible with the prescribed constraints. Specifically, the on-line phase has the following abstract structure: where i ∈ I denotes the index of the so-called active PWA model and J (x(k), u) a preassigned convex cost function. In other words, the optimization (21)-(22) will force the one-step state evolution x(k + 1) to belong to the successor of the current controllable set, i.e.
Note that the off-line computations required for {T r } N r=1 match those of AQ-3. A key question concerns with the pertinence of this scheme to the proposed PWA model framework because (as pointed out in Remark 1) each predecessor set T r is the union of convex polyhedra (Rakovic et al. 2006) and, therefore, Eqs. 21-22 is a non-convex optimization. An admissible, though not optimal, method to overcome such a drawback consists in verifying if, for which polyhedron X r−1 i,j ⊂ T r−1 , the following convex optimization admits a solution: Once a candidate polyhedron X r−1 i,j ⊂ T r−1 has been identified, then the optimization (21)-(22) can be recast as a convex QP problem: The above developments allow to write down the following computable algorithm, hereafter denoted as PWA -RHC.
Proposition 6 Let the family of predecessor sets {T r } N r=0 be non-empty and Then, the PWA -RHC algorithm always satisfies the prescribed constraints and ensures that x(k) ∈ Ξ for some k ≤ N .
Proof It is sufficient to prove that Steps 3-4 of the PWA-RHC algorithm admit a solution at each time instant. Since the family of predecessor sets {T r } N r=0 defines the domain of attraction (DoA) of the resulting receding horizon controller then, for any initial condition x(0) ∈ N r=0 {T r } , there exists a finite sequence of control moves capable to drive the state trajectory to Ξ, see Proposition 5. As a consequence, there always exists a polyhedral region X i,j ⊂ T r−1 satisfying (23) and the optimization (24) has a feasible solution u(k) Hence, by induction, the state trajectory x(k) enters T 0 ≡ Ξ in at most N steps.

Case study
In this section, a benchmark road traffic model is used to show the effectiveness of the proposed methodology. The first part introduces the mathematical plant description and constraints that have to be considered. Then, the receding horizon feedback controller results are detailed and presented. All the simulations are carried out on a laptop equipped with Intel Core i7-4810MQ, 32 GB DDR3L Notice that forward and backward reachability sets have been obtained by resorting to the computation capability of the MPT3 toolbox (Herceg et al. 2013).

Train gate model and constraints
The train-gate system detailed in Henzinger et al. (1997) and Di Cairano et al. (2009) is here considered. The system dynamics is modelled by means of the following continuous-time state space descriptionż where x T and x G account for train positions and gate opening status (open if x G ≥ 0.95 and closed if x G ≤ 0.05), respectively; u T and u G are the control inputs and f i an exogenous input. Then, the gate automaton depicted in Fig. 5 describes the finite dynamics (w), while the switching input constraints are collected in Table 1. Such a model falls under the class of systems (6) by exploiting the following arguments. First, an HYSDEL model description can be obtained by resorting to the event-driven model (Torrisi and Bemporad 2004) (see also the HYSDEL 2.0.6 description of Eq. 27 available at the web link: https://goo.gl/tDyH8n) where the state t (k) and input q(k) = t (k + 1) − t (k) have been added in order to avoid any mode mismatch after the discretization of Eq. 26, see e.g. Júlvez et al. (2014). Note that q(k) accounts for the time interval between two consecutive events while t the elapsed time.
Moreover, the additional input constraint is imposed to force a maximum and minimum time interval between two consecutive control actions. This is required to avoid the system stays in a open-loop condition for too long or high frequency chatterings and Zeno behaviors (Zhang et al. 2000).

Simulation results
The HYSDEL model described in the previous subsection has been translated into an equivalent MLD formulation by resorting to the algorithm developed in Bemporad (2002a). Finally, by resorting to the built-in developed in Bemporad (2003), the MLD has been converted into an equivalent PWA model whose state and input vectors are where x T (k) = u T (k)q(k) and x G (k) = u G (k)q(k) denote train and gate position displacements within q(k), while C, Cl, O, Op refer to the gate automaton states of Fig. 5. Moreover, a polyhedral state space partition has been achieved as the union of 31 polyhedral regions P i . Finally, the X unsaf e has been defined by taking care of the dangerous scenario: train crossing and gate not closed, i.e. −10 ≤ x T ≤ 10, x G ≥ 0.05. Therefore, the following region comes out X unsaf e :

Risk analysis
The simulation first considers the following operating scenario: Starting from an initial condition characterized as follows: -the train is far away from the gate: -the gate is in any status: provide an answer to the question: is the unsafe region X unsaf e reachable within N = 100 steps?
In order to deal with such a request, a family of 100 successor sets {T r } 100 r=1 has been computed via the AQ-1 procedure, see Fig. 6 (blue square region). A straightforward analysis shows that the reachable set covers X unsaf e (the violet square region).
Then, this requires the design of a controller module capable to avoid the unsafe region (28) while the train is crossing.

Train-gate traffic regulation management
According to the prescriptions of the PWA-RHC algorithm, a family of one-step state ahead controllable sets has been computed by using the procedure AQ-3 with Ξ, defined by Eqs. 29-30, as the initial condition. The resulting DoA is depicted in Fig. 7. As it clearly Unsafe Region Fig. 6 Train-gate forward reachability analysis. The blue regions are the reachable sets projected along X T and X G . The violet square region characterize the unsafe region (28) Fig. 7 One-step ahead controllable sets projected along x G and x T results, DoA ∩ X unsaf e = ∅ and, as a consequence, the system state trajectory is confined within the admissible state space region P roj x {P} \ X unsaf e .
Numerical results are collected in Figs. 8, 9, and 10. As expected all the prescribed constraints are always satisfied, see Fig. 8. Then, the evolution of the gate automaton binary variables is depicted in Fig. 10, where the resulting mutually exclusive behaviour is complying with the prescriptions of the automaton of Fig. 5. In Fig. 9 where train and gate position dynamical evolutions are reported, the capability of the proposed strategy to guarantee a safe and intelligent management of the train-gate system is explicitly outlined: during the time interval [20 60]sec. (the green zone) while the train is crossing (−10 ≤ x T (t) ≤ 10 in the upper sub-graph), the algorithm recognizes such an event and autonomously maintains closed the gate (x G (t) ≤ 0.05 in the lower sub-graph). Finally for the sake of completeness, Fig. 11 shows the set-membership signal r(t), exploited in the On-line phase of the PWA-RHC algorithm. It is important to remark that the dynamical behaviour of r(t) testifies that the train-gate state trajectory monotonically converges to the target region Ξ ≡ T 0

Conclusions
In this paper, a model predictive control strategy has been developed with the aim to formally address traffic control issues within a smart city framework. By first rephrasing a class of transportation systems as constrained PWA state space models, forward and backward reachability concepts have been exploited in order to efficiently answer safety verification queries. Then, a constrained regulation control problem has been presented and solved by means of a low-demanding MPC scheme based on the computation of reachability sets sequences. In order to challenge the proposed approach, a well-known case study in the intelligent transportation filed has been considered for simulation purposes. The numerical results are encouraging in terms of the capability to efficiently prevent critical scenarios. Future studies will focus on the occurrence of unknown events giving rise to time-varying unsafe regions. In principle, this will allow of enlarging the domain of applicability of the proposed approach at the expense of increasing computational loads.
Funding Open access funding provided by Università della Calabria within the CRUI-CARE Agreement.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.