<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Towards a Metamodel for Modular Simulation Environments</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Sandro Koch</string-name>
          <email>sandro.koch@kit.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Frederik Reiche</string-name>
          <email>frederik.reiche@kit.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Robert Heinrich</string-name>
          <email>robert.heinrich@kit.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Chair for Software Design and Quality Karlsruhe Institute of Technology</institution>
          ,
          <addr-line>76131 Karlsruhe</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Long-living systems often cope with fast-changing trends in the current market. Changes originating from new features or bug xes can create great e ort. Therefore, it is desirable to know the impact of the changes on quality aspects of a system beforehand. Simulating the system allows estimating the impact of a change without the time and cost investment of an actual implementation. Nevertheless, the code quality of simulations is often neglected. This results in increased development cycles for the simulation until the cycle time is no longer sustainable. Therefore, we propose using a metamodel to describe modular simulations. This will allow reusing simulations and because of the modularity, the simulations will be composable. Consequently, it will also reduce maintenance and development e orts because simulations can be smaller designed and reused. Smaller means that a simulation could serve only one purpose. In this paper, we propose an excerpt of our metamodel with the focus on coupling and interoperability of simulations.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        In software engineering designing and running long-living systems is a hot topic.
Software is getting older. Distinct releases with long development cycles are
disappearing. Instead, short development cycles and incremental releases are
advancing. Companies like Microsoft (O ce365) or Adobe (CreativeCloud) use
subscription models for their software portfolio. Therefore, maintenance and
implementing new features while not breaking the code are getting more
important. To achieve short development cycles without breaking the software
system, the impact of these changes should be known beforehand. A simulation
allows analyzing impacts to a software system without actually implementing
these changes [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. As Tolk et al. [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] remark, simulations reduce development
time and thus costs. Consequently, simulations are a key tool to develop and
maintain software systems. However, developing simulations does not emphasize
reusing or maintaining the simulation itself. Simulations are mainly developed
ad-hoc. As a result, maintaining a simulation alongside the main system will
increase the duration of development cycles and thus, the time to market of
the software. We intend to improve the development of simulations by using
a metamodel. Therefore, we have analyzed existing approaches in simulation
modeling, and simulation coupling and interoperability. Challenges to consider
when modularizing simulations are described in our previous work [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. In this
paper, we want to introduce the current state of our metamodel while presenting
excerpts of the metamodel. The paper is organized as follows. A motivating
example is introduced in Sec. 2. State of the art is described in Sec. 3. Sec. 4
gives an overview of the developed metamodel. The paper concludes in Sec. 5.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Motivating Example</title>
      <p>As a motivational example, we will introduce two independent simulations. One
simulation analyzes a public transport system with bus stops and buses. Each
bus has a xed number of seats and is part of a bus line. A bus line consists
of a number of bus stops. These bus stops must be visited in a given order.
Furthermore, people waiting at a bus stop will enter a bus if not all seats are
occupied. If all seats of a bus are occupied, the remaining people will wait for
the next bus to arrive. The second simulation simulates a person's daily routine.
However, the routine is simpli ed and does not represent a real person's life.
A person has a xed home and workplace. The way to work can be walked or
driven by public transportation. Each person has two bus stops which have to be
used on their way to work. Whether a person walks or drives can be random,
xed or also be in uenced by the weather. The di erence between random and
weather is that the rst is individual for each person and the second a ects a
batch of people. Nevertheless, bus stops are present in both simulations. The
population of the bus stops of the bus simulation is normally generated within
the bus simulation. However, now the bus stops will be populated by the people
of the life simulation. Therefore, the two simulations will a ect each other. We
will introduce how these two simulations can be coupled. Hence, in this paper,
we focus on the coordination of the data exchange of these two simulations.
3</p>
    </sec>
    <sec id="sec-3">
      <title>State of the Art</title>
      <p>Approaches to improve the evolution of software simulations are divided into
two categories. The composition of simulations and the interoperability between
simulations, and the modeling of simulations. Approaches to composition and
interoperability are presented together.</p>
      <p>
        Simulation Composition and Interoperability Reusing a simulation or
parts of a simulation require composability and interoperability. The Distributed
Interactive Simulation (DIS) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] approach is decentralized. Data is speci ed at
the protocol level. Information about the whole simulation has to be present for
each participant. The successor of DIS is the High Level Architecture (HLA) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
Information is stored by a central manager, the Runtime Infrastructure (RTI).
Composable Discrete-Event scalable Simulation (CoDES) by Teo et al. [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] is
a component-based approach. It allows semantic composition of simulations if
implemented strictly according to the CoDES speci cation. Zeigler et al. [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]
developed the Discrete Event System Speci cation (DEVS) approach. DEVS allows
formal de nitions for simulation states and transactions between simulations.
However, these approaches are very restrictive and cannot easily be mixed with
other approaches.
      </p>
      <p>
        Simulation Modeling Data and behavior of an HLA simulation has been
modeled by Topcu et al. [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. Scerri et al. [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] introducing agent-based models
and shared variables to extend the HLA approach. In the context of autonomous
systems, the modeling language Systems Modeling Language (SysML [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]) was
extended by Bocciarelli et al.[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. The work of Benjamin et al. [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] asserts that
an ontology facilitates the modeling of simulation. Model-driven development
approaches are utilized by Cetinkaya et al. [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Despite not using an ontological
or metamodeling approach, Law's reference book "Simulation Modeling and
Analysis" [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] is giving an overview of general modeling approaches in the
domain of simulations. All approaches have in common that the composition and
interoperability aspect is not considered.
4
      </p>
    </sec>
    <sec id="sec-4">
      <title>Modular Simulation Environment Metamodel</title>
      <p>
        If a simulation has to be coupled with other simulations the coupling and
communication have to be managed. In [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] the coupling on an abstract level is described.
However, the management of the connected simulations is not considered.
Management of simulations is to ensure data that must be exchanged is sent to the
right simulation at the right time. Additionally, the sent data must be in the
right format for the receiving simulation. Accordingly, we introduce a
management element for coupling simulations. The Modular Simulation Environment
(MSE) ful lls a similar role as the HLA RTI. In contrast to the RTI, the MSE
describes the coupling on an architectural level. We will introduce the MSE and
its advantages in contrast to the aforementioned approaches in Sec. 3. Fig. 1
shows an excerpt of our metamodel with a focus on the MSE. The metamodel
and model of the bus and human simulation coupling can be found on GitHub1.
Coordinator The Coordinator serves as the root element of the MSE. All
elements regarding connection, data speci cation, and management are part of
the Coordinator. A Coordinator stores all Connectors necessary for
connecting simulations to the Coordinator. Multiple simulations can be connected to
the Coordinator. In contrast to the HLA, several simulations coordinated by
di erent Coordinators can be combined to create a more extensive simulation.
Consequently, speci c parts of a simulation can be encapsulated with a dedicated
Coordinator and if necessary combined to form a substantial simulation. All data
types available to the Coordinator are de ned in the DataSpeci cationContainer.
Therefore, no simulation has to know which other data types are used by other
simulations connected via the Coordinator. The Annotation Interface allows data
1 https://github.com/MoSimEngine
      </p>
      <p>Modular Simulation Environment</p>
      <p>1
Service Interface</p>
      <p>Coordinator
+</p>
      <p>Connector
+
Management Service
1
*</p>
      <p>1
Data Specification</p>
      <p>Container
*</p>
      <p>Ann*otation
Container
1
*</p>
      <p>*
Ad*apter
* Annotation Interface</p>
      <p>Annotation *
exchange between simulations. Even if these simulations are developed
independently. Conversion information necessary for the Coordinator is de ned in the
Service Interface. The Service Interface provides a set of coordinator functions
callable by the connected simulations.</p>
      <p>Connector The Connector enables communication between a simulation and
the MSE. Each simulation and the Coordinator have to implement a Connector.
The Connector of a simulation invokes functions of the Coordinator. These
functions are provided by the Connector. However, an existing simulation will
not have a Connector automatically built in. Therefore, a wrapper has to provide
the Connectors functionality. The Wrapper will encapsulate the simulation. If
changes will occur either for the simulation or the MSE, it will only a ect the
wrapper but not the whole system. A concrete realization of a Connector is
not part of our metamodel, because the actual implementation is depending on
the domain. Each simulation has to implement a Connector in order to access
the Connector. Regarding the motivating example, a Coordinator has to be
implemented. Otherwise, no data could be received or sent by the simulations.
Adapter In order to combine di erent simulations, the required and provided
data of these simulations need to be aligned. The problem is that each simulation
can require and provide di erent data types. As a result, a simulation has to know
what data types are provided by the other simulations to enable a data exchange.
However, reusing simulations may require a change when it will be coupled
with new simulations. Therefore, we propose the Adapter. An Adapter can be
developed independently of the used simulations and the MSE. For instance, two
simulations using time information but one calculates in hours and the other in
seconds. Thus, if these two simulations need to exchange time information the
transformation can be de ned in the Adapter. The motivating example needs one
Adapter. The adapter transforms the walking distance of the human simulation
from a oating point value to an integer value.
Annotation Interface Data provided by a simulation must have context
information, so that the data can be processed by the Coordinator. Therefore, we
introduce the Annotation Interface to allow annotating context information to a
datum. Annotations are a part of the Annotation Interface. These Annotations
can be divided into two categories. The Scheduling Annotation de nes in which
order data has to be sent by the Coordinator to the receiving simulation. Further,
the Update Annotation de nes under which circumstances a datum has to be sent
by the simulation. Three types of Update Annotation can be speci ed. Either on
a xed time interval, if a prede ned condition occurs, or if a simulation requests
a datum. Regarding the motivating example, we de ned one Annotation for the
incoming data order, which is ordered by timestamp.</p>
      <p>Management Service The Management Service is responsible for the internal
processes of the coordinator. For instance, a dedicated time management service
is responsible for the advancing time of the simulation. Another Management
Service may handle data in the Coordinator, it creates and destroys data if
necessary. In order to handle data, the de ned annotations which are stored
in the Annotation Container, are accessible by the management services. The
Annotation Container is stored in the Coordinator, thus an Annotation can be
de ned at a central point and reused if necessary. Also, the ownership of the data
can be supervised by a Management Service. Each Management Service ful lls
one purpose and can be reused by other coordinators. For the motivating example,
three Management Services have to be implemented. A publishing service sends
events to the right receiver (e.g., number of waiting persons at a bus station
when a new person arrives). A subscribing service allows the subscription for
events and a time advancing service manages the triggering of events regarding
the time advancement.</p>
      <p>Data Speci cation Container All data types present in the Coordinator are
de ned in the Data Speci cation Container. A central speci cation allows reusing
the de ned data types for di erent simulations. Furthermore, if a change requires
to modify a data type then the modi cation can be made at the Data Speci cation
Container. The Data Speci cation Container of our motivating example contains
an Integer (number of seats, occupied seats, waiting persons and distances), a
String (bus line name, person name, etc.), and a Bool (is raining) data type.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion and Future Work</title>
      <p>In this paper, we proposed the metamodel for a modular simulation environment.
We introduced a motivating example with a bus and a human simulation. These
two simulations had to be coupled to create a more detailed simulation. Based
on these two simulations, we described the necessity of the Modular Simulation
Environment Metamodel. The purpose and functionality of each metamodel
element were explained. We have shown that our metamodel allows describing the
coupling and interoperability on an architectural level. However, the metamodel
has not been used for an actual coupling scenario. Therefore, we have to evaluate
our metamodel as the next step. We have to ensure that the behavior of the two
simulations is not negatively a ected by the coupling. Thus, the behaviour of a
simulation must be integrated in the metamodel. Currently we are working on
a Domain Speci c Language which uses the metamodel as base. Our goal is to
allow a automated generation of the code which is necessary for the coupling.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgement</title>
      <p>This work was partially supported by the MWK (Ministry of Science, Research
and the Arts Baden-Wurttemberg) in the funding line Research Seed Capital
(RiSC). We would like to thank Prof. Shmuel Tyszberowicz for his valuable input.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Benjamin</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , et al.:
          <article-title>Using ontologies for simulation modeling</article-title>
          .
          <source>In: Winter Simulation Conference</source>
          . pp.
          <volume>1151</volume>
          {
          <fpage>1159</fpage>
          .
          <string-name>
            <surname>IEEE</surname>
          </string-name>
          (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Bocciarelli</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , et al.:
          <article-title>A model-driven framework for distributed simulation of autonomous systems</article-title>
          .
          <source>In: Proceedings of the Symposium on Theory of Modeling; Simulation: DEVS Integrative</source>
          . pp.
          <volume>213</volume>
          {
          <fpage>220</fpage>
          . DEVS '
          <volume>15</volume>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Cetinkaya</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , et al.:
          <article-title>MDD4MS: A model driven development framework for modeling and simulation</article-title>
          .
          <source>In: Proceedings of the Summer Computer Simulation Conference</source>
          . pp.
          <volume>113</volume>
          {
          <fpage>121</fpage>
          .
          <string-name>
            <surname>Society</surname>
          </string-name>
          for Modeling &amp; Simulation
          <string-name>
            <surname>International</surname>
          </string-name>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Dahmann</surname>
            ,
            <given-names>J.S.</given-names>
          </string-name>
          , et al.:
          <article-title>The department of defense high level architecture</article-title>
          .
          <source>In: 29th conference on Winter simulation</source>
          . pp.
          <volume>142</volume>
          {
          <fpage>149</fpage>
          .
          <string-name>
            <surname>IEEE</surname>
          </string-name>
          (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>DIS</given-names>
            <surname>Steering Committee</surname>
          </string-name>
          , et al.:
          <article-title>The DIS vision: A map to the future of distributed simulation (</article-title>
          <year>1994</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Friedenthal</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , et al.:
          <article-title>A practical guide to SysML: The systems modeling language (</article-title>
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Koch</surname>
            ,
            <given-names>S.:</given-names>
          </string-name>
          <article-title>Challenges in modularization of discrete event simulations</article-title>
          . In: Collaborative Workshop on Evolution and
          <article-title>Maintenance of Long-Living Software Systems</article-title>
          . CEUR-WS (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Koch</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Towards semantic composition of event-based simulation</article-title>
          .
          <source>In: 5th Design For Future Workshop</source>
          . Softwaretechnik-Trends (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Law</surname>
            ,
            <given-names>A.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kelton</surname>
            ,
            <given-names>D.W.</given-names>
          </string-name>
          :
          <article-title>Simulation modeling and analysis</article-title>
          .
          <source>McGraw-Hill</source>
          (
          <year>1991</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Reussner</surname>
            ,
            <given-names>R.H.</given-names>
          </string-name>
          , et al.:
          <article-title>Modeling and simulating software architectures: The Palladio approach</article-title>
          . MIT Press (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Scerri</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , et al.:
          <article-title>An architecture for modular distributed simulation with agentbased models</article-title>
          .
          <source>In: Proceedings of the 9th International Conference on Autonomous Agents and Multiagent Systems: Volume 1</source>
          . pp.
          <volume>541</volume>
          {
          <issue>548</issue>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Teo</surname>
            ,
            <given-names>Y.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Szabo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>CoDES: An integrated approach to composable modeling and simulation</article-title>
          .
          <source>In: Simulation Symposium</source>
          ,
          <year>2008</year>
          .
          <source>ANSS 2008. 41st Annual</source>
          . pp.
          <volume>103</volume>
          {
          <fpage>110</fpage>
          .
          <string-name>
            <surname>IEEE</surname>
          </string-name>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Tolk</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Metamodels and mappings - ending the interoperability war</article-title>
          .
          <source>In: Fall Simulation Interoperability Workshop</source>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Topcu</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          , et al.:
          <string-name>
            <surname>Distributed Simulation - A Model Driven Engineering Approach</surname>
          </string-name>
          . Springer (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Zeigler</surname>
            ,
            <given-names>B.P.</given-names>
          </string-name>
          :
          <article-title>Multifacetted modelling and discrete event simulation</article-title>
          . Academic Press (
          <year>1984</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>