Abstract
Keywords
1. Introduction
In general, the simulation of cyber-physical systems (CPS) requires simulating both continuous dynamics, which evolve smoothly over time, and discrete-event dynamics, where changes occur instantaneously at specific points in time. The
The discrete-event system specification (DEVS) 1 provides a well-defined methodology to model and simulate systems where state changes are driven by events occurring at discrete points in time. It is particularly effective in scenarios where the interactions between subsystems are naturally described as sequences of events, such as embedded systems and communication protocols. DEVS and its extension, parallel DEVS 2 (PDEVS), are widely used for modeling large-scale discrete-event systems. These formalisms not only provide expressive modeling constructs but also specify precise operational semantics. Moreover, many other modeling formalisms can be transformed into DEVS,3,4 positioning it as a unifying framework to integrate different formalisms. This makes DEVS a natural candidate for modeling the cyber components of CPS and for capturing their interactions with the continuous physical dynamics.
The functional mock-up interface (FMI) standard has become the de facto mechanism for enabling co-simulation across tools. Earlier versions of FMI, however, were designed around a continuous-time first perspective, lacking explicit mechanisms for accurate event detection and localization, which limited interoperability with discrete-event formalisms such as PDEVS. Version 3.0 of FMI introduces new features that open opportunities to address this gap. More specifically, it introduces the concept of
However, while the semantics of SCs have been defined,5,6 and an orchestration algorithm has been proposed by Hansen et al.,
7
there
In this paper, we take a first step toward this goal by focusing on the discrete-event side. Our central question is whether FMI 3.0 can be used to faithfully co-simulate PDEVS models when exported as FMUs. This is nontrivial, as PDEVS not only defines a modeling formalism but also precise operational semantics for how coupled models should interact: how internal and external transitions are scheduled, how simultaneous events are handled, and how outputs are routed between components. When PDEVS models are exported as FMUs, these semantics must be preserved; otherwise, the coupled FMUs would no longer reproduce the behavior defined by the PDEVS formalism.
1.1. Contribution and prior work
Our previous work
8
did not extend to coupling multiple DEVS FMUs through the FMI interface. It demonstrated how FMI 3.0 can be used to co-simulate
The present work addresses these limitations by demonstrating how PDEVS models can be faithfully exported and coupled as FMI 3.0 FMUs without violating the semantics of PDEVS. Note that in this paper, we adopt PDEVS instead of “classic” DEVS. PDEVS resolves key limitations of DEVS, most importantly the handling of simultaneous events, which is essential in the context of FMI-based co-simulation. The rationale for this choice is discussed in detail in section Challenges in coupling classic DEVS models.
The contributions of this paper are fourfold:
We derive a
We present an
We present an
We
To foster reproducibility and further research, we also release an
1.2. Structure
The remainder of this paper is organized as follows. Section Background first describes the adaptive cruise control case study that we use as a running example and then introduces the necessary background on FMI 3.0 with SCs as well as the DEVS and PDEVS formalisms. Section Related work positions our work in relation to prior research on integrating DEVS with other formalisms, such as FMI. Section Contribution presents our main contribution: the requirements for preserving PDEVS semantics, the mapping to FMI 3.0 functions, and an orchestration algorithm for PDEVS FMUs. In section Results and discussion, we evaluate the correctness of our approach against a PythonPDEVS reference simulation, interpret the results and highlight broader implications. Section Limitations discusses the main limitations of our approach and outlines potential ways to address them. Finally, section Conclusions and future work summarizes the findings and outlines directions for future work.
2. Background
2.1. Running example
To demonstrate the use of FMI SCs and PDEVS, we consider an example of an adaptive cruise control (ACC) system, adapted from an example provided by the MathWorks.
9
An ACC system is designed to enhance vehicle safety and comfort by automatically adjusting the vehicle’s speed. Unlike conventional cruise control, which maintains a constant speed set by the driver, an ACC dynamically adapts the

Running example of an adaptive cruise controller using SCs. The different clock types are defined in section FMI 3.0—SCs.
The ACC system operates in two primary modes: speed control and distance control. In speed control mode, it maintains a fixed target speed, typically active at higher speeds on highways. In distance control mode, it maintains a safe distance from the
2.1.1. Test scenario
To make the running example more concrete, we define a test scenario. In this scenario, the ego and lead vehicles begin with predefined initial conditions and interact with each other through the ACC system. In the test scenario, the
Figure 2 presents simulation traces for this scenario. As can be seen, the system maintains the ego vehicle’s speed at

