Distributed Monitoring Based on P -Time Petri Nets and Chronicle Recognition of the Tunisian Railway Network

. This paper falls under the problems of the monitoring of a Discrete Event System (DES) with time constraints. Among the various techniques used for online and distributed monitoring, we are interested in the chronicle recognition. Chronicles are temporal patterns that represent the system’s possible evolutions. The proposed models are based on P -time Petri nets that are suitable to represent with accuracy and modularity the Tunisian railway network. These models are scalable and may be used to represent a large variety of railway networks. Then, monitoring is based on the generation of chronicles that are suitable to detect and isolate traﬃc incidents in a distributed setting. Consequently, the proposed approach is tractable for large networks. Finally, to demonstrate the eﬀectiveness and accuracy of the approach, an application to the case study of the Tunisian railway network is outlined.


Introduction
Transport systems need to be monitored online to avoid critical situations and temporal disturbances.
ese disturbances concern either the railway infrastructure or the traffic management and may lead to service disruptions due to weather, obstacles on the tracks, malice, social movements, and so on.In the systems under consideration, the processing times are interval-valued with parameters that depend on the operation to be performed.Any deviations from the specified interval will characterize a traffic disturbance.Consequently, the monitoring of the time intervals will be used as the main principle to detect and isolate the disturbances that affect the system.In this context, we propose the chronicles as a formalism for interpreting events to monitor temporal disruptions.A chronicle is composed of a set of events and a set of temporal constraints linking the pairs of events.e proposed approach is applied to the railway transport network in Tunisia.e main contribution of this paper is to use the combination of Petri net formalism and chronicles for the analysis of traffic disruptions.e overall goal is to maintain the stability and efficiency of the studied railway network.
Over the past decade, the chronicle formalism has been developed and used by numerous authors, particularly for faults diagnosis [1][2][3][4].It was also used by the Telecom operators for fault diagnosis in telecommunication networks [5] or for the diagnosis of web service failures [6,7].Lately, to deal with the time aspects inherent to the chronicles, the authors in [8] propose an automated translation of chronicles into a set of Labeled Time Petri Nets with Priorities (LTPNPr).e aim of this study was to improve the characterization of diagnosability for a discrete event system by taking into account the notion of finite durations between the occurrence of two events.e diagnosability study was done by comparing the chronicles associated with the normal behavior to the chronicle associated with faulty behaviors.e diagnosability analysis is based on LTPNPr in which priority relationships on transitions are used to complete the firing conditions. is approach is different from our contribution that uses P-time Petri nets for modelling issues and that excludes the notion of priority for transition firings.In [9], the authors proposed a diagnosis approach based on chronicles and modular temporal analysis.In fact, a failure was allocated to each set of chronicles, and each chronicle recognized the fault signature which was obtained from the state diagnosed with the finite state automata associated to each process module.
To describe clearly all desired behaviors of an automated production system, an incremental learning approach, based on Causal Temporal Signatures (CTS) was proposed in [10].
e CTS was defined as "a subset of partially-ordered observable events that characterizes the system's faulty behavior".e formalism of CTS, based on chronicles, was used to diagnose faults in Discrete Event Systems (DES).e main benefits of this formalism were the readability and the expressiveness.In [11], the authors proposed a chronicle model allowing integrating prohibition constraints representing the absence of events in the model.Based on this formalism, criteria were proposed to characterize the chronicles and to compare them in order to evaluate the relevance of the chronicle database used for the diagnosis.
e chronicles were modeled by temporal Petri nets, and the exclusivity test was solved by a model checking approach.
e association of the Petri net formalism and chronicles for the monitoring and diagnosis is widely proposed in the literature [12][13][14][15].In these works, the notions of causality, conflict, competition, unfolding, time branching formulated in Petri net setting lead to the modelling, identification, and discrimination of fault patterns.ese approaches can be extended to more complex monitoring problems where the places not only represent faults but also process states.is context was also exploited in our approach: no specific assumption is made about what the chronicle represents, and it can be associated with normal or faulty behaviors.
In transportation systems, a large number of observations are regularly collected and should be processed.Such a large amount of data cannot be treated online efficiently by a human operator.On the contrary, chronicles are suitable to analyze such data in order to recognize normal and faulty behaviors.e main advantage of this tool is the ability to describe and represent the possible evolutions of the transport systems and to recognize these behaviors in a flow of events.e contributions presented in this paper are devoted to distributed monitoring of rail transport networks and deal with the detection of traffic disturbance symptoms in these systems.P-time Petri nets are used for modelling aspects.Among the various techniques used for the distributed monitoring, we are interested in the chronicles recognition.
e paper is organized as follows.Section two presents the railway transport system in Tunisia and gives some basic notions about P-time Petri nets.e third section presents the chronicle formalism and illustrates how chronicles are applied to the distributed monitoring.In Section four, the approach is applied to the Tunisian railway transport network.
e main purpose of this study is to avoid time constraints violation and to guarantee the stability and safety of railway traffic.Finally, the last section concludes the paper.Some perspectives for further works are also proposed.

