Model-based development is a widely-used method to describe complex systems that enables the rapid prototyping. Advances in the science of distributed systems has led to the development of large scale statechart models which are distributed among multiple locations. Taking medicine for example, models of best-practice guidelines during rural ambulance transport are distributed across hospital settings from a rural hospital, to an ambulance, to a central tertiary hospital. Unfortunately, these medical models require continuous and real-time communication across individual medical models in physically distributed treatment locations which provides vital assistance to the clinicians and physicians. This makes it necessary to offer methods for model-driven communication and synchronization in a distributed environment. In this paper, we describe ModelSink, a middleware to address the problem of communication and synchronization of heterogeneous distributed models. Being motivated by the synchronization requirements during emergency ambulance transport, we use medical best-practice models as a case study to illustrate the notion of distributed models. Through ModelSink, we achieve an efficient communication architecture, open-loop-safe protocol, and queuing and mapping mechanisms compliant with the semantics of statechart-based model-driven development. We evaluated the performance of ModelSink on distributed sets of medical models that we have developed to assess how ModelSink performs in various loads. Our work is intended to assist clinicians, EMT, and medical staff to prevent unintended deviations from medical best practices, and overcome connectivity and coordination challenges that exist in a distributed hospital network. Our practice suggests that there are in fact additional potential domains beyond medicine where our middleware can provide needed utility.
Ptolemy is an environment for simulation and prototyping of heterogeneous systems. It uses modern object-oriented software technology (C++) to model each subsystem in a natural and efficient manner, and to integrate these subsystems into a whole. Ptolemy encompasses practically all aspects of designing signal processing and communications systems, ranging from algorithms and communication strategies, simulation, hardware and software design, parallel computing, and generating real-time prototypes. To accommodate this breadth, Ptoloemy must support a plethora of widely differing design styles. The core of Ptolemy is a set of object-oriented class definitions that makes a few assumptions about the system to be modeled; rather, standard interfaces are provided for generic objects and more specialized, application-specific objects are derived from these. A basic abstraction in Ptolemy is the Domain, which realizes a computational model appropriate for a particular type of subsystem. Current examples of domains include synchronous and dynamic dataflow, discrete-event, and others appropriate for control software and embedded microcontrollers. Domains can be mixed as appropriate to realize and overall system simulation. Some current applications of Ptolemy include networking and transport, call-processing and signaling software, embedded microcontrollers, signal processing (including implementation in real-time), scheduling of parallel digital signal processors, board-level hardware timing simulation, and combinations of these. The use of formal models of computation in dealing with increasing complexity of embedded systems design is gaining attention. A successful model of computation must be able to handle both control-dominated and data-dominated behaviors, which are most often simultaneously present in complex embedded systems. Besides behavioral heterogeneity, direct support for modeling distributed systems is also desirable, since an increasing number of embedded systems belong to this category. In this paper, we present distributed DFCharts (DDFCharts), a language based on a formal model that targets distributed heterogeneous embedded systems. Its top hierarchical level is made suitable to capture distributed systems. Behavioral heterogeneity is addressed by composing finite-state machines (FSMs) and synchronous dataflow graphs (SDFGs). We illustrate modeling in DDFCharts with practical examples and describe its implementation on heterogeneous target architecture. 