## Appendix D Introduction to Discrete Event System Specification (DEVS)
In addition, an external event may occur on the input ports of a model component at the same time as triggering the internal transition. There is thus conflict and the taking into account of this conflict must be described in an algorithm under the control of the modeler. The conceptual limits implied by this competition are detailed in [50]. The PDEVS formalism [51] has been proposed to overcome them. The PDEVS (Parallel Discrete EVent System Specification) formalism is an extension of the DEVS formalism. It is completed with a function (\(\delta\)_con_) whose objective is to allow the modeler to manage conflicts occurring between internal and external events (\(\delta\)_int_, and \(\delta\)_ext_ functions). PDEVS also includes a mechanism (bag-type data structure, Xb) to handle simultaneous input events. This new set allows collecting events emitted at the same time. Thus, PDEVS formalism, allows expressing several external events on the same date. These events are collected and stored in sets of events occurring at the same time. The outputs made by the \"imminent models\", that is to say the conflicting models at a given instant for which an internal transition is provided at the same time are stored in a subset of entries noted Xb. Each of the events of the set Xb is identified by its time of occurrence. No order relationship is recommended for events belonging to the same set. It is thus possible to authorize and count the simultaneous events on each input port X. Taking account of the events of the set is only allowed after the internal transitions of all the imminent models. As a result, external transitions are realized by sets representing the aggregated response of simultaneous events. The atomic model \(\mathit{PDEVS}\)\(M\) is described by a tuple:  
\[\mathit{PDEVS}\)\(M=\)\(<\)\(X\), \(Y\), \(S\), \(ta\), \(\delta_{\mathit{can}}\), \(\delta_{\mathit{int}}\), \(\delta_{\mathit{ext}}\), \(\lambda\)\(>\)  
where:  
* \(X\) is the set of input ports and input values,
* \(Y\) is the set of output ports and output values,
* \(S\) is the set of partial states of the system,
* \(ta\): is the function of advancing time,
* \(\delta\)_int_: is the internal transition function,
* \(\delta\)_ext_: is the external transition function where Xb is the set of input bags belonging to X, Q is the set of total states, Q = {((s,e) | s in S, 0 \(\leq e\leq ta\) (s)}\), where \(e\) is the elapsed time since the last transition to state, s
* \(\delta\)_con_: the confluent function,
* \(\lambda\): the output function In the same way as for the classic version of DEVS, in the absence of events on the input ports, the model retains a passive state until the next event triggering the internal transition (\(\delta\)_int_). An output is then generated by the output function (\(\lambda\)), followed by the execution of the internal transition function (\(\delta\)_int_). If an external event occurs on one of the input ports before the scheduled time for the internal transition, the system state changes to \(\delta\)_ext_ (\(s\), \(e\), xb). Unlike a classical DEVS approach, the external transition recalculates the s state from the event sets Xb) from one or more PDEVS models. If an input event occurs at \(e\) = \(ta\) (s), the simulator calls the function \(\delta\)_con_(\(s\), \(e\), xb). The behavioral algorithm of the confluence function \(\delta\)_con_ must be implemented by the modeler. By default \(\delta\)_con_ = \(\delta\)_ext_(\(\delta\)int_ (\(s\), \(e\)), 0, xb)), thus giving priority to the internal transition during a conflict in a PDEVS model. At the simulation level, one of the important properties of the DEVS formalism is that it automatically provides a simulator for each of the models. The DEVS formalism makesan explicit distinction between modeling and the simulation algorithms that enable any DEVS model to be simulated without the need to implement a specific simulator. This is the notion of abstract simulator.