Traces obtained using PythonPDEVS 10 for the described test scenario.
2.2. FMI 3.0—SCs
Co-simulation involves integrating multiple simulation tools or models to analyze complex systems collaboratively. 4 To facilitate interoperability between different simulation environments, the FMI standard defines a standardized wrapper for models (with their solvers), referred to as the functional mock-up unit (FMU). 11 These FMUs expose a standardized interface, allowing external tools, known as importers, to integrate and interact with them in a tool-agnostic manner.
Earlier FMI versions primarily supported co-simulation of continuous dynamic systems. However, FMI 3.0 introduces significant enhancements, particularly in the domain of discrete-event simulation. A key addition is the concept of SCs, 12 which enable precise synchronization of events across different FMUs. Here we introduce clocks informally and refer the reader to Gomes et al., 5 and Hansen et al. 13 for more formal treatments. These features are particularly relevant for integrating DEVS models within FMI-based co-simulations.
2.2.1. Motivation for SCs in co-simulation
To illustrate the need for SCs, consider the ACC system in Figure 1. The ACC system can be modeled as a co-simulation of multiple FMUs, each representing a system component such as the controller, supervisor, driver, ego vehicle, or lead vehicle.
This system includes both continuous and discrete dynamics operating at different rates. The ego and lead vehicles exhibit continuous behavior, whereas the supervisor, controller, and driver operate in a discrete manner. The controller and supervisor execute periodic routines (e.g., every 10 ms), though the supervisor may or may not change the controller’s setpoint at each step. Meanwhile, the driver FMU can change its output at arbitrary times. Clocks are used to synchronize the execution of these routines within the different FMUs, for example, ensuring that the controller and supervisor are always in sync.
To co-simulate the above scenario using FMI
Advance simulated time.
Determine the next simulated synchronization time. In the above scenario, it could be current simulated time + 10 ms, or the time when the driver FMU is expected to change its output.
Synchronize all FMUs to this simulated time by calling their
Exchange data between FMUs by calling their
Repeat steps 1–5 until the target simulated time has been reached.
This orchestration poses challenges in synchronizing routines:
2.2.2. SCs and event mode in FMI 3.0
FMI 3.0 introduces SCs to address these synchronization issues. Another key addition in this version is the introduction of event mode, alongside the traditional step mode. Event mode allows FMUs to explicitly handle discrete events, such as input events, time events, and state changes, without advancing simulation time. This ensures that all discrete changes are resolved before proceeding with time stepping, improving synchronization accuracy. In addition, FMUs can now signal early return from a
Co-simulations with SCs follow a structured execution sequence, incorporating step execution in continuous-time mode (similar to traditional co-simulation), event detection, and event handling phases. Before we describe the orchestration algorithm, we first introduce the different types of clocks defined in FMI 3.0:
2.2.3. Orchestration algorithm for FMI 3.0 SCs
Ravi et al. 16 address the challenge of orchestrating simulations for FMI SCs and provided the basis for the orchestration algorithm presented in this paper. The proposed orchestration algorithm divides the simulation process into a repetition of co-simulation steps that incrementally advanced the simulated time until it meets the stopping criteria. Each co-simulation step has three phases: step execution (step mode), event detection, and event handling (event mode), detailed next:
(a) Transition the FMUs to the event mode. (b) Resolve events by:
(i) Iterating on discrete equations and clocked variables while respecting their dependencies. (ii) Propagating clock activation values between connected clocks across FMUs. (iii) Exchange relevant data between FMUs in the event mode. (c) Execute the discrete-event step function for all FMUs in the event mode. (d) Repeat event handling if necessary. (e) Return FMUs to
Thanks to the use of synchronous clocks, the event detection and handling is carried out in a controlled manner and the FMU coroutines (which are run when their outputs are queried) are run synchronously, and numerical inaccuracies are circumvented by having a single source of clock ticking authority at all times.
In the following subsection, we first introduce the DEVS formalism as a foundation for modeling discrete-event systems, and then present its extension, PDEVS.
2.3. DEVS
This subsection provides a brief overview of the relevant aspects of the DEVS using a didactic example of a traffic light system. A more extensive discussion regarding the DEVS concepts can be found in the work by Vangheluwe. 17
The DEVS specification, introduced by Zeigler,
1
is a framework used to model and simulate systems where events occur at specific moments in time. It organizes system behavior into two levels:
2.3.1. Atomic DEVS models
Atomic DEVS models are the basic building blocks that describe how a system behaves over time. They describe the behavior of a discrete-event system as a sequence of deterministic transitions between sequential states, including how it reacts to external input (events) and how it generates output (events). 17 Figure 3 shows an illustration of two such atomic DEVS models, one of a police officer (“Police”), and one of a traffic light (“TrafficLight”).