Presentation of the Studied Transport Network.
e railway network of the Sahel Tunisia, Figure 1, ensures the transportation of passengers between the main cities of the Sahel from Sousse to Mahdia.It starts at the Sousse Bab Jdid station, crosses the industrial zone of Sousse, and bypasses the Sahline city until the Monastir station by the serving the airport, the tourist zone, and the University of Monastir; Figure 1.South of Monastir, the line continues to the Ksar Hellal city going through the industrial zone, and the main agglomerations located on this axis are Khniss, Ksibet Elmedouini, Bouhjar, and Sayada.Leaving Moknine, it serves the industrial zone of Teboulba and continues to Mahdia.
e particularity of this railway network is the single line connecting the Bekalta station to Mahdia tourist zone station.erefore, the segments are unidirectional in this area, while it has double tracks in the rest of the network.
With an average of 40 minutes of frequency, the metro of Sahel ensures daily 44 journeys scheduled between 5 : 00 am until 10 : 00 pm and ensures the transport of more than 9 million passengers per year with an average of 27,000 passengers daily.Figure 2 shows the travel times between the various stations deserved by the metro of the Sahel.

Model of the Studied Railway Network
2.2.1.P-Time Petri Net.Several modelling approaches have been proposed for transport networks.Models may be graphical or analytical or both as the same time as Petri nets.In this work, P-time Petri Nets (P-TPNs) are used for modelling the transport network.In such models, travel durations are included within a minimum value and a maximum one.
e formal definition of a P-TPN is given by a pair <R, IS>, where R is a marked Petri net: IS i defines the static interval of sojourn time of a mark in the place p i belonging to the set of places P (Q + is the set of positive rational numbers).A token in the place p i fires an output transition when it has stayed in p i a duration at least a i and at most b i .After the duration b i , there is a death of mark in p i .

Modelling.
e Sahel railway network consists of 3 main stations (Sousse, Monastir, and Mahdia) and 28 other stations, Figure 3.
e travel from Sousse to Monastir is represented by the places p 63 to p 45 , Figure 3.In the considered application, the white places represent the paths between two stations, the red places represent the stations, 2 Journal of Electrical and Computer Engineering and the gray places represent resources introduced to avoid catching-up.A specific module for bidirectional segments is detailed in [17] and used in Figure 3. e sojourn duration q i in each place p i represents either the travelling time between the station or the parking times in stations.Such duration has an expected value (q ie ) which should be computed in order to satisfy the planned schedule (Table 1).
e main parameters of the models are defined as follows: A time interval [L i , H i ] expressed with time unit TU is associated to each segment between two successive stations.Its lower bound L i indicates the minimum time required for the travel and the upper bound H i fixes the maximum time not to be exceeded in order to avoid any temporal disturbance on railway traffic.A train can park in a principal station for at least one minute.e static intervals associated with the three main stations are ISp 1 � ISp 45 � ISp 63 � [60, +∞]; Figure 3.
e sojourn time of a metro in any other station is estimated from one to two minutes: IS i � [60, 120]; Figure 3.At the beginning of each day, it is assumed that 4 trains start from the Mahdia station, and 2 others are stationed at the Sousse station; Figure 3. e static intervals IS i and the effective sojourn time q ie associated with the stations and with the segments between two successive stations are detailed in Table 2 [17].
e static intervals are defined based on the SNCFT traffic dataset.

Chronicles Formalism
Chronicles provide formalism for monitoring transport systems.A chronicle is composed of a set of events, a set of temporal constraints linking the pairs of events, and the diagnosis test that describes the recognized situation [18].

Basic Definition.
Preliminary definitions, useful for the rest of this paper, are given in order to explain the distributed detection principles.
An event is a stimulus to which the system can react by a state change [19].An event can occur after a message has been sent by the process at the beginning or at the end of any operation.
Definition 2 (see Reference [19]).e occurrence date is the time corresponding to an event issued from the process.Let O be the occurrence function which associates to each event e i its occurrence date O(e i ); then,

O: E
where E is the set of events.Definition 3. A constraint is a relationship expressed by the duration between event occurrences.Two types of constraints can be distinguished; Figure 4: Local constraints link timed events in the same monitoring site Global constraints link timed events in different monitoring sites In our study, the monitoring system (site) S i manages a physical zone (i.e., a set of sensors and resources) in the system considered as a Discrete Event System.A monitoring site is composed of six functions: failure detection, diagnosis, prognosis, follow, resumption, and emergency.Our study is limited to the detection function, whose role consists in recognizing a deviation from the normal (expected) functioning, locally or in a distributed manner by communication and cooperation between different monitoring sites.
In many cases, the local information generated by each monitoring site is insufficient, and communications between sites become essential to compensate this deficiency.When these systems are connected, we have a distributed monitoring system.e ease of implementation, test, and maintenance and the reduction of the software complexity in distributed systems are furthered by a high degree of modularity and a low degree of coupling between modules [20].
is type of systems can easily be extended if the existing elements change or if new elements are added; the reconfiguration is, therefore, encouraged.
In a distributed monitoring architecture, the communication aspects are significant and specific problems must be taken into account, such as the clocks synchronization, the reconstitution of the exchanged messages order, and the communication delays.In this context, the main contribution of this paper is the evaluation of the influence of the communication delays between modules, on the temporal constraints verification.In particular, the proposed solution, inspired from the work of Boufaied, evaluates the impact of the uncertainties that concern communications delays, on the global constraints in railway transport networks.

Time Constraints Verification.
e time constraints verification is based on some assumptions: e communication delays Ω belong to the interval [Ω min , Ω max ] Each monitoring site has its own clock, and all clocks have the same time base.erefore, an event is dated only in the time frame associated to the receiving site.e occurrence function represents its temporal coordinate in the associated time frame.e proposed technique is suitable for any system in which the operational constraints and the communication    time uncertainties are of the same order, such as railway transport systems.e problem to be solved can be summarized as follows: Let C X,Y be a global constraint linking an event e X to e Y ; Figure 5. Whatever be the nature of the constraint, it is always possible to express it as an interval.us, C X,Y will be defined by ( Since events e X and e Y are received and dated by two different sites, it is not possible to directly evaluate the duration O(e X ) − O(e Y ).erefore, it is necessary that the site S Y informs the site S X when it received the event e Y (if we consider that only the site X is responsible for the time constraint monitoring).is is performed by sending the event e k ; Figure 5 As Ω min ≤ Ω ≤ Ω max , we obtain which leads to e verification of the interval constraint consists, by means of the measurable duration Φ, of looking for the durations O(e X ) − O(e Y ) that verify both: A graphical representation of these two constraints is shown in Figure 6 2) define two bands.e searched durations belong to the intersection of these two bands which defines a polygon noted PO. e position of PO depends not only on the duration O(e Y ) − O(e X ) but also on the terminal positions of the duration Ω with respect to d Y,X and f Y,X .For any duration Ω, PO is defined by 4 points: X1, X2, X3, and X4 of respective coordinates In many usual diagnosis approaches, the notions of uncertainty, inaccuracy, and incompleteness of information are modeled through bounded intervals.Whether the observation belongs to the expected interval leads to a binary reasoning about the detected inconsistencies. is type of binary reasoning may be insufficient for monitoring and diagnosis, especially for the evaluation of marginal deviations that can occur during transient phases.To enrich the reasoning, fuzzy sets and the theory of possibilities were integrated and lead to the definition of new fuzzy models.In order to quantify the set of possible durations Φ, a graphical representation, inspired from [19], is proposed; Figure 7. Considering a bounded delay, the possibility, that a time constraint is satisfied, belongs to the interval [0, 1].Consequently, the verification of time constraints can be represented by fuzzy membership functions.is result makes it possible to highlight zones of certainty for the detection function: if the constraints to be verified are associated with a normal behavior of the monitored system, a high possibility value ensures a normal behavior of the monitored system; Figure 7. On the contrary, a low possibility value implies the detection of an illegal behavior.