Illustration of a traffic system model, modeled using DEVS. 8
Formally, an atomic DEVS model can be defined as:
With:
Notes: (1) instantaneous transitions can be modeled using
Note: the
Note: (1) the state
As an example, the atomic DEVS representation of the “TrafficLight” model shown in Figure 3 is given below:
The atomic DEVS representation of the “Police” model is omitted here for brevity.
2.3.2. Coupled DEVS models
These models build on atomic models to represent larger systems made up of interconnected components. They describe a system as a network of coupled components (models), with connections between components denoting how they influence each other. More specifically, through a connection, output events of one component can become input events for another (internal coupling). These components can be atomic DEVS models, but also other coupled DEVS models. As such, DEVS allows for a hierarchical modeling approach. 17 In addition, components can be connected to input/output ports of an encompassing coupled DEVS model (external coupling).
A coupled DEVS model can be defined as follows:
With:
Note: a component (1) cannot influence components outside the coupled model, and (2) cannot influence itself directly.
Note: if not defined, these are typically implicitly assumed to be the identity function. 18
Figure 3 shows an illustration of such a coupled DEVS model (“TrafficSystem”), consisting of two atomic DEVS models of a police officer and a traffic light. In
2.4. Parallel DEVS
PDEVS was presented by Chow and Zeigler
2
as a revision of the “classic” DEVS formalism to better support parallelism. Instead of relying on a
Therefore, an atomic PDEVS model can be defined as follows:
Note the addition of the
And a coupled PDEVS model can be defined as follows:
Note the removal of the
2.4.1. PDEVS abstract simulator
An abstract simulator defines the operational semantics of the formalism. Chow et al. 20 provide the original description of the abstract simulator for PDEVS. A possible implementation of this abstract simulator is given in Algorithms 1–3. For a more extensive description, the reader is referred to the original work.
DEVS: discrete-event system specification; IMM: set of model references for models with imminent transitions; INF: set of model references for influenced models, that is, models with input events.
DEVS: discrete-event system specification; IMM: imminent; INF: influenced.
DEVS: discrete-event system specification.
While Chow et al. described the algorithms in terms of messages being passed between them, highlighting their parallelizability, we instead describe them in terms of (blocking) function calls to more easily relate them to the FMI functions in subsequent discussions.
First, Algorithm 1 presents the simulator for atomic models, while Algorithm 2 presents the orchestrator for coupled models. Note how the functions implemented in the atomic simulator and coupled orchestrator have similar signatures. This allows the simulation to be constructed hierarchically, that is, components of the coupled model can again be coupled models with their own orchestrators. Algorithm 3 presents the root-level orchestrator to run the simulation by interacting with the topmost coupled model’s orchestrator.
The presented algorithms use the following variables:
2.5. Comparison between FMI SCs and (P)DEVS
Previous works8,13 have highlighted the similarities and differences between the two formalisms. Both FMI SCs and (P)DEVS are designed to handle discrete events in simulation, emphasizing event-based synchronization to ensure consistent interactions across components. While FMI SCs standardizes co-simulation interfaces to integrate diverse models, (P)DEVS focuses on system representation and structured state transitions. Event handling in FMI SCs relies on input and output clocks activated at predefined intervals or by external triggers, whereas (P)DEVS uses internal and external event transitions to manage system state changes. (P)DEVS inherently supports hierarchical modeling through coupled models, whereas FMI SCs enables modular co-simulation by integrating multiple FMUs, though composing FMUs into coupled FMUs requires additional orchestration which has not been done for FMI SCs. FMI SCs is also optimized for real-time and co-simulation scenarios, coordinating events across FMUs through synchronous clocks. While (P)DEVS is grounded in a strict mathematical formalism, FMI SCs lacks formal semantics and instead relies on external orchestration mechanisms.
2.6. PDEVS models of the running example
In the running example of Figure 1, the whole adaptive cruise control scenario can be modeled as a coupled PDEVS model, with the controller, supervisor, drivers, and both vehicles as component models. The vehicles periodically change their state (discretizing their continuous dynamics), generating output events with their updated position (
An overview of the PDEVS implementation of the ACC example is given below. To keep the main text concise, the formal description of the atomic and coupled PDEVS models is provided in Appendix 1: Formal Specification of the ACC Models, Definitions 1 to 8. The PythonPDEVS implementation of these models is also available on GitHub: https://github.com/Cosys-Lab/2025-SIMULATION-DEVS-FMI3.0
The ACC system can be modeled in PDEVS as a coupled model (Definition 8) composed of the following components:
Coupled PDEVS model representing the ego vehicle
○ Vehicle (Atomic) - Definition 1
○ Implements a simple kinematic vehicle model
○ Generator (Atomic) - Definition 2
○ Used to periodically trigger the kinematic vehicle model to update its state
Coupled PDEVS model representing the lead vehicle
○ Vehicle (Atomic) - Definition 1
○ Implements a simple kinematic vehicle model
○ Generator (Atomic) - Definition 2
○ Used to periodically trigger the vehicle model to update its state
○ Sine (Atomic) - Definition 3
○ Signal generator (sine wave), represents the driver by periodically updating the wanted acceleration for the vehicle model
Atomic PDEVS model implementing a basic speed controller (cruise control), periodically updates the (wanted) acceleration of the ego car.
Atomic PDEVS model implementing the “adaptive” aspect of the cruise control model by periodically updating the speed setpoint for the speed controller to either (1) maintain a safe distance to the lead vehicle, or (2) to obey the speed limit.
Periodically triggers the controller to update its output (cfr. time-triggered clock in Figure 1).
Periodically triggers the supervisor to update its output (cfr. time-triggered clock in Figure 1).
Note that the ACC system model is constructed hierarchically, that is, it contains both atomic PDEVS models and other coupled PDEVS models. It’s also these components (Ego Vehicle, Lead Vehicle, Controller, Supervisor, Controller Generator, Supervisor Generator) that are exported as FMUs. As such, this allows us to validate our approach for both types of PDEVS models.
3. Related work
There has been much work on integrating DEVS with other formalisms, such as FMI, to enable coupling these two formalisms. At the foundational level, we highlight the work of Vangheluwe et al. 21 where the multiple ways to integrate formalisms are presented, including transformation to a single formalism, semantic adaptation, and co-simulation. Examples of formalism transformation are given in the cited paper, and an example semantic adaptation is given by Mustafiz et al. 22 and with a focus on FMI by Gomes et al. 23 We focus on the co-simulation approach, where the two formalisms are kept separate, and the co-simulation is orchestrated by an external tool. We classify related works into three categories: (1) integrating FMI into DEVS (wrapping FMUs as DEVS), (2) integrating DEVS into FMI (wrapping DEVS as FMUs), and (3) applications leveraging DEVS–FMI integration.
In terms of wrapping FMU as DEVS models, we highlight the work of Camus et al. 24 where they present a hybrid co-simulation approach where FMUs are wrapped to integrate them with DEVS in the MECSYCO middleware. A case study on a barrel-filling system demonstrates the framework’s capability to manage event synchronization and numerical resolution, ensuring accurate and scalable co-simulation. The work of Quraishi et al. 25 explores co-simulation of hardware described at the register-transfer level (RTL) and software using the FMI standard. A DEVS-FMI interface integrates DEVS-Suite for RTL models and MATLAB for software models, enabling modular co-simulation of hardware-software interactions. The approach is validated using a network-on-chip (NoC) system, demonstrating its ability to simulate hybrid systems efficiently and handle disparate simulation environments. Lin 26 introduces a DEVS-FMI adapter for integrating DEVS-Suite and FMUs, enabling co-simulation of discrete and continuous models. Using a four-variable model framework, the paper evaluates a case study of an electric scooter, demonstrating the adapter’s ability to synchronize cyber and physical systems. The work highlights challenges, such as step size effects, and proposes a hybrid co-simulation strategy for CPS design and validation. In addition, the paper by Joshi et al. 27 introduces a method to integrate FMUs into the DEVS-based cadmium simulator by wrapping FMUs as DEVS atomic models. The integration leverages a quantized state system (QSS) solver to simulate continuous-time behavior efficiently, replacing traditional time discretization with state quantization.
With a focus on integrating DEVS models within FMI, we previously introduced a co-simulation framework for evaluating multicore embedded platforms in cyber-physical systems. 28 This previous approach integrates DEVS models of multicore platforms with plant and application models using the FMI standard to enable early design-stage evaluations of temporal and functional behavior. However, this previous approach made use of version 2.0 of FMI, which lacked support for discrete-event simulation. To work around these limitations, the previous approach required the DEVS models to be included as part of the FMI orchestration algorithm itself, rather than as FMUs. Therefore, the orchestration algorithm was not generic. More recently, we presented an approach using FMI 3.0. This approach makes use of, among others, the event mode and synchronous clocks introduced in FMI 3.0 to wrap DEVS models in FMUs and to co-simulate them with plant and application models. However, this previous work did not explicitly support the co-simulation of multiple DEVS FMUs. The feasibility of coupling multiple DEVS models through FMI without breaking the DEVS formalism remained an open question, now answered in the current manuscript.
4. Contribution
To enable the integration of PDEVS models in FMUs and their coupling through FMI, we need to make semantic adaptations between PDEVS and FMI. These adaptations require addressing several key aspects, including handling internal transitions, communicating input and output events, and ensuring that PDEVS models encapsulated in different FMUs can be coupled without violating the PDEVS formalism.
First, in section Requirements, we define the general requirements that
Then, we detail our approach to adapting the semantics of PDEVS to FMI. Specifically, we focus on three main aspects. We describe how the FMI importer can be made aware of internal transitions in PDEVS models, how input and output events can be communicated using the standard FMI interface, and how PDEVS models encapsulated in separate FMUs can be coupled while preserving the PDEVS formalism.
The following subsections elaborate on these aspects and provide the motivations and considerations behind our chosen approach and its relation to the predefined requirements. Sections Signaling imminent internal transitions and Communicating input/output events provide a static view of the first two aspects, while coupling DEVS FMUs presents a dynamic view of the last.
4.1. Requirements
Based on the abstract simulator (Algorithms 1–3), we identify requirements that a simulator must meet—including the overall flow it must follow—to correctly simulate PDEVS models. The simulator:
Regarding the mapping to FMI, these requirements determine (1) the overall flow an FMI orchestration algorithm must follow, and (2) the functions that need to be implemented in PDEVS FMUs, to ensure a correct coupling of PDEVS models through FMI. Overall, the FMI orchestration algorithm must impose the same flow as Algorithms 2 and 3 to ensure it satisfies requirement
4.2. Signaling imminent internal transitions
To ensure proper event handling, an FMI importer must transition the relevant FMUs into event mode when necessary. This requires the importer to be aware of, and keep track of, imminent events. In the context of PDEVS models, these imminent events correspond to imminent internal transitions. As such, this aligns with requirements
To signal these imminent internal transitions, we use a subtype of FMI 3.0 time-based clock called the
Definition of the aperiodic countdown clock and input/output clocks with associated clocked variables for the lead vehicle model.
In addition, the importer is responsible for instructing the relevant clocks
Rationale: An alternative mechanism provided in FMI 3.0 that could be used to signal imminent internal transitions is the ability for an FMU to signal the early return from an
However, there are some major drawbacks to that approach. First, the importer needs to explicitly support early return. As such, relying on this mechanism would likely limit in which tools these PDEVS FMUs could be used. Second, in the case the importer does support early return, an FMU signaling such an early return might mean that the importer needs to roll back the state of other FMUs which did fully advance their internal time, such that they may be advanced instead to the
To avoid the mentioned drawbacks of relying on the early return mechanism, we opt for the
4.3. Communicating input/output events
As mentioned in section DEVS, (P)DEVS models can generate output events on internal transitions, and can transition between states in response to input events (external transitions). To enable the coupling of PDEVS FMUs through FMI, we need to be able to communicate the occurrence of these events using some interface defined in the FMI standard (
Version 3.0 of the FMI standard introduces
In the current work, we adopt this concept of clocks and clocked variables to model input/output ports of PDEVS models. For each input/output

Conceptual illustration of the open-loop variant represented using PDEVS FMUs.
In addition, as outputs may be generated on imminent internal transitions, as signaled using the “ta”
An example of this can be seen in Listing 1, which shows an excerpt of the model description for the ego vehicle model. The PDEVS model of the ego vehicle (Definition 6) has an input port “update_a_wanted” and an output port “vehicle_state.” As such, the listing shows a triggered input clock “update_a_wanted” (line 3), and a triggered output clock “vehicle_state” (line 8). It also shows two clocked variables, “update_a_wanted_data” and “vehicle_state_data” (lines 4, 9), with a “clocks” attribute linking them to their associated clocks. These values are computed and queried, while their corresponding clocks are active. (Recall Section Orchestration Algorithm for FMI 3.0 Synchronous Clocks.) In addition, Line 14 shows the dependency between the output clock “vehicle_state,” and the “ta” clock.
Note that in our current implementation of the presented approach, events are serialized to
Rationale: This approach addresses limitations of our previous work,
8
where we relied solely on triggered input/output
4.4. Coupling DEVS FMUs
In previous work, 8 we showed how we could use a single DEVS FMU to trigger other (non-DEVS) FMUs to simulate the behavior of a cyber-physical system. However, one major question that remained unanswered was whether multiple DEVS FMUs could be co-simulated (coupled) using FMI without violating the DEVS formalism. In this section, we address this question.
First, we describe the difficulties of coupling “classic” DEVS models, as used in our previous work, 8 using FMI, and motivate a switch to PDEVS in the current work. Then, we outline an approach to integrate PDEVS in FMUs which satisfies the requirements defined in section Requirements. Finally, we present an example orchestration algorithm, based on one proposed by Ravi et al., 16 which further satisfied these requirements.
4.4.1. Challenges in coupling classic DEVS models
One major point of attention in coupling DEVS models in general is that due to the coupling of multiple concurrent components (models), multiple state transitions can happen at the same point in time. In sequential simulation systems, such transition collisions are resolved by means of some form of selection of which of the components’ transitions should be handled first. This corresponds to the introduction of priorities in some simulation languages. 17
In classic DEVS, coupled models explicitly include a
Given these challenges, a more effective approach is to adopt PDEVS. PDEVS eliminates the need for a
Rationale: As mentioned, in “classic” DEVS, coupled models incorporate a
For simple cases in which there are no loops, such as the traffic system (Figure 3), or indeed the open-loop scenario in Figure 1, it
In any case, for more complex cases, such as the closed-loop scenario in Figure 1, a different approach is needed. One option here would be to include the select function, or a version thereof, as part of the orchestration itself. However, this approach has drawbacks. First, it results in a DEVS-specific orchestration algorithm. Not only that, as the select function can be specific to a given coupling, this can even result in a simulation-specific orchestration algorithm. As such, such an approach would severely limit the possibility of using DEVS FMUs in different co-simulation setups.
Another option could be to wrap the select function itself as a separate “coordinating” FMU, which could then coordinate the component DEVS FMUs using triggered clocks. However, this approach also has its drawbacks. The coordinating FMU would generally require certain information from the different DEVS FMUs, including their current state, time remaining, etc. This concept is illustrated in Figure 5. This information would need to be communicated using FMI, which would complicate the cosimulation setup. Moreover, as the select function can be specific to a given coupling, modifications to the coupled model or the select function would likely require the coordinating FMU to be re-generated and could require extensive modifications to the co-simulation setup (connections), for example, when different component models are added or removed.

Illustration of the coordinating FMU concept for “classic” DEVS.
To avoid these drawbacks, we instead propose to switch to PDEVS over classic DEVS. PDEVS does away with the select function and introduces other changes to the DEVS formalism to explicitly handle the occurrence of concurrent events/transitions.
4.4.2. Implementation outline
The following outlines an implementation of “PDEVS FMUs” and their coupling using standard FMI 3.0 functions satisfying the requirements defined in section Requirements, with relevant parts also represented in a sequence diagram (Figure 6):

Sequence diagram of the implementation outline.
Note: (1) the
4.4.3. Orchestration algorithm
Algorithm 4 shows an example algorithm to orchestrate the co-simulation of DEVS FMUs. Note that while this orchestration algorithm is somewhat simplified for this use case, that is, it contains the bare minimum handling for the continuous-time part, it contains no special “PDEVS-specific” constructs, that is, the discrete-event handling is as generic as possible. Indeed, our orchestration algorithm is based on the one presented by Ravi et al. 16 and overall matches their version closely.
FMI: functional mock-up interface.
The relations of different parts of the orchestration algorithm to the requirements are mostly indicated using comments in the pseudocode. Some important parts not fully covered in the outline (section Implementation outline) are as follows:
The importer keeps track of when time-based clocks, such as the “ta” clocks, need to tick. The selection of the next event time is handled by the orchestration algorithm using the function
As previously mentioned, connections between FMUs are defined using external relations, which are used by the orchestration algorithm when communicating outputs to inputs. This can be seen in the orchestration algorithm on Lines 32, where
In general, the orchestration algorithm must preserve the overall flow imposed by the abstract simulator (
As described in section Implementation outline, a call to activate the “ta” clock triggers a call to the
This requirement is satisfied by the
As described in section Implementation outline, we use the function
5. Results and discussion
A prototype implementation was made to validate the presented approach using the adaptive cruise control use case presented in section Running example. First, section Implementation details our implementation. After this, in Validation, we present the results of our validation efforts. Our prototype implementation and all code required to reproduce the presented results are available on GitHub: https://github.com/Cosys-Lab/2025-SIMULATION-DEVS-FMI3.0
5.1. Implementation
Figure 7 shows an overview of our implementation. The different parts are detailed below. From left to right:

Overview of the implementation.
5.1.1. Importer
We implemented an example FMI importer to demonstrate the presented approach. It provides functionality for importing FMUs and defining external relationships (connections) between ports of those FMUs, provides logging capabilities, and implements the presented Overview of the implementation. (Algorithm 4) to run the co-simulation. Hence, it implements the “
5.1.2. PDEVS FMU
The PDEVS FMUs were largely implemented in Python by using UniFMU 31 and its Python backend. UniFMU is a tool that facilitates the implementation of FMI-compatible FMUs in programming languages that cannot (easily) produce C-compatible binaries. It achieves this by providing generic binaries that implement the standard FMI functions. These binaries can forward the FMI function calls to several supported language-specific backends, where the user can implement their required functionality. Overall, the FMUs consist of three main parts: an FMI wrapper, a PDEVS wrapper, and the PDEVS model itself.
5.1.3. FMI wrapper
The FMI wrapper is implemented in the UniFMU Python backend. It provides the translation between the standard FMI functions (
5.1.4. PDEVS wrapper
The PDEVS wrapper (Python) implements the functions used to interact with the PDEVS models. Depending on the type of the PDEVS model being wrapped, that is, atomic or coupled, it acts as, respectively, a simulator (Algorithm 1) or an orchestrator (Algorithm 2). This enables a more generic implementation of the PFMI wrapper that can handle both atomic and coupled models.
In the case of a coupled model being wrapped, the model hierarchy is first flattened using the direct connection technique. 32 This technique transforms any hierarchically constructed coupled model into an equivalent flat coupled model with only directly connected atomic models, without changing the behavior of the coupled model. This is not strictly necessary, but simplifies the implementation as it negates the need to implement a full hierarchical simulator in the PDEVS wrapper. In our implementation, this step is carried out using the implementation of this technique provided by PythonPDEVS. 10
5.1.5. PDEVS model
This is the PDEVS model being wrapped. As such, this constitutes the “
5.1.6. Exporter
To automate the process of creating the FMUs from PDEVS models, we implemented a prototype exporter. The exporter is implemented in Python and allows PythonPDEVS models to be exported to FMUs using a single function call. In addition, the exporter provides functionality to easily set up a co-simulation equivalent of a coupled model. Meaning, from a coupled model, the exporter can generate a folder containing an FMU for each component of that model, together with a JSON file describing the coupling of those components.
5.1.7. PDEVS model
This is the PDEVS model being wrapped, and is the same as the
5.2. Validation
To validate our approach, we use our prototype exporter to generate FMUs for the different components of the ACC system model (i.e., Ego Vehicle, Lead Vehicle, Controller, Supervisor, Controller Generator, Supervisor Generator) described in PDEVS models of the running example. We then use our example importer to set up and run a co-simulation using the generated PDEVS FMUs. We then compare the co-simulation with the PythonPDEVS simulation in two ways.
First, we
Second, we directly compare the
Rationale: The reason for comparing behavior (logs) at the level of atomic models is that events in coupled models can occur in parallel. However, these parallel events are recorded sequentially in the logs. This means that logs for coupled models can have multiple valid orderings. As a result, comparing logs at the level of coupled models becomes more complex because differences in ordering may not necessarily indicate issues in the co-simulation. The behavior of atomic models, however, is inherently sequential. Therefore, our reasoning is that issues with the orchestration will likely be visible as differences in the logs.
5.3. Discussion
First, the results of comparing the values of the communicated events are shown in Table 1. This table shows an analysis of the differences between the (FMI) co-simulation and the PythonPDEVS simulation. For each relevant component of the ACC system model, it shows the mean absolute error, and the mean and standard deviation of the error for different values in the communicated events (for 801 samples each). In addition, it shows this same analysis for the difference in the time at which events occur in both simulations. From the results, it is clear that the simulation results do not match exactly. However, the differences between the two simulations are small, with the biggest differences being on the order of
Analysis of the differences in values communicated in events between our approach and PythonPDEVS.
Second, we use the logs to directly compare the behavior of each atomic PDEVS model, as described in section Validation. However, We need to take into account the previously observed numerical differences when comparing the logs. As such, we add an absolute tolerance of
Excerpt of the ego vehicle log, with PythonPDEVS.
Excerpt of the ego vehicle log, using our approach.
In both excerpts, the following behavior can be observed: First, at time
Comparing both excerpts, it can be observed how the behavior is equivalent between both approaches. Meaning, the same events occur at (nearly) the same points in time, in (exactly) the same order, with (nearly) the same input/output messages. However, the numerical differences between both approaches is also apparent. It can be observed how the timestamps do not match exactly between both approaches (lines 4, 17, and 28). As the vehicle state (position, velocity, and acceleration) is dependent on the elapsed time, this also results in small differences in the “vehicle_state” message (lines 19–21).
When comparing the full logs for all atomic DPEVS models, we find that they are all equivalent between the two approaches. Therefore, the behavior of the atomic models matches in our approach when compared to an established PDEVS simulator, that is, PythonPDEVS.
While these results confirm that FMI 3.0 can indeed preserve PDEVS semantics for the presented case study, some practical limitations remain. These are discussed in the following section.
6. Limitations
Although the presented results demonstrate that our approach can preserve PDEVS semantics in FMI 3.0 co-simulations, some limitations remain that may affect applicability in broader settings. In this section, we discuss these and outline potential strategies to address them where possible.
6.1. Coupling restrictions
6.1.1. Many-to-many coupling
The current version of the FMI standard only allows a one-to-many structure when connecting inputs and outputs of FMUs. However, PDEVS is more flexible as it allows for many-to-many couplings, where multiple component models can influence each other. Therefore, the use of FMI for co-simulating PDEVS FMUs restricts the allowed couplings. While this restriction does not break correctness for simple examples, it does limit the applicability of the presented approach for more complex co-simulations.
Possible workarounds include the introduction of additional “aggregator FMUs,” which could collect events on multiple inputs, combine them, and then forward them to one or more other FMUs using a single output. Alternatively, further semantic adaptation could be performed to achieve a similar effect. More specifically, a PDEVS FMU could be again wrapped into an FMU with multiple inputs, whereby the parent wrapper could perform the aggregation function for the enclosed PDEVS FMU. Similar approaches are described by Gomes et al. 23 to extend FMUs with functionality such as input interpolation.
However, both approaches have similar drawbacks. They add modeling overhead and their concrete implementation (e.g., number of supported inputs, aggregation logic) would depend heavily on the specific co-simulation setup in which they are used, making them application-specific, limiting reuse, and increasing maintenance effort when the co-simulation setup changes.
6.1.2. Translation functions
Coupled PDEVS models can include a set of translation functions ({
As these translation functions are defined at the level of the coupled models, these also need to be considered at the level of the co-simulation. The FMI standard itself has no specific provisions for adapting incompatible signals. As with the many-to-many coupling, such functionality could be introduced through additional semantic adaptation. Gomes et al. 23 describe such an approach to introduce unit conversions between FMUs to solve signal data mismatches. While this would restore flexibility, it again comes at the cost of additional modeling overhead and limited reuse.
6.2. Hierarchical modeling
A core strength of the PDEVS formalism is its support for hierarchical modeling, where coupled models can contain both atomic models and other coupled models. This allows large systems to be organized into nested coupled models, improving modularity and maintainability. However, FMI co-simulation is inherently flat as FMUs are coordinated by a central orchestration algorithm without an explicit notion of hierarchy. As such, once PDEVS models are wrapped into FMUs, this hierarchical modeling capability is lost.
This loss of hierarchical modeling capability when using FMI has practical drawbacks to modelers. Particularly, it makes maintaining, modifying, and debugging models more difficult as the structure of the modeled system is not easily visible in the co-simulation. However, existing PDEVS debugging approaches 33 may provide useful support in this regard.
A potential strategy to reintroduce hierarchical modeling is to adopt a hierarchical co-simulation technique, as described by Gomes et al. 23 and supported in the FMPy 30 tool. In their approach, a set of coupled “internal” FMUs is wrapped into a higher-level “external” FMU, such that the entire assembly behaves as a standard FMU from the perspective of the orchestration algorithm. While this reintroduces hierarchical modeling in an FMI-based co-simulation, it again requires additional modeling effort and increases implementation complexity.
6.3. Numerical precision and time-keeping
Another limitation concerns numerical precision and how it affects time-keeping and simulation results. In FMI co-simulations, time and step sizes are communicated using floating-point numbers. As in most simulation setups, this can introduce small rounding errors, which can accumulate over time if not managed carefully. In our results, we also observed such discrepancies when comparing our FMI-based approach to PythonPDEVS. While these discrepancies were small and did not meaningfully affect the simulated behavior of the system, they do complicate strict reproducibility across different simulation tools.
It is important to note that these difficulties are not unique to our approach, or FMI in general, but affect most simulators that rely on floating-point arithmetic. In fact, FMI includes different mechanisms to detect and mitigate the potential of time-drift or mismatched time between FMUs. First, the
Together, these mechanisms help to manage time-drift and resulting numerical discrepancies. However, it should be noted that perfect reproducibility across different simulators is difficult to guarantee in any floating-point-based environment.
6.4. Continuous dynamics and hybrid simulations
In the current paper, we focused exclusively on discrete-event models. While we demonstrated that FMI 3.0 can preserve PDEVS semantics, we have not yet considered hybrid settings that combine PDEVS FMUs with continuous-time FMUs. This is a limitation as many practical applications, such as the simulation of cyber-physical systems, require the co-simulation of both continuous dynamics and discrete-event-driven components.
In such a hybrid setting, the events produced by the PDEVS FMUs must be correctly deserialized and interpreted by continuous FMUs, while state changes in continuous FMUs must be translated into events the PDEVs FMUs can understand. While FMI 3.0 provides mechanisms such as synchronous clocks and event mode to support such interoperability, these do not by themselves solve this communication.
One way to provide a bridge between continuous and discrete-event components is to introduce explicit interface models. Jiresal and Wainer 35 formalized cyber-physical system interfaces in DEVS using dedicated sensor and actuator models. In their work, the sensor models translate physical sensor signals into discrete events that their DEVS models can process, while actuator models translate events into physical signals. A similar approach could be taken in FMI-based co-simulations, where interface FMUs would take on the role of translating between continuous signals and PDEVS events. Such constructs could provide a structured way to bridge PDEVS and continuous-time FMUs, though at the cost of additional modeling effort.
6.5. Use of PDEVS over DEVS
A possible limitation of our approach is that it relies on PDEVS rather than the original DEVS formalism. This choice was necessary because PDEVS solves fundamental challenges in coupling models, in particular, it avoids reliance on a global select function to resolve simultaneous events. This proved essential to correctly couple models using FMI 3.0 without relying on a DEVS-specific orchestration algorithm or other model-specific coordination mechanisms.
In practice, the impact of this choice is limited. Many existing models are already defined in PDEVS, requiring no additional effort. For models defined in classic DEVS, migration to PDEVS should be straightforward, as PDEVS is a conservative extension of DEVS. The actual cost–benefit trade-off will depend on the specific scenario, but in cases where FMI-based co-simulation is needed, the additional effort of migration is generally manageable relative to the advantages offered by this approach.
Together, the identified limitations define the boundaries of the presented contribution. They emphasize both the assumptions under which PDEVS semantics can be preserved in FMI 3.0 and the challenges that remain for broader applicability. The demonstrated preservation of PDEVS semantics confirms the feasibility of the approach, while the identified challenges highlight promising directions for extending it. The next section summarizes our contributions and outlines directions for future research.
7. Conclusions and future work
It is worth stressing the importance of bridging these two formalisms. As shown by Vangheluwe, 3 many hybrid and discrete formalisms can be transformed into DEVS. By enabling the coupling of DEVS models using FMI 3.0, we open up new possibilities for hybrid system simulation, allowing for broader interoperability and more flexible co-simulation setups across different modeling paradigms.
A more significant limitation, as previously mentioned, is that FMI cannot fully preserve the coupling semantics of PDEVS models in all cases. Specifically, FMI only supports “one-to-many” connections, whereas PDEVS allows “many-to-many” coupling. This restriction impacts the correct propagation of simultaneous events across interconnected FMUs in specific scenarios. In addition, in adapting PDEVS models into FMUs, we lose PDEVS’ ability for hierarchical composition of models, and floating-point time communication can introduce small discrepancies that complicate strict reproducibility. Finally, our contribution has so far only addressed discrete-event models, leaving open the question of how PDEVS FMUs can be co-simulated with continuous-time FMUs. Together, these limitations define the boundaries of the presented approach, but the demonstrated preservation of PDEVS semantics confirms its feasibility and motivates further extension.
Most importantly, we intend to explore the integration of PDEVS FMUs with continuous-time FMUs to enable hybrid system simulation, such as the cyber-physical systems application shown in previous work. 8 This will require addressing the event serialization to allow interoperability with non-DEVS FMUs, potentially through structured interface models such as sensors and actuators that translate between discrete events and continuous signals. 35
Finally, we plan to evaluate the computational overhead introduced by coupling DEVS models through FMI. Using benchmarks such as DEVStone, 36 we will assess performance trade-offs and scalability of the approach.