Distributed Monitoring of the Sahel
Railway Networks  In distributed monitoring structures, the process is decomposed into several local models.To each model is associated a local diagnoser.Each diagnoser makes his decision based on local observation.In the case of global specifications, a protocol allows the communication between the different diagnosers in order to make a final decision.e distributed monitoring, based on chronicles, verifies that each observed event is consistent with the chronicles specified by the time constraints.If the chronicles represent an abnormal behavior model, chronicles recognition is used for monitoring purposes.

Distributed Monitoring Architecture.
In the studied railway networks, every set of sensors providing useful information has its own monitoring sites.en, these sites are connected in distributed architecture.According to Figure 6, the chronicles are distributed into several subchronicles associated to the different monitoring sites S i .Each diagnoser monitors locally a subsystem and communicates with other diagnosers in order to get necessary information in order to take decisions relative to the distributed diagnosis; Figure 8. erefore, the detection function of each site has to recognize an evolution of the monitored process by subchronicles which are defined as sets of patterns of observable events temporally constrained.e recognition is performed through the verification of the time constraints associated to the considered subchronicles.
e distributed detection function monitors the system evolution through the recognition of chronicles; Figure 8.

Distributed Monitoring of the Railway Sousse-Monastir.
In order to help the supervisor in charge of managing the studied railway networks (i.e., detecting traffic perturbations, alert traveler claims, and maintain stability and security of the networks), a monitoring task is needed.e overall aim of the proposed monitoring approach is to control that the railway traffic proceeded well to avoid undesirable situations.e distributed monitoring of the Sahel railway networks based on the chronicle method involves the following steps.

Step 1: Subsystems Identification.
e first task is to subdivide the railway network system into sectors (subsystems).
e railway network between Sousse and Monastir has been split into 10 sectors, as shown in Figure 9.Each sector is indicated by the dashed lines.ese sectors are

Step 2: Sensor Recognition.
is step consists of identifying the sensors needed to perform the system monitoring.In the proposed approach, each site S i , Figure 9, Figure 6: Representation of the admissible domain [19].

Behavioral deviation
Normal behavior Figure 7: Possibility function for an interval constraint with X 1 ≥ 0, X 2 ≥ 0, X 3 ≥ 0 and X 4 ≥ 0.   monitors a specific zone of the railway from Sousse to Monastir, through the observation of a set of events generated by the process.In the railway network, the travelling times should be within two bounds.Any deviations (occurrence of a temporal disturbance) from the allowed lower (resp.upper) bounds will lead to a low service quality and can lead to disaster scenarios.erefore, the proposed monitoring approach, based on chronicle formalism, uses the additional information provided by the knowledge of interval constraints and allows detecting disruptions when a constraint is violated.Figure 9 gives journey times between the railway stations and parking times of the metro in stations.ese durations are represented by the static intervals "IS i ".

4.3.4.
Step 4: Scenario Generation.A scenario is defined for each possible deviation in each section bringing the system to an erroneous situation.Deviations can occur due to unavailability of transportation systems, temporal disruptions, or traffic management and disturbances.
Let us detail the monitoring between the two events, e S18 (metro arrival at the Monastir station) and e S1 (departure from Sousse Bab Jdid); Figure 9.To monitor this duration, it is necessary to check the time constraint linking the occurrences of the two events e S18 and e S1 . is timing constraint is a global one; therefore, the verification of this constraint can be performed through the measure of the travelling time between the station and parking time of a metro in stations.As long as these durations are included in the mentioned intervals, no disturbance is detected.Otherwise, a traffic disturbance is detected.As previously mentioned, the global constraint to compute is an interval constraint type defined as According to the time intervals (Figure 3), the minimum time (d S18,S1 ) of the travel between the Sousse and Monastir stations is 2315 s, whereas the maximum time (f S18,S1 ) is 3085 s.

Tested Scenario: Delay Departure of the Metro from the
Sousse Bab Jdid Station.In the studied railway network, the detection function monitors the system evolution through the verification of time constraints.Let us suppose that where

Journal of Electrical and Computer Engineering
From an experimental point of view, at the end of each journey, the current real-time values are collected and stored in an SNCFT database.e only data, from which the identification is computed is, therefore, a sequence of vectors indicating the planned schedule and the actual train departure times at each station.In order to illustrate our approach, a small part of the real data has been extracted from Table 3. is table shows the planned and measured times associated to Sousse-Mahdia direction.
ese measurements have been recorded at the month of June, 2018.
Let us suppose a late departure of the metro from the Sousse Bab Jdid station (departure at 05 : 41 : 22; see Table 3), observed by the monitor S3: Φ es1⟶es3 � 620 s. is delay may involve an illegal behavior and can lead to a degraded service.In fact, according to Figure 10, we deduce that the possibility of railway traffic delay is of 0.39 (possibility of violation of the global constraint C S18,S1 ). is delay can affect the stability of the studied railway network: according to Table 3, the metro arrives in the Monastir station with a delay of 685 s: violation of the constraint C S18,S1 (planned arrival time 06 :10 : 00/measured arrival time at 06 : 21 : 25).Consequently, the distributed monitoring, based on chronicle, allows an early detection of traffic disturbance, to avoid catastrophic scenarios and preserve stability and security of the studied railway networks.

Conclusions
In this study, we investigate the monitoring of a railway network.e proposed monitoring architecture is a distributed architecture, based on monitoring sites.To each site is associated a subsystem receiving a set of events and providing a detection function.Abnormal behaviors and traffic disturbances are recognized with the cooperation of local detection functions.
e verification of the global constraints supposes the existence of communication tools allowing event exchanges between monitoring sites.e chronicle recognition is exploited for the detection of traffic disturbances.
e problem of the distributed recognition of subchronicles through the verification of local and global time constraints has been pointed out. is recognition is based on time constraints verification performed with a possibility evaluation.e results obtained for the illustrative example are promising.ey show that the distributed monitoring improves the prevention of temporal disruption and traffic management by performing an early detection.
In our future works, a comparative study based upon several cases should be developed.A comparison with the proposed monitoring architecture and results with the works based on Causal Time Signature (CTS) should also be considered.Likewise, it would be interesting to apply a robust control strategy facing disturbances in railway transport systems in order to compensate the disturbances once they have been detected [21].

Figure 2 :
Figure 2: Travel times between stations belonging to the Sahel railway transport network.

Figure 3 :
Figure 3: P-TPN model for the Sahel railway network.
. is communication between the two sites is generally affected by a communication delay Ω with Ω ∈ [Ω min , Ω max ].In these conditions, the following are known: e global constraint C X,Y e occurrences times of events e x and e k on the site X e communication delay Ω between the two sites X and Y (O(e X ) − O(e Y ) � O(e X ) − O(e k ) + Ω) e question is that is it possible to know if the constraint C Y,X is satisfied (i.e., if the occurrence time O(e Y ) satisfies the C Y,X constraint)?It is possible to reformulate the initial global constraint into a new constraint which is a local constraint, for which it is possible to evaluate the involved durations.O e X  − O e k  + O e k  − O e Y  � Φ + Ω.

Figure 8 :
Figure 8: Distributed monitoring architecture based on chronicles.

Figure 9 :
Figure 9: Travel time from Sousse to Monastir stations.

Table 1 :
Sectors of the railway network between Sousse and

Table 2 :
e values of the static intervals ISi and the expected sojourn time of the token in the place p i .

Table 3 :
Planned and measured times: Sousse to Mahdia direction.