<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.3 20070202//EN" "journalpublishing.dtd">
<article article-type="research-article" dtd-version="2.3" xml:lang="EN" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">Front. Robot. AI</journal-id>
<journal-title>Frontiers in Robotics and AI</journal-title>
<abbrev-journal-title abbrev-type="pubmed">Front. Robot. AI</abbrev-journal-title>
<issn pub-type="epub">2296-9144</issn>
<publisher>
<publisher-name>Frontiers Media S.A.</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">1363041</article-id>
<article-id pub-id-type="doi">10.3389/frobt.2024.1363041</article-id>
<article-categories>
<subj-group subj-group-type="heading">
<subject>Robotics and AI</subject>
<subj-group>
<subject>Technology and Code</subject>
</subj-group>
</subj-group>
</article-categories>
<title-group>
<article-title>Software patterns and data structures for the runtime coordination of robots, with a focus on real-time execution performance</article-title>
<alt-title alt-title-type="left-running-head">Artigas et al.</alt-title>
<alt-title alt-title-type="right-running-head">
<ext-link ext-link-type="uri" xlink:href="https://doi.org/10.3389/frobt.2024.1363041">10.3389/frobt.2024.1363041</ext-link>
</alt-title>
</title-group>
<contrib-group>
<contrib contrib-type="author" corresp="yes">
<name>
<surname>Artigas</surname>
<given-names>Maria I.</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<xref ref-type="aff" rid="aff2">
<sup>2</sup>
</xref>
<xref ref-type="corresp" rid="c001">&#x2a;</xref>
<uri xlink:href="https://loop.frontiersin.org/people/2517476/overview"/>
<role content-type="https://credit.niso.org/contributor-roles/conceptualization/"/>
<role content-type="https://credit.niso.org/contributor-roles/investigation/"/>
<role content-type="https://credit.niso.org/contributor-roles/methodology/"/>
<role content-type="https://credit.niso.org/contributor-roles/software/"/>
<role content-type="https://credit.niso.org/contributor-roles/validation/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-original-draft/"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Rodrigues</surname>
<given-names>R&#xf4;mulo T.</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<xref ref-type="aff" rid="aff2">
<sup>2</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/2792859/overview"/>
<role content-type="https://credit.niso.org/contributor-roles/conceptualization/"/>
<role content-type="https://credit.niso.org/contributor-roles/methodology/"/>
<role content-type="https://credit.niso.org/contributor-roles/software/"/>
<role content-type="https://credit.niso.org/contributor-roles/validation/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-original-draft/"/>
<role content-type="https://credit.niso.org/contributor-roles/Writing &#x2013; review &#x26; editing/"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Vanderseypen</surname>
<given-names>Lars</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/2612031/overview"/>
<role content-type="https://credit.niso.org/contributor-roles/software/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-original-draft/"/>
<role content-type="https://credit.niso.org/contributor-roles/Writing &#x2013; review &#x26; editing/"/>
</contrib>
<contrib contrib-type="author">
<name>
<surname>Bruyninckx</surname>
<given-names>Herman</given-names>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
<xref ref-type="aff" rid="aff2">
<sup>2</sup>
</xref>
<xref ref-type="aff" rid="aff3">
<sup>3</sup>
</xref>
<uri xlink:href="https://loop.frontiersin.org/people/1545873/overview"/>
<role content-type="https://credit.niso.org/contributor-roles/conceptualization/"/>
<role content-type="https://credit.niso.org/contributor-roles/methodology/"/>
<role content-type="https://credit.niso.org/contributor-roles/writing-original-draft/"/>
<role content-type="https://credit.niso.org/contributor-roles/Writing &#x2013; review &#x26; editing/"/>
</contrib>
</contrib-group>
<aff id="aff1">
<sup>1</sup>
<institution>Department of Mechanical Engineering</institution>, <institution>KU Leuven</institution>, <addr-line>Leuven</addr-line>, <country>Belgium</country>
</aff>
<aff id="aff2">
<sup>2</sup>
<institution>Flanders Make</institution>, <addr-line>Leuven</addr-line>, <country>Belgium</country>
</aff>
<aff id="aff3">
<sup>3</sup>
<institution>Department of Mechanical Engineering</institution>, <institution>TU Eindhoven</institution>, <addr-line>Eindhoven</addr-line>, <country>Netherlands</country>
</aff>
<author-notes>
<fn fn-type="edited-by">
<p>
<bold>Edited by:</bold> <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/1843434/overview">Federico Ciccozzi</ext-link>, M&#xe4;lardalen University, Sweden</p>
</fn>
<fn fn-type="edited-by">
<p>
<bold>Reviewed by:</bold> <ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/2725473/overview">Cezary Zielinski</ext-link>, Warsaw University of Technology, Poland</p>
<p>
<ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/2753777/overview">Antonio Cicchetti</ext-link>, M&#xe4;lardalen University, Sweden</p>
<p>
<ext-link ext-link-type="uri" xlink:href="https://loop.frontiersin.org/people/2776113/overview">Muhammad Waseem Anwar</ext-link>, M&#xe4;lardalen University, Sweden</p>
</fn>
<corresp id="c001">&#x2a;Correspondence: Maria I. Artigas, <email>mariaisabel.artigasalfonso@kuleuven.be</email>
</corresp>
</author-notes>
<pub-date pub-type="epub">
<day>04</day>
<month>09</month>
<year>2024</year>
</pub-date>
<pub-date pub-type="collection">
<year>2024</year>
</pub-date>
<volume>11</volume>
<elocation-id>1363041</elocation-id>
<history>
<date date-type="received">
<day>29</day>
<month>12</month>
<year>2023</year>
</date>
<date date-type="accepted">
<day>12</day>
<month>08</month>
<year>2024</year>
</date>
</history>
<permissions>
<copyright-statement>Copyright &#xa9; 2024 Artigas, Rodrigues, Vanderseypen and Bruyninckx.</copyright-statement>
<copyright-year>2024</copyright-year>
<copyright-holder>Artigas, Rodrigues, Vanderseypen and Bruyninckx</copyright-holder>
<license xlink:href="http://creativecommons.org/licenses/by/4.0/">
<p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.</p>
</license>
</permissions>
<abstract>
<p>This paper introduces software patterns (registration, acquire-release, and cache awareness) and data structures (Petri net, finite state machine, and protocol flag array) to support the coordinated execution of software activities (also called &#x201c;components&#x201d; or &#x201c;agents&#x201d;). Moreover, it presents and tests an implementation for Petri nets that supports real-time execution in shared memory for deployment inside one individual robot and separates event firing and handling, enabling distributed deployment between multiple robots. Experimental validation of the introduced patterns and data structures is performed within the context of activities for task execution, control and perception, and decision making for an application on coordinated navigation.</p>
</abstract>
<kwd-group>
<kwd>multi-robot</kwd>
<kwd>coordination</kwd>
<kwd>Petri net</kwd>
<kwd>finite state machine</kwd>
<kwd>real-time</kwd>
<kwd>shared memory</kwd>
</kwd-group>
<custom-meta-wrap>
<custom-meta>
<meta-name>section-at-acceptance</meta-name>
<meta-value>Computational Intelligence in Robotics</meta-value>
</custom-meta>
</custom-meta-wrap>
</article-meta>
</front>
<body>
<sec id="s1">
<title>1 Introduction</title>
<p>Society expects &#x201c;smarter&#x201d; robotics technology and &#x201c;higher performance&#x201d; of the applications and systems that are built with it. A major contribution toward realizing these expectations is improving the capabilities and the predictability of the composition of robotic components into systems. Coordination plays a major role in achieving this predictability: a system has several concurrently active components that require access to &#x201c;resources&#x201d; that cannot be shared trivially, such as locations in space or tools and sensors. Application developers must translate user requirements into concrete <italic>coordination specifications</italic>: when and why each of the components in the system must start or stop a particular &#x201c;behavior.&#x201d; Coordination is triggered by &#x201c;events&#x201d; generated by the software component in the system that has the authority to make such decisions, and it is provided with the necessary information by all the components that rely on its coordination. A good (but not necessarily unique) <italic>separation of concerns</italic> (<xref ref-type="bibr" rid="B11">Dijkstra, 1982</xref>) approach to ensure coordinated resource sharing with predictable performance and acceptable access policies is to introduce a <italic>dedicated coordination software component</italic> for each shared resource. The contributions of this paper are focused on this coordination design concern.</p>
<p>The left-hand side of <xref ref-type="fig" rid="F1">Figure 1</xref> shows a simple example of the role of coordination in multi-robot systems (<xref ref-type="sec" rid="s1-3">Section 1.3</xref> provides an overview of more archetypical coordination-use cases).<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf1">
<mml:math id="m1">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The sketch on the left-hand side represents a &#x201c;T junction.&#x201d;</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf2">
<mml:math id="m2">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Robots can come from three different roads, each with the timing unknown to the other robots.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf3">
<mml:math id="m3">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The &#x201c;crossing area&#x201d; Cr is the &#x201c;shared resource&#x201d; that should be entered by only one robot at a time.</p>
</list-item>
</list>
</p>
<fig id="F1" position="float">
<label>FIGURE 1</label>
<caption>
<p>Coordination between concurrently active &#x201c;agents&#x201d; in traffic situations, particularly a T-junction. Left: only one &#x201c;robot&#x201d; coming from one of the three roads shall be allowed to access the crossing Cr. Right: our design introduces a <italic>mediator</italic> software component to realize such coordination problems. It relies on i) a <italic>Petri net</italic> as a <italic>declarative model</italic> of the coordination&#x2019;s decision making and ii) a <italic>protocol</italic> between the mediator and each of the coordinated robots, via which the latter&#x2019;s own internal decision making is <italic>decoupled</italic> from that of all other robots.</p>
</caption>
<graphic xlink:href="frobt-11-1363041-g001.tif"/>
</fig>
<p>The figure&#x2019;s right-hand side sketches our software design (which is described in detail in the later sections of this paper).<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf4">
<mml:math id="m4">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The crossing area gets its own <italic>mediator</italic> software component (<xref ref-type="bibr" rid="B15">Gamma et al., 1995</xref>). The mediator allows robots to navigate the crossing area in a coordinated way. The core data structure of the mediator is a <italic>Petri net</italic> that represents a <italic>declarative model</italic> of the coordination&#x2019;s decision-making.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf5">
<mml:math id="m5">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The second software component is a <italic>map</italic> data structure that all robots share with the mediator. On that map, they indicate which area they are currently driving in. These areas are given numbers 1, 2, and 3 for each of the three roads &#x201c;R&#x201d;; &#x201c;i&#x201d; and &#x201c;o&#x201d; indicate the &#x201c;incoming&#x201d; and &#x201c;outgoing&#x201d; lanes.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf6">
<mml:math id="m6">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The third software component is a <italic>protocol</italic> data structure that is accessed in sequence by the mediator and each of the coordinated robots. The protocol decouples a robot&#x2019;s own internal decision making from that of all other robots.</p>
</list-item>
</list>
</p>
<p>The <italic>map</italic> is also a shared resource in itself, but its software design presents a different set of coordination challenges, which are beyond the scope of this paper; for further details, refer to <xref ref-type="bibr" rid="B28">Van Baelen et al. (2022)</xref>.</p>
<p>The following sub-sections introduce and define all the concepts needed in this paper. <xref ref-type="sec" rid="s2">Section 2</xref> discusses the previous work on which this paper is based and other related work. <xref ref-type="sec" rid="s3">Section 3</xref> describes the coordination mechanisms introduced in this paper and the complementary communication and configuration mechanisms for its integration. <xref ref-type="sec" rid="s4">Section 4</xref> introduces the implementation and evaluation of the Petri nets for runtime coordination. <xref ref-type="sec" rid="s5">Section 5</xref> explains the application of the previously described patterns in a coordinated navigation case. A secondary demonstration is also provided. <xref ref-type="sec" rid="s6">Section 6</xref> concludes the paper with a discussion of the presented and future work. <xref ref-type="sec" rid="s12">Supplementary Appendix SA</xref> explains the connection between the coordinating and coordinated activities via events.</p>
<sec id="s1-1">
<title>1.1 Component</title>
<p>The terminology &#x201c;(software) components&#x201d; has been interpreted several times over the past decades (<xref ref-type="bibr" rid="B4">Brugali and Scandurra, 2009</xref>; <xref ref-type="bibr" rid="B5">Brugali and Shakhimardanov, 2010</xref>), referring to the software primitive that provides &#x201c;computational behavior&#x201d; to a system. The terminology used in this paper to represent complementary types of computational behavior is as follows:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf7">
<mml:math id="m7">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> (robot) Component: each piece of software-controlled hardware that the application identifies as a &#x201c;robot.&#x201d; It is not to be subdivided further hardware-wise and can be connected to other robot components via mechanical, power, and information connectors to form a larger &#x201c;composite&#x201d; robot component.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf8">
<mml:math id="m8">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Computer: the set of CPUs, each with possibly several computing cores and managed by one operating system. Many robot <italic>components</italic> are built with more than one computer.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf9">
<mml:math id="m9">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Process and thread: the two well-known <italic>application-independent</italic> computational primitives under the control of an operating system.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf10">
<mml:math id="m10">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Activity: the smallest concurrently running piece of software that components the need and is deployed in a thread. Typically, each component requires application-centric functionalities implemented in a multitude of activities, all running <italic>asynchronously</italic> on the same computer or different computers.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf11">
<mml:math id="m11">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Algorithm: an activity can execute one or more algorithms inside, for which it guarantees the <italic>synchronous</italic> execution context needed to realize the <italic>functionalities</italic> (or &#x201c;<italic>behavior</italic>&#x201d;) of a component. In other words, the activity is responsible for asynchronous data exchange between activities, making sure that their algorithms only have to access locally stored data structures that are, hence, synchronously processed.</p>
</list-item>
</list>
</p>
<p>One could have given the name software component to what is called <italic>activity</italic> above. Because activities are designed to be executed concurrently, an appropriate set of asynchronous data exchange mechanisms is needed; these mechanisms should be shared between the activities within the same process memory or use one or more inter-process communication technologies. The challenges of data consistency between concurrently running activities are to be solved at the activity level but not at the thread or algorithm levels. The thread level in a software component design is responsible for scheduling by the operating system. The process level is responsible for managing resources shared between all activities within all process&#x2019;s threads, such as file descriptors, signal handling, and thread priorities.</p>
</sec>
<sec id="s1-2">
<title>1.2 Coordination</title>
<p>Coordination is all decision making shared between concurrently executing <italic>activities</italic> about which of their <italic>algorithms</italic> (&#x201c;behaviors&#x201d;) must become &#x201c;(in)active&#x201d; at each moment in time in each of the robot components and about how to keep other robot components informed about which behavior(s) are currently &#x201c;(in)active.&#x201d; A key message of this paper is that all forms of inter-activity coordination can be realized with the following primitives, whose &#x201c;separation of concerns&#x201d; roles (<xref ref-type="bibr" rid="B11">Dijkstra, 1982</xref>) are illustrated in <xref ref-type="fig" rid="F1">Figure 1.</xref>
<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf12">
<mml:math id="m12">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Flag: this represents the &#x201c;state&#x201d; of a <italic>Boolean condition</italic> defined over a set of parameters in the behavior(s) of an activity. For example, for mobile robots navigating in the neighborhood of the crossing in <xref ref-type="fig" rid="F1">Figure 1</xref>, flags can indicate areas in which each mobile robot finds itself. (The above-mentioned &#x201c;map&#x201d; software component could act as the major source of <italic>flag</italic> information and <italic>event</italic> information introduced below.)</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf13">
<mml:math id="m13">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Event: this represents the change in the Boolean state of a flag. Because <xref ref-type="fig" rid="F1">Figure 1</xref> is a static &#x201c;snapshot&#x201d; of the status of the world, it does not show <italic>events.</italic> They only come in when the time-varying <italic>dynamics</italic> of the coordination problem are considered and they are to be <italic>communicated</italic> between activities.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf14">
<mml:math id="m14">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Finite state machine [FSM, <xref ref-type="bibr" rid="B17">Hr&#xfa;z and Zhou (2007)</xref>]: each of the activities needs to realize a particular behavior in a particular order. Such an order is represented <italic>declaratively</italic> by a finite state machine data structure and behavior:</p>
<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf15">
<mml:math id="m15">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Each activity can be &#x201c;in&#x201d; <italic>one and only one state</italic> at a time.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf16">
<mml:math id="m16">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> In each state of the finite state machine, the activity executes a particular set of algorithms and communicates a particular set of data structures, including <italic>events.</italic>
</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf17">
<mml:math id="m17">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Transitions between states are triggered by incoming events or events generated internally in the activity.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf18">
<mml:math id="m18">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Some of these transitions can also give rise to the <italic>firing</italic> of events that must be communicated to other activities.</p>
</list-item>
</list>
</list-item>
</list>
</p>
<p>This description of the <italic>mechanism</italic> of an FSM corresponds to that of a <italic>Mealy machine</italic> (<xref ref-type="bibr" rid="B21">Mealy, 1955</xref>), which is formally represented as a tuple <inline-formula id="inf19">
<mml:math id="m19">
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>S</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>I</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>O</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi mathvariant="script">T</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi mathvariant="script">O</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula>, with <inline-formula id="inf20">
<mml:math id="m20">
<mml:mi>S</mml:mi>
</mml:math>
</inline-formula> representing the finite set of <italic>states</italic>; <inline-formula id="inf21">
<mml:math id="m21">
<mml:mi>I</mml:mi>
</mml:math>
</inline-formula> representing the finite set of <italic>input</italic> events (or &#x201c;input symbols&#x201d;); and <inline-formula id="inf22">
<mml:math id="m22">
<mml:mi>O</mml:mi>
</mml:math>
</inline-formula> representing the finite set of <italic>output</italic> events (or &#x201c;output symbols&#x201d;).<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf23">
<mml:math id="m23">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <inline-formula id="inf24">
<mml:math id="m24">
<mml:mi mathvariant="script">T</mml:mi>
</mml:math>
</inline-formula>: the <italic>transition function</italic> <inline-formula id="inf25">
<mml:math id="m25">
<mml:mi mathvariant="script">T</mml:mi>
<mml:mo>:</mml:mo>
<mml:mi>S</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>I</mml:mi>
<mml:mo>&#x2192;</mml:mo>
<mml:mi>S</mml:mi>
</mml:math>
</inline-formula> maps the combination of a <italic>state</italic> and an <italic>input</italic> event to a <italic>state.</italic>
</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf26">
<mml:math id="m26">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <inline-formula id="inf27">
<mml:math id="m27">
<mml:mi mathvariant="script">O</mml:mi>
</mml:math>
</inline-formula>: the output function <inline-formula id="inf28">
<mml:math id="m28">
<mml:mi mathvariant="script">O</mml:mi>
<mml:mo>:</mml:mo>
<mml:mi>S</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>I</mml:mi>
<mml:mo>&#x2192;</mml:mo>
<mml:mi>O</mml:mi>
</mml:math>
</inline-formula> maps the combination of a state and an input event to an output event.</p>
</list-item>
</list>
</p>
<p>In the actual execution of an FSM, the <italic>policy</italic> must be added to select one of the states as the <italic>initial state</italic> <inline-formula id="inf29">
<mml:math id="m29">
<mml:msub>
<mml:mrow>
<mml:mi>S</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula>.<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf30">
<mml:math id="m30">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Petri net (PN): this is a data structure that keeps track of the (externally exposed) state of a set of activities that need to be coordinated in the coordination <italic>mediator</italic> software component, as shown in <xref ref-type="fig" rid="F1">Figure 1</xref>. Each of these states fills a <italic>place</italic> in the Petri net with a <italic>token.</italic> (This paper uses only the simplest form of Petri nets, sometimes called <italic>safe</italic> Petri nets (<xref ref-type="bibr" rid="B2">Barylska et al., 2017</xref>), in which each place can hold only zero or one <italic>token.</italic>) The role of the Petri net is to support decisions about the coordination <italic>between activities</italic> and not about the <italic>internal algorithm</italic> coordination of one single activity. <italic>Semantically</italic>, a Petri net can have more than one of its places <italic>marked</italic> at any given time, while a finite state machine can <italic>be</italic> in only one of its states at any given time.</p>
</list-item>
</list>
</p>
<p>This <italic>mechanism</italic>of a Petri net is formally represented as a tuple <inline-formula id="inf31">
<mml:math id="m31">
<mml:mrow>
<mml:mo stretchy="false">(</mml:mo>
<mml:mrow>
<mml:mi>P</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>T</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi>M</mml:mi>
<mml:mo>,</mml:mo>
<mml:mi mathvariant="script">F</mml:mi>
</mml:mrow>
<mml:mo stretchy="false">)</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula>, with <inline-formula id="inf32">
<mml:math id="m32">
<mml:mi>P</mml:mi>
</mml:math>
</inline-formula>representing the finite set of <italic>places</italic>; <inline-formula id="inf33">
<mml:math id="m33">
<mml:mi>T</mml:mi>
</mml:math>
</inline-formula>representing the finite set of <italic>transitions</italic>(<inline-formula id="inf34">
<mml:math id="m34">
<mml:mi>P</mml:mi>
</mml:math>
</inline-formula>and <inline-formula id="inf35">
<mml:math id="m35">
<mml:mi>T</mml:mi>
</mml:math>
</inline-formula>are always disjoint); <inline-formula id="inf36">
<mml:math id="m36">
<mml:mi>M</mml:mi>
</mml:math>
</inline-formula>representing the set of <italic>markings</italic>of the Petri net, where each marking is a mapping <inline-formula id="inf37">
<mml:math id="m37">
<mml:mi>M</mml:mi>
<mml:mo>:</mml:mo>
<mml:mi>P</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mrow>
<mml:mo stretchy="false">{</mml:mo>
<mml:mrow>
<mml:mn>0,1</mml:mn>
</mml:mrow>
<mml:mo stretchy="false">}</mml:mo>
</mml:mrow>
</mml:math>
</inline-formula>, indicating whether a <italic>place</italic>is marked or not, that is, it contains a <italic>token</italic>or not; and <inline-formula id="inf38">
<mml:math id="m38">
<mml:mi mathvariant="script">F</mml:mi>
</mml:math>
</inline-formula>representing the <italic>firing function</italic>such that <inline-formula id="inf39">
<mml:math id="m39">
<mml:mi mathvariant="script">F</mml:mi>
<mml:mo>:</mml:mo>
<mml:mi>P</mml:mi>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>M</mml:mi>
<mml:mo>&#x2192;</mml:mo>
<mml:mi>M</mml:mi>
</mml:math>
</inline-formula>removes the <italic>tokens</italic>in the input <italic>places</italic>of a <italic>transition</italic>whenever all these <italic>places</italic>are <italic>marked</italic>and produces a <italic>token</italic>in each of the <italic>transition&#x2019;</italic>s output <italic>places.</italic>
</p>
<p>In the actual execution of a Petri net, the <italic>policy</italic> must be added to define an <italic>initial marking</italic> <inline-formula id="inf40">
<mml:math id="m40">
<mml:msub>
<mml:mrow>
<mml:mi>M</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula>.<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf41">
<mml:math id="m41">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Protocol: this represents the order in which a particular subset of flags is allowed to be set to &#x201c;true&#x201d; in the interaction between the coordination <italic>mediator</italic> and <italic>one</italic> of the coordinated activities. Such an order must be agreed upon <italic>in advance</italic> by all activities participating in the coordination mediation to be able to guarantee temporal constraints between behavior state changes.</p>
</list-item>
</list>
</p>
<p>For example, the protocols in <xref ref-type="fig" rid="F1">Figure 1</xref> show that for each robot, the sequence of execution is as follows: 1) the robot requests access, 2) the access is approved, and 3) the robot can enter the area.</p>
<p>Note that the &#x201c;array&#x201d; used in <xref ref-type="fig" rid="F1">Figure 1</xref> to represent a protocol is <italic>always finite</italic>, and flag entries are entered always from the first entry on the left. In other words, it is <italic>not</italic> an endlessly growing &#x201c;stream&#x201d; of flag entries. When the protocol ends, for one reason or another, all entries are removed so that the next execution of the protocol starts with an empty array again.</p>
<p>In the simple <italic>workspace sharing</italic> example in <xref ref-type="fig" rid="F1">Figure 1</xref>, the <italic>labeled circles</italic> (called &#x201c;places&#x201d;) represent <italic>conditions</italic> that can be true or false, and the <italic>solid lines</italic> (called &#x201c;transitions&#x201d;) represent decision making: if all the input conditions are true, the transition is &#x201c;fired.&#x201d; The result is that the conditions in the input places are put to false again, and those in the output places become true. The truth values of the &#x201c;source&#x201d; places (i.e., those without input transition) are <italic>determined</italic> by the flags in the <italic>protocol</italic> arrays. Similarly, the truth values of the &#x201c;sink&#x201d; places (i.e., without output transition) <italic>determine</italic> the value of the corresponding flags in the <italic>protocol</italic>.</p>
<p>The ideal lifetime of an event is &#x201c;zero&#x201d;: as soon as an event is <italic>fired</italic> by an activity, all the activities that need to react to the event (that is, &#x201c;to handle&#x201d; it) will <italic>consume</italic> the event during their reaction. The software architecture of such coordinated components must foresee the <italic>communication</italic> of events between the firing activity and each of the handling activities, which is (one of the reasons) why asynchronous data exchange is needed between these activities.</p>
<p>
<xref ref-type="fig" rid="F1">Figure 1</xref> uses the simplest form of a protocol sequence, namely, an <italic>array</italic>; in general, protocols consist of compositions of more than one such array, representing different allowable &#x201c;paths&#x201d; in the coordination. Note the important difference between the very narrow and lean semantics of a &#x201c;protocol&#x201d; as needed in this paper and the much wider semantics of &#x201c;protocol stacks&#x201d; as used in inter-process communication (<xref ref-type="bibr" rid="B9">Delanote et al., 2008</xref>).</p>
</sec>
<sec id="s1-3">
<title>1.3 Archetypical use cases</title>
<p>The following example set of multi-robot applications, with multi-tasking functionalities for each robot, is representative of the scope of this paper&#x2019;s coordination design contributions:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf42">
<mml:math id="m42">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Workspace sharing. This involves scenarios where multiple mobile robots (flying, wheeled, and legged) from possibly different vendors (and hence with independently developed software capabilities) need to share the same space in a warehouse or orchard. The same holds for multiple manipulator arms on conveyor belts or at assembly and fruit harvesting stations. In addition, both types of robotic components should also physically interact with each other, like an assembly robot arm that can take parts from a mobile robot that brings the parts from storage.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf43">
<mml:math id="m43">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Execution protocols. For example, robots must <italic>register</italic> with the &#x201c;manager&#x201d; of a shared resource (charging station, parking space, inland waterway lock, and gripper on a fruit harvesting robot) and then follow a <italic>protocol</italic> coordinated by that manager every time they want to use that resource. Being able to coordinate the execution of different robots in a predictable, agreed-upon way is another necessary (but not sufficient) condition for sharing <italic>physical workspace.</italic>
</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf44">
<mml:math id="m44">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Task sharing<bold>.</bold> A typical example is two mobile robots in a manufacturing cell that coordinate how to share the same <italic>areas</italic> during the execution of their tasks, such as driving the <italic>routes</italic> through the depicted stations. Other applications requiring robots to share task executions are include carrying or pushing a shared load, covering a whole agriculture field or a surveillance area, closing a control loop around other robots&#x2019; sensor capabilities, and platooning in traffic. Task sharing is <italic>the</italic> driving <italic>end-user pull</italic> behind having to spend design and implementation efforts on all the archetypical challenges mentioned above.</p>
</list-item>
</list>
</p>
</sec>
<sec id="s1-4">
<title>1.4 Scope</title>
<p>This paper focuses on the software design of the <bold>coordination</bold> of <italic>runtime decision making</italic>, including data structures, policies, decision-making functionalities, software patterns, and best practices. An implementation using Petri nets, with the purpose of being used within these coordination patterns, is explained and evaluated. As the final validation, the previous patterns are applied to two coordinated navigation cases.</p>
<p>Subjects outside the scope of this study are the <italic>functional algorithms</italic> that define the <italic>behavior</italic> inside activities, the creation of <italic>maps</italic> and <italic>Petri nets</italic>, the <italic>policies</italic> behind the reasons why the <italic>application</italic> takes these decisions, and the <italic>communication functionalities</italic> via which activities exchange the <italic>data</italic> they need from each other to realize their functional behavior.</p>
</sec>
<sec id="s1-5">
<title>1.5 Contributions</title>
<p>The <italic>contributions</italic> of the paper are<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf45">
<mml:math id="m45">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The software mechanisms of coordination, which encompasses everything needed to fire and handle events that allow concurrent activities to coordinate their executions. In particular, this includes the complementary roles of <italic>finite state machines</italic> and <italic>Petri nets</italic> by introducing two non-traditional primitives (the <italic>protocol array</italic> and the <italic>event circular buffer</italic>) that help in the <italic>separation of concerns</italic> (<xref ref-type="bibr" rid="B11">Dijkstra, 1982</xref>) of the mentioned complementary roles within the presented software design.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf46">
<mml:math id="m46">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Explicit awareness of the implementation constraints, which are introduced by the distributed, multi-core computer infrastructure common in modern robotics applications. In particular, this includes ensuring event data consistency between concurrent activities via <italic>circular buffers</italic> and optimizing execution efficiency by exploiting <italic>data locality</italic> and <italic>cache awareness.</italic>
</p>
</list-item>
</list>
</p>
</sec>
</sec>
<sec id="s2">
<title>2 Related work</title>
<p>The coordination of components is only one of the necessary &#x201c;concerns&#x201d; that large-scale &#x201c;cyber&#x2013;physical&#x201d; systems must deal with. It fits into the broader context of the &#x201c;5Cs&#x201d; approach of making systems-of-systems software architecture (<xref ref-type="bibr" rid="B6">Bruyninckx, 2023</xref>; <xref ref-type="bibr" rid="B18">Klotzb&#xfc;cher et al., 2012</xref>; <xref ref-type="bibr" rid="B25">Radestock and Eisenbach, 1996</xref>; <xref ref-type="bibr" rid="B29">Vanthienen et al., 2014</xref>). The five parts of the 5Cs meta model are<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf47">
<mml:math id="m47">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Computation: the functional behavior inside each activity.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf48">
<mml:math id="m48">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Communication: the data exchange behavior between activities.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf49">
<mml:math id="m49">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Coordination: the decision making behavior in and between activities.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf50">
<mml:math id="m50">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Configuration: adapting each activity&#x2019;s behavior to the actual context.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf51">
<mml:math id="m51">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Composition: the integration of the previous four parts at the &#x201c;levels&#x201d; of activity, component, system, and system-of-systems architecture.</p>
</list-item>
</list>
</p>
<p>Each of the first four &#x201c;Cs&#x201d; can, in itself, be a full or partial sub-system of the &#x201c;5Cs&#x201d;. A very established pattern within the coordination &#x201c;C&#x201d; is that of the life cycle state machine (LCSM), responsible for the &#x201c;top-level&#x201d; coordination <italic>inside one single activity</italic>: to create, to start up, to execute, to pause, to reconfigure, and to shut down activities (and the resources they manage) in predictable and composable ways. One single robot will have many activities (sensing, control, world modeling, task execution, etc.), each with its own LCSM, and the focus of this paper is to explain how to maintain the coordination between all these LCSMs, which is where the Petri nets come into play.</p>
<p>Petri nets have been widely used for <italic>modeling concurrent activities/processes</italic> (e.g., to analyze the concurrency behavior of several activities with respect to deadlock analysis or reachability analysis), and their <italic>implementations</italic> come in various forms depending on the use case context in which they are deployed. The implementation proposed by <xref ref-type="bibr" rid="B8">Davidrajuh (2010)</xref> has been widely used with MATLAB integration for Petri net modeling, simulation, and performance analysis. In the case of generalized stochastic Petri nets, the implementation proposed by <xref ref-type="bibr" rid="B12">Dingle et al. (2009)</xref> provides an open-source tool for design and analysis. The TINA toolbox (<xref ref-type="bibr" rid="B3">Berthomieu et al., 2004</xref>) offers a broad set of tools for the construction and analysis of Petri nets and timed Petri nets, which has been extensively used in academia. IOPT-Tools (<xref ref-type="bibr" rid="B23">Pereira et al., 2022;</xref> <xref ref-type="bibr" rid="B16">Gomes et al., 2010</xref>) provide a framework for the automatic generation of controller code from a modeled Petri net. Developments toward the implementation of Petri nets for microcontrollers have been researched by <xref ref-type="bibr" rid="B19">Ku&#x10d;era et al. (2020)</xref>, providing a framework to model timed interpreted Petri nets to be used in Arduino devices.</p>
<p>While these implementations provide frameworks to work with Petri nets for different purposes, they are not focused on optimization for low-latency execution. This focus is a primary motivator for the research presented in this paper because modern robotic applications must coordinate several activities such as control, perception, world modeling, and task monitoring, many of which expect <italic>real-time determinism</italic> (<xref ref-type="bibr" rid="B1">Abdellatif et al., 2013</xref>). <xref ref-type="bibr" rid="B24">Piedrafita and Villarroel (2011)</xref> analyzed the execution dynamics of four different Petri net <italic>software</italic> implementation techniques, whose performance is evaluated with the same Petri net models as in this paper.</p>
<p>For robotics applications, <xref ref-type="bibr" rid="B32">Ziparo et al. (2011)</xref> used Petri nets as models for multi-body and multi-robot execution and planning. Their modeling within a multi-robot context is analyzed by <xref ref-type="bibr" rid="B7">Costelha and Lima (2007)</xref>, investigating deadlocks and reachability. <xref ref-type="bibr" rid="B14">Figat et al. (2017)</xref> and <xref ref-type="bibr" rid="B13">Figat and Zieli&#x144;ski (2022)</xref> focused on, respectively, hierarchical finite state machines and Petri nets. <xref ref-type="bibr" rid="B31">Zhou et al. (2017)</xref> used a hierarchical FSM for the control of a navigation base with a manipulator, where one FSM is embedded into a higher FSM. <xref ref-type="bibr" rid="B20">Lacerda and Lima (2019)</xref> generated Petri nets for the coordination of a fleet of robots according to the time logic constraints of the coordinated execution.</p>
</sec>
<sec sec-type="methods" id="s3">
<title>3 Methodology</title>
<p>The focus of this paper is on three of the &#x201c;5Cs&#x201d; software concerns:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf52">
<mml:math id="m52">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Coordination</italic> : managing the interactions between a (possible large) set of concurrently executing <italic>activities</italic> using flags, events, finite state machines, and Petri nets as the sufficient mechanisms.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf53">
<mml:math id="m53">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Configuration</italic>: allowing application developers to steer the <italic>execution efficiency</italic> of their applications: 1) the <italic>pre-processing</italic> of data structures used by the coordination primitives at runtime and 2) the <italic>event firing and handling</italic> mechanisms that each <italic>coordinated activity</italic> needs to interact with the <italic>coordinating activity.</italic>
</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf54">
<mml:math id="m54">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Communication</italic>: facilitating the exchange of <italic>events</italic> between the finite state machines in the <italic>coordinated activities</italic> on the one hand and the <italic>coordinating mediator&#x2019;</italic>s Petri net on the other hand.</p>
</list-item>
</list>
</p>
<p>In addition to the <italic>separation of concerns</italic> (<xref ref-type="bibr" rid="B11">Dijkstra, 1982</xref>) that already come with the &#x201c;5Cs&#x201d; approach, this paper adds other separations of concerns pertaining to the design of the <italic>inside</italic> of the relevant &#x201c;5Cs&#x201d; components. More concretely, the design of the <italic>data structures</italic> and <italic>operators</italic> needed to implement the envisaged coordination mechanisms.</p>
<sec id="s3-1">
<title>3.1 Coordination mechanisms</title>
<p>The mechanisms needed for the coordination of activities are conceptually very simple: <italic>flags</italic>, <italic>events</italic>, <italic>Petri nets</italic>, and <italic>finite state machines</italic> (<xref ref-type="sec" rid="s1-2">Section 1.2</xref>).</p>
<p>A <italic>finite state machine</italic> (<xref ref-type="bibr" rid="B17">Hr&#xfa;z and Zhou, 2007</xref>; <xref ref-type="bibr" rid="B21">Mealy, 1955</xref>) models the <italic>discrete behaviors</italic> of one <italic>single activity</italic>. Its four data structures are the <italic>sets</italic> of 1) <italic>states</italic> that the activity can be in, 2) <italic>transitions</italic> that are allowed between states, 3) <italic>events</italic> that can trigger <italic>transitions</italic>, and 4) <italic>flags</italic> whose status is linked with (a subset of) the <italic>events</italic>. The latter is added to the <italic>mathematical</italic> representation of an FSM in <xref ref-type="sec" rid="s1-2">Section 1.2</xref> to allow the <italic>interaction</italic> between an FSM and a Petri net. Its functions are 1) to process the list of available <italic>events</italic>, 2) to compute which <italic>transition</italic> each of those events will trigger (when processed in order of arrival), and 3) to adapt the above-mentioned data structures accordingly.</p>
<p>From a <italic>software implementation</italic> point of view (but <italic>not</italic> from a semantics point of view), finite state machines are just a boundary case of Petri nets: the former has a constraint on the number of &#x201c;tokens,&#x201d; namely, <italic>exactly one</italic> in the whole set of &#x201c;states.&#x201d; <xref ref-type="fig" rid="F2">Figure 2</xref> shows an example of the mapping of an FSM to an equivalent Petri net.</p>
<fig id="F2" position="float">
<label>FIGURE 2</label>
<caption>
<p>A <italic>finite state machine</italic> and the mapping to its equivalent <italic>Petri net</italic>. This mapping constrains the Petri net to have only one connector between any <italic>internal place</italic> and the transitions connected to that place. All other places map to &#x201c;sink&#x201d; or &#x201c;source&#x201d; events; the &#x201c;source&#x201d; places are denoted with small letters, and the &#x201c;sink&#x201d; places are denoted with capital letters. A similar typographical convention is used for input and output events in the finite state machine.</p>
</caption>
<graphic xlink:href="frobt-11-1363041-g002.tif"/>
</fig>
<p>So, this paper focuses on the software design of Petri nets because that of finite state machines differs only in the <italic>configuration</italic> of the resulting library and the <italic>naming</italic> of the implementation primitives. A Petri net model shares the four above-mentioned building blocks with a finite state machine model, but it uses the following specific terminology: a <italic>place</italic> that can contain zero or one <italic>token</italic> as a <italic>marking</italic>, a <italic>transition</italic>, and a <italic>directed arc</italic> between them. The constraint on an arc is that its start and end must be either a place or a transition; in other words, places are only connected to transitions and vice versa. The constraint of a maximum of one token per place is what <xref ref-type="bibr" rid="B22">Murata (1989)</xref> referred to as &#x201c;finite capacity nets of capacity one for all places&#x201d;; other works of literature call it &#x201c;safe Petri nets&#x201d; (<xref ref-type="bibr" rid="B2">Barylska et al., 2017</xref>). A <italic>transition</italic> represents a coordination point in the Petri net: its <italic>input places</italic> represent the conditions to be fulfilled for that synchronization to take place; and its <italic>output places</italic> represent the status changes triggered by the coordination.</p>
<p>In addition to the above-described <italic>data structures</italic>, the Petri net mechanism also has some <italic>operators</italic> (&#x201c;behavior&#x201d;) on these data structures. If each input place of a particular transition has a token, that transition is <italic>enabled</italic>, and <italic>firing</italic> a transition implies that the tokens in its input places are <italic>removed</italic> and the tokens in its output places are <italic>filled</italic>. The token in the <italic>source places</italic> is to be filled by the processing of an <italic>event</italic> that comes from &#x201c;somewhere.&#x201d; Similarly, removing a token from a <italic>sink place</italic> gives rise to sending an event &#x201c;somewhere.&#x201d; The links with that &#x201c;somewhere&#x201d; are discussed in the following section on &#x201c;communication.&#x201d;</p>
<p>Notably, in <xref ref-type="fig" rid="F2">Figure 2,</xref> the FSM and Petri net represent the same process; however, throughout the paper, this is not the case. FSMs are used for the discrete behaviors of single activities, while the Petri nets are used for the coordination across activities. This means there is a match among the FSM states of the coordinated activities and Petri net places of the coordinator; however, they do not present the same process. The latest is illustrated in <xref ref-type="fig" rid="F3">Figure 3</xref>.</p>
<fig id="F3" position="float">
<label>FIGURE 3</label>
<caption>
<p>Examples of the three software mechanisms needed in <italic>interactivity coordination</italic>: A Petri net inside a <italic>coordinating</italic> activity, a finite state machine inside each of the <italic>coordinated</italic> activities, and (an array of) flags for the bookkeeping of which <italic>coordination</italic> &#x201c;<italic>events</italic>&#x201d; have been communicated between both. Capital letters are used for <italic>output events</italic> in the finite state machine and for <italic>sink places</italic> in the Petri net. The colored lines link events and places to locations in the protocol array. The &#x201c;snake-like&#x201d; trajectory through the array represents the temporal order in which the &#x201c;communication&#x201d; takes place between finite state machine events and the marking of places in the Petri net.</p>
</caption>
<graphic xlink:href="frobt-11-1363041-g003.tif"/>
</fig>
</sec>
<sec id="s3-2">
<title>3.2 Communication mechanisms</title>
<p>The finite state machine in each of the <italic>coordinated activities</italic> exchanges <italic>events</italic> with the <italic>coordinating mediator</italic>&#x2019;s Petri net (<xref ref-type="fig" rid="F3">Figure 3</xref>). This is reflected in the structure of the Petri net as follows:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf55">
<mml:math id="m55">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Some input places of transitions do not have any transitions for which they are output places, e.g., p1, p3, and p4 in <xref ref-type="fig" rid="F3">Figure 3</xref>; these are called <italic>source places.</italic> Source places are filled in by the arrival of events to the owner of the Petri net activity. In <xref ref-type="fig" rid="F3">Figure 3</xref>, a token is added to source place p1 when external event 1 (E1) is processed.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf56">
<mml:math id="m56">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Similarly, <italic>sink places</italic> do not have any transitions for which they are the input places, e.g., P2, P5, and P6 in <xref ref-type="fig" rid="F3">Figure 3</xref>. Sink places trigger the sending of events from the owner of the Petri net activity to other connected activities. In <xref ref-type="fig" rid="F3">Figure 3</xref>, sink place P2 causes the triggering of the internally generated event 4 (e4).</p>
</list-item>
</list>
</p>
<p>Source and sink places are the locations where the Petri net is connected to <italic>events</italic> from and to the &#x201c;outside world.&#x201d; <italic>Internal places</italic> are all other places.</p>
<p>The contribution of this paper with respect to <italic>communication</italic> pertains to the introduction of the <italic>protocol</italic> data structure: it <italic>decouples</italic> the <italic>internals</italic> of the finite state machines and Petri nets from the <italic>communication</italic> of the information they need for their coordination.</p>
<p>The protocol contains information regarding which of the two activities involved in the coordination is expected to set the next <italic>flag</italic> in the protocol. This document uses <italic>arrays</italic> as protocol data structures since they are the simplest approach needed to realize the following goal:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf57">
<mml:math id="m57">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Only those events that a coordinated activity or the coordinating activity generates or reacts to &#x201c;end up&#x201d; in the protocol data structure. These are the events that need to be shared between them.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf58">
<mml:math id="m58">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The protocol introduces a <italic>hard constraint</italic> in the order in which these events are allowed/expected to be generated; <xref ref-type="fig" rid="F3">Figure 3</xref> represents this order by the &#x201c;snake-like&#x201d; trajectory through the protocol data structure. In order <italic>to guarantee</italic> the correct execution of the coordination, both coordinated parties must satisfy these hard constraints in the <italic>sequence</italic> in which the relevant events are generated or reacted to by the finite state machine and in which the sink and source places are marked in the Petri net.</p>
</list-item>
</list>
</p>
<p>A flag can be set directly by an activity, or it is the result of processing an event received from that activity. Because of the strict order brought by the protocol, there is no risk that this asynchronous access to the data introduces inconsistency.</p>
</sec>
<sec id="s3-3">
<title>3.3 Configuration mechanisms</title>
<p>This section introduces three software patterns that provide the mechanisms needed <italic>to configure</italic> the coordination between activities. The patterns themselves are not explained in detail because that part of the authors&#x2019; research is beyond the scope of this document. However, they are in use in the experimental demonstration in <xref ref-type="sec" rid="s5">Section 5</xref>. Each of these patterns works at a different <italic>time scale</italic> in the coordination interaction:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf59">
<mml:math id="m59">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Semantic registration</italic> (&#x201c;long term&#x201d;): an activity that needs to be coordinated is registered (by itself or by a &#x201c;third party&#x201d;) for a particular coordination using a <italic>semantic ID.</italic> This ID is a <italic>symbolic</italic> unique identifier used in a <italic>model</italic> of the coordination and, hence, can be retrieved from <italic>persistent storage</italic> or <italic>inter-process communication.</italic>
</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf60">
<mml:math id="m60">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Symbol table data structure</italic> (&#x201c;medium term&#x201d;): it links the <italic>semantic ID</italic> symbol to a (possibly variable) number of &#x201c;resources&#x201d; or &#x201c;components.&#x201d; The table facilitates the discovery, communication, execution, and introspection of the &#x201c;resource&#x201d; at runtime, which can also be done by activities that have been developed independently.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf61">
<mml:math id="m61">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Acquire&#x2013;release</italic> (&#x201c;short term&#x201d;): this pattern structures access to a shared resource by expecting the resource-using activities <italic>to acquire</italic> access from the resource-owning activity and <italic>to release</italic> their granted access explicitly.</p>
</list-item>
</list>
</p>
<p>The <italic>registration</italic> puts the semantic ID into a table (or a &#x201c;map&#x201d;) with (at least) the following columns:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf62">
<mml:math id="m62">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The <italic>semantic ID.</italic>
</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf63">
<mml:math id="m63">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The <italic>name</italic> of the coordinated activity, as used in the <italic>source code</italic> of the implementation.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf64">
<mml:math id="m64">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The <italic>binary pointer(s)</italic> to the memory where the coordination data structure(s) are stored.</p>
</list-item>
</list>
</p>
<p>
<xref ref-type="table" rid="T1">Table 1</xref> shows an example of such a symbol table. The semantic ID itself has two fields, datatype and model. There can be multiple semantic IDs with the same model label, but the tuple (datatype, model) must be unique. Multiple activities can access the same variables, and coordination is done via mutexes.</p>
<table-wrap id="T1" position="float">
<label>TABLE 1</label>
<caption>
<p>Example of a table for <italic>registering</italic> the access of activities to shared resources. This particular example uses a <italic>mutex</italic> to coordinate the access to data structures encoder_t and motor_t, shared by three activities in a robot, control, proprioception, and drive.</p>
</caption>
<table>
<thead valign="top">
<tr>
<th colspan="5" align="left">Semantic ID</th>
</tr>
<tr>
<th align="left">Datatype</th>
<th align="left">Model</th>
<th align="left">Pointer</th>
<th align="left">Mutex</th>
<th align="center">Activity</th>
</tr>
</thead>
<tbody valign="top">
<tr>
<td align="left">encoder_t</td>
<td align="left">Left</td>
<td align="left">0x0a00</td>
<td align="left">0x0a08</td>
<td align="left">Drive and proprioception</td>
</tr>
<tr>
<td align="left">encoder_t</td>
<td align="left">Right</td>
<td align="left">0x0a10</td>
<td align="left">0x0a18</td>
<td align="left">Drive and proprioception</td>
</tr>
<tr>
<td align="left">motor_t</td>
<td align="left">Left</td>
<td align="left">0x0a20</td>
<td align="left">0x0a28</td>
<td align="left">Drive and control</td>
</tr>
<tr>
<td align="left">motor_t</td>
<td align="left">Right</td>
<td align="left">0x0a30</td>
<td align="left">0x0a38</td>
<td align="left">Drive and control</td>
</tr>
</tbody>
</table>
</table-wrap>
<p>The above-mentioned mechanisms are needed for the following reasons:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf65">
<mml:math id="m65">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Unambiguous ownership</italic>: registration <italic>implies</italic> that there is a &#x201c;shared object&#x201d; to register to and that the system developers should make one, and only one, <italic>activity</italic> the responsible &#x201c;owner&#x201d; of that object. (The &#x201c;owning&#x201d; object can be a fully passive library and need not be an activity in itself.)</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf66">
<mml:math id="m66">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Runtime reconfiguration</italic>: because registrations are objects with a lifetime, they can have a life cycle state machine on their own. This is important to coordinate the reconfiguration of the &#x201c;object&#x201d; at runtime and between a changing number of registered activities.</p>
</list-item>
</list>
</p>
<p>This paper focuses on this short-term time scale, hence, on a low-latency implementation of the <italic>acquire&#x2013;release</italic> protocol. The &#x201c;objects&#x201d; in this paper are coordination objects, specifically Petri nets, and the scope of the presented research calls for Petri nets to be created at runtime. For example, in manufacturing or logistics cases, dozens of shared resources occur, to which, at <italic>any time</italic>, two, three, or more robots want access, and those robots can be different ones every time.</p>
</sec>
</sec>
<sec id="s4">
<title>4 Implementation</title>
<p>The focus of the paper is on the software mechanisms that are used to realize coordination between a (possibly large) set of concurrently executing activities. The Petri net model plays a central role within the coordination mechanisms presented in the last section. Therefore, an implementation with the purpose of multi activity coordination is presented.</p>
<p>This paper&#x2019;s <italic>design drivers</italic> of the <italic>implementation</italic> of the <italic>design</italic> discussed in <xref ref-type="sec" rid="s3">Section 3</xref> are typical for <italic>embedded</italic> systems: low-latency and asynchronicity within a shared memory deployment. The presented design is not claimed to be efficient for other use cases, such as the <italic>offline analysis</italic> of Petri nets in search of deadlocks, livelocks, starvation, etc.</p>
<p>One implementation decision is easy to make: while <italic>finite state machines</italic> and <italic>Petri nets</italic> are two complementary coordination mechanisms at the <italic>conceptual</italic> level, their <italic>implementations</italic> are extremely similar; both need &#x201c;states&#x201d; and &#x201c;transitions,&#x201d; with incoming &#x201c;events&#x201d; as triggers of the evaluation of the mechanism, as well as the evaluation&#x2019;s possible outcomes. <xref ref-type="fig" rid="F2">Figure 2</xref> explains the direct mapping of a finite state machine into the equivalent Petri net, so this section restricts itself to the implementation of Petri nets only.</p>
<p>This summary from previous sections is behind the other implementation decisions:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf67">
<mml:math id="m67">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Petri net models are expected to be <italic>generated at runtime</italic> from symbolic <italic>models.</italic> This allows the use of data structures that can exploit the knowledge of the <italic>number</italic> of <italic>places</italic>, <italic>transitions</italic>, and <italic>events.</italic>
</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf68">
<mml:math id="m68">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Petri nets are expected to be <italic>executed in an event loop</italic> of <italic>real-time</italic> activities (<xref ref-type="bibr" rid="B26">Samek and Ward, 2006</xref>). This allows a &#x201c;5Cs&#x201d; design that <italic>pre-empts</italic> the execution when a <italic>maximum number</italic> of transitions, places, and/or events have been processed, with a known impact on the latency this introduces.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf69">
<mml:math id="m69">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The <italic>coordinated activities</italic> typically run <italic>asynchronously</italic> with the <italic>coordinating activity</italic> (that is, the one that executes the Petri net). Hence, measures have to be taken to guarantee <italic>data consistency.</italic> This implementation provides two of these measures: <italic>memory barriers</italic> with acquire and release semantics (<xref ref-type="bibr" rid="B27">Standardization committee C and C&#x2b;&#x2b;, 2017</xref>) and <italic>circular buffers</italic> for <italic>wait-free</italic> exchange of events (<xref ref-type="bibr" rid="B10">Desnoyers and Dagenais, 2012</xref>; <xref ref-type="bibr" rid="B30">Varghese and Lauck, 1987</xref>).</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf70">
<mml:math id="m70">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The target applications are expected to be <italic>always on</italic>, so all of the above-mentioned features must be <italic>(re)configurable.</italic>
</p>
</list-item>
</list>
</p>
<sec id="s4-1">
<title>4.1 Data structures</title>
<p>
<xref ref-type="fig" rid="F4">Figure 4</xref> shows the data structures to represent and execute Petri nets. The data structures above will always be accessed <italic>synchronously</italic> within only the <italic>Petri net executor</italic> activity. The efficiency is designed for the following execution use case:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf71">
<mml:math id="m71">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Computation of the status changes: the Petri net&#x2019;s status is updated as soon as the activity reacts to incoming events. The events are received asynchronously by the Petri net executor activity (in the <italic>communication</italic> part of the activity&#x2019;s event loop, <xref ref-type="sec" rid="s12">Supplementary Appendix SA</xref>), and our design uses <italic>circular buffers</italic> for this purpose. Circular buffers are also used inside the synchronous part to encode the &#x201c;to-do lists&#x201d; of places and transitions that need processing based on the incoming events. The buffers make use of <italic>memory barriers</italic> (of the <italic>acquire-release</italic> type, as provided by the <italic>concurrency support</italic> part of the C/C&#x2b;&#x2b; standard libraries) in the trade-off between efficiency of execution and the consistency of data. The latter is a concern to be dealt with by the <italic>application</italic> developers and is introduced by <italic>out-of-order execution</italic> optimizations in modern compilers and CPUs.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf72">
<mml:math id="m72">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Data locality</italic>: the data structures needed in nearby moments in the computations are stored in nearby bytes in physical memory. So, <italic>cache coherence</italic> is optimized in two complementary ways:</p>
<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf73">
<mml:math id="m73">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Minimally sized data structures to keep their status. For example, when there are <inline-formula id="inf74">
<mml:math id="m74">
<mml:mi>N</mml:mi>
</mml:math>
</inline-formula> places, one needs only <inline-formula id="inf75">
<mml:math id="m75">
<mml:mi>M</mml:mi>
</mml:math>
</inline-formula> 8-bit bytes, where <inline-formula id="inf76">
<mml:math id="m76">
<mml:mn>8</mml:mn>
<mml:mo>&#xd7;</mml:mo>
<mml:mi>M</mml:mi>
</mml:math>
</inline-formula> is the smallest number larger than <inline-formula id="inf77">
<mml:math id="m77">
<mml:mi>N</mml:mi>
</mml:math>
</inline-formula>. For example, when there are less than 255 places in a Petri net, one char is enough. Such low numbers are not exceptional in the use cases of this paper because access coordination is almost always very local and between a low number of coordinated activities.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf78">
<mml:math id="m78">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> All data structures are <italic>arrays</italic> of the same type. This reduces the need for <italic>padding</italic> between non-homogeneous parts in the data structures and, hence, indirectly their size as well.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf79">
<mml:math id="m79">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The individual data structures are all <italic>cache line aligned</italic> to avoid <italic>cache trashing.</italic>
</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf80">
<mml:math id="m80">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula>
<italic>Arrays instead of linked lists</italic>: the <italic>semantic IDs</italic> of the representation of places, transitions, and events are mapped to unsigned integers ranging from 0 to an <italic>a priori</italic> known integer value <inline-formula id="inf81">
<mml:math id="m81">
<mml:mi>N</mml:mi>
</mml:math>
</inline-formula>. These integers can then also serve as <italic>indices in arrays</italic> so that the inefficient search through lists is replaced by efficient direct access into the arrays.</p>
</list-item>
</list>
</list-item>
</list>This section uses teletype font, like this, to represent data structures and operations that are used in the software implementation of this paper&#x2019;s concepts. The following data structures represent the <italic>structure</italic> of a Petri net (<xref ref-type="fig" rid="F4">Figure 4</xref>, left):<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf82">
<mml:math id="m82">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> place_to_transitions: this is a <italic>map</italic> (or <italic>symbol table</italic> or <italic>associative array</italic>, <xref ref-type="sec" rid="s3-3">Section 3.3</xref>) to quickly find the <italic>output transitions</italic> of a place with a given ID. It contains i) pointers bi in an array place_to_transitions_pointer to the binary representation of the transition with a given ID and ii) an array place_to_transitions_number containing the number of transitions for the referenced place.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf83">
<mml:math id="m83">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> transition_input_place and transition_output_place: similar to place_to_transition, these maps allow quick access to the output and input places of a given transition.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf84">
<mml:math id="m84">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> sink_places: an array of bits in which each bit represents whether the place is a sink. There is no need to encode whether a place is a <italic>source</italic> or an <italic>internal</italic> place as their behavior does not impact the synchronous execution of the Petri net.</p>
</list-item>
</list>
</p>
<fig id="F4" position="float">
<label>FIGURE 4</label>
<caption>
<p>Overview of the data structures used in this paper&#x2019;s implementation of Petri nets. Left: <italic>to represent</italic> a Petri net. Right: <italic>to execute</italic> a Petri net. Both sets can be <italic>(re)configured</italic> at compilation time or runtime.</p>
</caption>
<graphic xlink:href="frobt-11-1363041-g004.tif"/>
</fig>
<p>The following data structures represent the <italic>synchronous execution status</italic> of a Petri net (<xref ref-type="fig" rid="F4">Figure 4</xref>, right):<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf85">
<mml:math id="m85">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> marking: similar to sink_places, this bit array encodes which places are marked and are, hence, candidates to be processed next.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf86">
<mml:math id="m86">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> places_to_process: this circular buffer (fully inside the <italic>synchronous</italic> context of the coordinating activity) represents the <italic>to-do</italic> list of the IDs of places that must still be inspected to detect <italic>enabled</italic> transitions. In addition, the size of this array can be kept minimal, given the knowledge of the number of places. It also does not make sense to put one particular place more than once on this <italic>to-do</italic> list.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf87">
<mml:math id="m87">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> places_to_skip: this circular buffer represents the list of the IDs of places that still have to be processed, but whose processing has been postponed until the next run of the event loop. Because of the <italic>event loop</italic> context and the <italic>deterministic low-latency</italic> driver, the system developers can decide to limit the number of places on the to-do list that will be processed in each run of the event loop and the number of times such processing is done. This approach provides a <italic>configurable trade-off</italic> between reactivity and deterministic execution time via the configuration variables below.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf88">
<mml:math id="m88">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> is_place_already_in_buffer: these bit arrays remember whether a place is already being checked to avoid the repetition of processing within the same execution loop.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf89">
<mml:math id="m89">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> marking_history: this array of <inline-formula id="inf90">
<mml:math id="m90">
<mml:mi>L</mml:mi>
</mml:math>
</inline-formula> unsigned integers contains counters indicating how many times each place in the Petri net <italic>has been processed</italic> during this event loop execution.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf91">
<mml:math id="m91">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> max_number_of_loops: this defines the maximum number of times a place <italic>can be processed</italic> per event loop execution before loop&#x2019;s execution is preempted.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf92">
<mml:math id="m92">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> transitions_to_fire and is_transition_already_in_buffer: these serve similar functions to places_to_process and is_place_already_in_buffer but are used for processing of transitions instead of places.</p>
</list-item>
</list>
</p>
<p>In order to reduce the <italic>cache missing</italic> latency when accessing all these data structures, they should be aligned on cache lines, including padding the last needed cache line with empty bytes.</p>
</sec>
<sec id="s4-2">
<title>4.2 Discussion</title>
<p>The presented design aims to improve execution latency at the cost of some extra memory in the data structures:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf93">
<mml:math id="m93">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The data structures place_to_transition and transition_input_place <italic>both</italic> encode the connection of outgoing arcs from places to transitions of the Petri net. This redundancy in memory allows faster lookups in the Petri net execution loop.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf94">
<mml:math id="m94">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The IDs to process in the circular buffers transitions_to_fire and places_to_fire correspond one-on-one to the flags marked in the status buffers is_place_already_in_buffer and is_transition_already_in_buffer. Every time a new entry is added to the circular buffers, it is also added to the status buffers. This is, strictly speaking, redundant information, but this redundancy yields fast verification of what is already in the <italic>to-do lists</italic>, hence avoiding repeated processing of the same data.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf95">
<mml:math id="m95">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> A similar motivation is behind the design of the data structures sink_to_events and sink_index, which also contain redundant information about the mapping from place ID to sink ID.</p>
</list-item>
</list>Installation instructions, examples, and the code for the implementation of Petri nets explained in this paper are available in<xref ref-type="fn" rid="fn1">
<sup>1</sup>
</xref>.</p>
</sec>
<sec id="s4-3">
<title>4.3 Results for generation and execution performance</title>
<p>To evaluate the execution time of the previous Petri net implementation, five Petri net models presented by <xref ref-type="bibr" rid="B24">Piedrafita and Villarroel (2011)</xref> have been built in the library. The range for scaling the size of the Petri nets is taken from the same reference. The Petri net models built were as follows:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf96">
<mml:math id="m96">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> SEQ: Petri nets of <italic>p</italic> sequential processes.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf97">
<mml:math id="m97">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> PR1: Petri nets of <italic>p</italic> sequential processes with two states and one shared resource.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf98">
<mml:math id="m98">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> P1R: Petri nets of one sequential process with <italic>p</italic> resources.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf99">
<mml:math id="m99">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> PH: Petri net of the philosophers&#x2019; problem with <italic>p</italic> philosophers.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf100">
<mml:math id="m100">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> SQUARE: Petri nets of <italic>p</italic> sequential processes with <italic>p-1</italic> resources.</p>
</list-item>
</list>
</p>
<p>Within this context, two tests were performed: 1) performance test with immediate firing of one transition; in this case, the execution time of 2,000 triggered transitions is measured. 2) Test with immediate firing of all transitions in the net; this type of test is expected as it marks the maximum reaction time for the complete evaluation of the Petri net. In the latest test, all the transitions of the Petri net will be enabled and triggered in each loop as the Petri net is saturated. The execution time is measured for 2,000 loops for each Petri net. The tests have been run on an HP ZBook Firefly 14 G7 Mobile Workstation.</p>
<p>The X-axis in <xref ref-type="fig" rid="F5">Figures 5</xref>, <xref ref-type="fig" rid="F6">6</xref> marks the computation time, while the Y-axis is the scaling parameter, which denotes the number of sub nets in the Petri net [as described by <xref ref-type="bibr" rid="B24">Piedrafita and Villarroel (2011)</xref>]. <xref ref-type="fig" rid="F5">Figure 5</xref> (left) presents the generation time for the Petri nets. The generation time comprises both memory allocation for the data structures in <xref ref-type="fig" rid="F4">Figure 4</xref> and its initialization. For the Petri net models SEQ, PR1, PH, and P1R, the allocation time is dominant over the initialization time, making the generation time stable within the order of nets tested. In the case of SQUARE, as the size of the net scales quadratically, the initialization time dominates.</p>
<fig id="F5" position="float">
<label>FIGURE 5</label>
<caption>
<p>Generation (left) and execution (right) time results for different Petri net models. Execution time refers to transition triggering in the net 2,000 times.</p>
</caption>
<graphic xlink:href="frobt-11-1363041-g005.tif"/>
</fig>
<fig id="F6" position="float">
<label>FIGURE 6</label>
<caption>
<p>Time results for different Petri net design executions. Execution of all transitions enabled in the net 2,000 times.</p>
</caption>
<graphic xlink:href="frobt-11-1363041-g006.tif"/>
</fig>
<p>
<xref ref-type="fig" rid="F5">Figure 5</xref> (right) shows the performance of the execution of firing one transition per Petri net evaluation. In the case of SEQ, PR1, PH, and P1R, the execution time does not escalate with size, as the number of filled outgoing places from transitions is constant. In the case of SQUARE Petri nets, as the scale factor increases, the number of places to be filled after triggering a transition increases proportionally. <xref ref-type="fig" rid="F6">Figure 6</xref> shows the execution of saturated Petri nets. The execution time grows linearly for the Petri net models SEQ, PR1, PH, and P1R. This is expected because the number of evaluations is proportional to the number of places in the net. With the same logic, the time for the SQUARE Petri nets grows quadratically with respect to the scale parameter.</p>
<p>As the Petri nets are saturated in the second set of tests (<xref ref-type="fig" rid="F6">Figure 6</xref>), the time in the graphs is taken as an upper bound for the processing time of the Petri net. For instance, a sequential Petri net with 20 processes can take up to 722 ns (1.44 ms/2,000) in the case of all processes coordinated from a mediator.</p>
</sec>
</sec>
<sec id="s5">
<title>5 Experimental validation</title>
<p>The design and best practices proposed in this article were applied in an experimental setup with two autonomous mobile robots (AMRs) operating in an area with a pre-defined traffic layout. The demonstration case is an artificial scenario of an emergency AMR entering an area with an AMR operating at a lower speed. According to the situation, the slower robot has to reconfigure its execution at discrete and continuous levels in order to let the emergency AMR overtake. Moreover, for the coordination in the shared area, a mediator is introduced to ensure the execution of the synchronization of the AMRs.</p>
<sec id="s5-1">
<title>5.1 Robot setup</title>
<p>
<xref ref-type="fig" rid="F7">Figure 7</xref> shows one of the identical mobile platforms and the 5C activity components running on the onboard computer. Each platform is equipped with an active KELO drive 100, a Hokuyo URG-04LX LiDAR Sensor, and an ODROID XU4 Embedded Computer. In each robot, the following activities are running:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf101">
<mml:math id="m101">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Mobile platform drive</italic>: this receives sensor data and transmits wheel setpoints via EtherCAT to the KELO wheel drive.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf102">
<mml:math id="m102">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Proprioception</italic>: this estimates the relative motion of the vehicle using wheel encoders (dead-reckoning).</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf103">
<mml:math id="m103">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>LiDAR</italic>: this captures range data via a serial interface from the Hokuyo URG-04LX.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf104">
<mml:math id="m104">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Navigation</italic>: this detects and tracks features in the environment (perception) and computes the steering and forward speed commands to perform a desired maneuver (control).</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf105">
<mml:math id="m105">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Adaptive free-space motion tube</italic>: this evaluates and adapts the control commands provided by the navigation activity to ensure that the vehicle moves within the free-space.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf106">
<mml:math id="m106">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Control</italic>: this transform control commands (steering and speed) to KELO wheel setpoints.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf107">
<mml:math id="m107">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Communication</italic>: exchanges data with other processes.</p>
</list-item>
</list>
</p>
<fig id="F7" position="float">
<label>FIGURE 7</label>
<caption>
<p>Mobile platform, hardware view (left), and thread and activities running on the onboard computer (right). Activities running in the same process exchange data via shared memory. Some of the data chunks accessed via shared memory are illustrated in small colored circles.</p>
</caption>
<graphic xlink:href="frobt-11-1363041-g007.tif"/>
</fig>
<p>These seven activities are registered in five threads (represented in different colors in <xref ref-type="fig" rid="F7">Figure 7</xref>) running at different frequencies. The five threads run in a single multi-threaded process, which allows for efficient in-memory data exchange among the different components. <xref ref-type="fig" rid="F7">Figure 7</xref> shows some examples of data shared between the activities in colored circles. For that, the variables (objects) need to be first registered in the symbol table with a semantic ID (name and datatype) by the activity owning the resource, e.g., &#x201c;LiDAR measurements,&#x201d; range_scan_t is registered by the LiDAR activity. For access to a shared variable, first, an activity requests the data pointers corresponding to a particular semantic ID (configuration) from the symbol table. After that, it can read the values (using acquire/release) directly from the memory without going through the symbol table (communication).</p>
<p>The traffic layout consists of semantic areas that are anchored in environmental features perceived by the robot (corridor and dead-ends). <xref ref-type="fig" rid="F8">Figure 8</xref> shows the control and perception layers of the semantic map. A solid black box around the map indicates solid walls detected by the LiDAR, while dashed black lines limit semantic areas in each of the layers. The control layer indicates the maneuver that a robot is expected to perform: move forward, make a U-turn, or stop. It also encodes constraints such as limits for driving velocity and deviation from the lane. The perception layer shows the feature that the robot has to track in different colored rectangles labeled as &#x201c;A,&#x201d; &#x201c;B,&#x201d; and &#x201c;C.&#x201d; For example, in area &#x201c;A&#x201d; (green), the robot resorts to a corridor detection and tracking algorithm for estimating its relative orientation and lateral position with respect to the corridor. In area &#x201c;C&#x201d; (yellow), the robot also tracks its relative longitudinal position with respect to the end of the solid wall at the end of the lane. The reason for the different perception behaviors is due to the finite range of the sensor, which is limited by <inline-formula id="inf108">
<mml:math id="m108">
<mml:msub>
<mml:mrow>
<mml:mi>r</mml:mi>
</mml:mrow>
<mml:mrow>
<mml:mi>max</mml:mi>
</mml:mrow>
</mml:msub>
</mml:math>
</inline-formula>. The robot does not continuously search for the solid wall at the end of the lane but only when it reaches area &#x201c;B&#x201d; (blue).</p>
<fig id="F8" position="float">
<label>FIGURE 8</label>
<caption>
<p>Illustration of the control and perception layers of the semantic map designed for the experimental validation. These layers encode the expected control and perception behaviors of the robot within a particular area. Both layers have several monitors associated with them for triggering the coordination mechanism and reconfiguring the schedule of the navigation activity of the platforms.</p>
</caption>
<graphic xlink:href="frobt-11-1363041-g008.tif"/>
</fig>
<p>The schedule of the navigation activity links together perception, control, and monitoring algorithms in the form of a skill. The schedule of the activity changes at runtime according to the situation due to coordination and (re)configuration. For example, the robot starts in a known location of area &#x201c;A&#x201d; and moves around the circuit. A monitor that uses the information provided by dead-reckoning detects that the robot has reached area &#x201c;B.&#x201d; The schedule of the navigation activity changes: the algorithm for detecting the end of the lane is added to the schedule, along with a monitor that checks whether the quality of the estimation is stable. When the estimation is stable, the schedule of the navigation activity changes once again by adding (end-of-lane controller) and removing (corridor controller) algorithms accordingly.</p>
</sec>
<sec id="s5-2">
<title>5.2 Coordinator setup</title>
<p>For coordination purposes in the semantic area, an area manager is introduced for registering robots in an area and sending events to the robots when necessary. These events will trigger the (re)configuration of the schedule of the robots. The area manager is a multi-threaded process running on a different computer. It has two activities composed according to the 5C paradigm:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf109">
<mml:math id="m109">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Area management</italic>: this keeps track of the coordination state of the area and coordinates the robots if required.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf110">
<mml:math id="m110">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Communication</italic>: this binds and starts the communication with the robots. It is connected through shared memory to the area management activity. It shares a queue with the updates (task progress monitoring) from the robot and sends commands (tasks) from the area management activity in its event loop.</p>
</list-item>
</list>
</p>
<p>In this experiment, the execution of commands from both robots is not coupled, meaning that the autonomous execution of each robot does not implicitly change according to other robots in the area. Instead, the area manager works as a mediator between the two robots, coordinating them.<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf111">
<mml:math id="m111">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The area manager makes the decisions on the interaction behavior: the interaction of the bases with their shared resource (space) is set by the mediator, giving access to the areas it manages through events.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf112">
<mml:math id="m112">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The area manager decouples execution: the area manager is the only &#x201c;agent&#x201d; aware of the complete state of the coordinated execution at the discrete level by keeping the execution state in a Petri net.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf113">
<mml:math id="m113">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The area manager allows execution when the robots have incomplete information of the environment: the robots do not detect each other in the experimental setup proposed, which means that the mediator is required to allow the execution in shared spaces without disruption.</p>
</list-item>
</list>
</p>
<p>There are two acquire&#x2013;release protocols between the area manager and AMRs. One of which is from the robot to the area manager to access the area. When the robot is navigating toward a local area, it has to request access to the area manager. When access is granted, the semantic ID of the robot and its role (normal or emergency robot) are registered in the list of robots coordinated by the area manager. This list contains the robots that &#x201c;own&#x201d; the area (as a passive resource) at a given time.</p>
<p>The area management activity coordinates the interaction of the robots in the area via the following components:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf114">
<mml:math id="m114">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Area state: the record of the robots that have requested entering an area and releasing an area. In case two robots declare they need to enter the same area, the area management activity sends control requests to the robots.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf115">
<mml:math id="m115">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> Petri net state: when coordination among the robots in the area is required, a Petri net model with the coordination in the area gets initialized. On top of the coordinated states in the Petri net, configuration parameters can be added.</p>
</list-item>
</list>
</p>
<p>When coordination is needed among the robots in a given area, a second acquire&#x2013;release interaction is established. The area management activity &#x201c;acquires&#x201d; the discrete control of the AMRs and releases it when the coordination is over. This means that, while the robot normally coordinates itself by executing the skills in its FSM depicted in <xref ref-type="fig" rid="F9">Figure 9</xref>, when coordination happens, this is not the case anymore. When coordinated, the management activity takes control of the AMR at the discrete level via the coordination Petri net (<xref ref-type="fig" rid="F10">Figure 10</xref>), with its connected protocols that trigger the sending of events to the AMRs. While the FSM in the robot is still tracking the execution of the robot, it does not trigger the maneuvers. When the coordinated execution is finished, the area management activity releases the AMR execution with a last shared event and deletes the coordination.</p>
<fig id="F9" position="float">
<label>FIGURE 9</label>
<caption>
<p>Finite state machine of AMRs and navigation map. The states in the finite state machine denote the traversal of the numbered areas according to directional arrows in the map. For example, state 1 would be the navigation in area 1. The input events (light green, at the left-hand side of the slash) among states come from either the navigation or communication activity (from the area manager). The output events (dark green, at the right-hand side of the slash) are triggered by the navigation activity.</p>
</caption>
<graphic xlink:href="frobt-11-1363041-g009.tif"/>
</fig>
<fig id="F10" position="float">
<label>FIGURE 10</label>
<caption>
<p>Petri net and protocols used for coordinating the normal AMR and the emergency AMR in the demonstration. The color legend shows the reading and writing &#x201c;rights&#x201d; for the flags in the protocols. The execution of the coordination at the discrete level according to the coordination in the Petri net: 1) normal AMR crosses area 1. 2) Wait until normal AMR crosses. 3) Emergency AMR is allowed to start its execution in area 1, while normal AMR gets the signal to go to the padding area with higher speed. 4) Wait for normal AMR to be out in area 5 and emergency AMR finishes in area 1. 5) Normal AMR is in padding area while emergency AMR crosses area 2. 6) Wait for emergency to be done in area 2. 7) Emergency AMR can start crossing area 3, and it is released from the coordination. 8) Wait for the normal AMR to go out of the padding area. 9) Normal AMR can start crossing area 3, and it is released from the coordination.</p>
</caption>
<graphic xlink:href="frobt-11-1363041-g010.tif"/>
</fig>
<p>The Petri net used in the demonstration is depicted in <xref ref-type="fig" rid="F10">Figure 10</xref>. The color legend of the image explains the ownership of the places, meaning which activity has control over the events to set the marking in the place. The white places are internal places of the Petri net, which denote the state of the AMRs in the execution. The dark places are source places, which are filled in by the coordinating activity once the corresponding event arrives from the AMRs. The light places are sink places to be filled in by the Petri net execution, triggering the sending of events to the AMRs.</p>
<p>For example, <xref ref-type="fig" rid="F10">Figure 10</xref> shows a case of the sink place &#x201c;Rae1,&#x201d; to which only the area manager has writing access. Its marking is filled in by the triggering of the Petri net. When the place &#x201c;Rae1&#x201d; gets a token, the connected flag &#x201c;e1&#x201d; in the protocol with the communication activity is raised. When the flag &#x201c;e1&#x201d; is raised, an event is sent to the emergency AMR, which indicates it may enter &#x201c;Area 1.&#x201d;</p>
<p>A case of the source place is &#x201c;Radone1.&#x201d; The communication with the emergency AMR has writing access right to the flag &#x201c;done1&#x201d; in the protocol, and the area manager activity reads this flag. When the event arrives from the communication activity connected to the emergency AMR, the flag &#x201c;done1&#x201d; is raised. Once the flag &#x201c;done1&#x201d; is read by the area manager activity, the place &#x201c;Radone1&#x201d; gets a token, and the outgoing transitions can be evaluated to continue with the coordinated execution.</p>
<p>The processing of incoming and outgoing events according to the sources and sinks in the coordination structure of the Petri net in <xref ref-type="fig" rid="F10">Figure 10</xref> allows the execution of the coordinated motions of the robots without disruption. Moreover, apart from the sink and source places, the internal places are added to denote the concurrent state of different activities in the coordination.</p>
</sec>
<sec id="s5-3">
<title>5.3 Execution of experimental demonstration</title>
<p>The management activity remains idle after initialization until two robots are passed to it (along with a communication channel to them). The robots are passed according to their roles in the coordination: normal robot or emergency robot. The emergency robot has priority over the normal robot. The initial state of each robot is informed to the Petri net, which translates to the initial marking.</p>
<p>Once the coordination is properly configured, the event loop of the management activity starts. In the event loop, the management activity processes the messages coming from the AMRs, updating them on the execution progress with respect to the skill they are performing. The activity updates the marking of the coordination Petri net when the events of finished skills are received. After the marking of the Petri net is updated from all robots, the Petri net is triggered. In the case that all the places of a transition have a token, the marking of the Petri net is updated. The updated marking is then passed to the communication modules to send the events coming from the Petri net to the robots.</p>
<p>The area manager is the only activity aware of the coordinated execution but is not responsible for configuring the schedule being executed in the coordinated robots. The change in configuration (e.g., of the normal robot when the emergency AMR is behind) is achieved via events that are sent from the area manager to the robots via the communication channel. These events lead to a change in the configuration of the robots, e.g., emergency AMR needs to slow down because the normal robot is still ahead or the normal robot has to drive to area 5 and wait there.</p>
<p>Once the coordination has finished (the emergency has overtaken the normal robot), the area manager gives back control to the AMRs because there is no need for mediation. Both robots continue their autonomous execution with their initial configuration.</p>
</sec>
<sec id="s5-4">
<title>5.4 Secondary demonstration: area manager for heterogeneous AMRs</title>
<p>The same area manager as in the previous experiment was deployed in a setup with three heterogeneous AMRs. The demonstration case is the access area to docking stations in a warehouse. In this application, coordination is needed to mediate the access to an area that can be used as two lanes by two small AMRs or one lane for a big AMR. The execution of the coordinated robots and the Petri net used can be seen in one of the videos in the multimedia part of this paper.</p>
</sec>
</sec>
<sec sec-type="discussion" id="s6">
<title>6 Discussion</title>
<p>The paper&#x2019;s focus is on the <italic>efficient implementation</italic> of runtime coordination needs in multi-robot applications. Most of the efficiency comes from <italic>knowing in advance</italic> (the sizes and types) of all data structures because that knowledge allows making the most cache-efficient and data locality-driven implementations: (almost) linear-time indexing of data pointers, optimal cache alignment, known maximum usage in both time and space, etc. These efficiencies are typically only possible and useful in <italic>embedded</italic> and/or <italic>real-time</italic> software systems. <italic>Single producer</italic>, <italic>single consumer</italic> event queues, and to-do lists are common practices in this context because it is normal &#x201c;to know everything&#x201d; about such systems.</p>
<p>This section discusses implementation decisions that system developers have to be aware of to make the best use of the presented design:<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf116">
<mml:math id="m116">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Semantic registration</italic> of all primitives involved (activities, Petri nets, etc.): while all data structures and operators presented in this paper can be implemented manually from scratch, they are also designed to allow an even partial and gradual development path toward more <italic>code generation</italic>, from models of the coordination mechanisms to executable code. It is important to consider the most advanced version in the applications, i.e., the version in which these models are &#x201c;downloaded&#x201d; or &#x201c;adapted&#x201d; at runtime and updated code is generated by a running system itself.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf117">
<mml:math id="m117">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Symbol tables</italic> for data sharing: they facilitate data sharing among activities running concurrently. This not only helps the above-mentioned code generation but is also useful in allowing &#x201c;browsing&#x201d; or &#x201c;introspection&#x201d; of a running application: the symbolic names can then be used to navigate from &#x201c;component&#x201d; to &#x201c;component&#x201d; and inspect and/or adapt the local values in these components.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf118">
<mml:math id="m118">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Acquire&#x2013;release</italic> pattern: this pattern is used for acquiring access to write and read the variables kept in the symbol table. At the deepest level of detail, the presented implementation already uses this pattern via the <italic>acquire</italic> and <italic>release</italic> semantics of memory barriers. However, a similar approach can be used at all higher levels of detail, such as to connect two robots to a third one at runtime, where the latter is responsible for the coordination of the unique access to one of its resources by the former two robots. For example, the third robot could let the first robot use its pan-tilt camera.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf119">
<mml:math id="m119">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> The Petri net and finite state machine data structures need only to be known at the time of <italic>runtime software configuration</italic> (that is, not necessarily at <italic>compile time</italic> or even <italic>deployment time</italic>) because memory allocation can be postponed until just before the data structures are used. A <italic>memory pool</italic> approach is also a good fit.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf120">
<mml:math id="m120">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> &#x201c;<italic>Best&#x201d; design of the monitors.</italic> Coordination is, by nature, a <italic>reactive</italic> behavior triggered by <italic>events</italic> that represent that &#x201c;something has happened.&#x201d; Hence, the efficiency and correctness of the coordination tasks in an application are not only realized by the efficiency and correctness of the coordination mechanisms presented in this paper but also by the &#x201c;appropriate&#x201d; design of the <italic>monitors</italic> that are needed to generate the events by monitoring Boolean combinations of status variables that can be spread over several components of the application. Similarly, the events generated by the coordination mechanisms must still be reacted to in an &#x201c;appropriate&#x201d; way via decision-making functions in the relevant system components.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf121">
<mml:math id="m121">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Simultaneous events.</italic> The application context of this paper is that of <italic>concurrent activities</italic>, each of which can generate multiple events and is expected to react to multiple events. No software design is known <italic>to guarantee</italic> that the <italic>order</italic> in which events end up in each activity&#x2019;s event queue is the same temporal order in which these events were generated. Hence, the <italic>system architects</italic> have the responsibility to introduce coordination logic (in FSMs, Petri nets, and protocols) that is &#x201c;<italic>appropriately&#x201d; robust</italic> against such order &#x201c;inversions.&#x201d; To the best of the authors&#x2019; knowledge, the scientific foundations to generate such robust coordination logic are still to be discovered.</p>
</list-item>
<list-item>
<p>
<inline-formula id="inf122">
<mml:math id="m122">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Errors in coordination logic.</italic> Even a perfect software implementation of the mechanisms in this paper cannot guarantee that there are no errors in the coordination logic of the application, possibly leading to deadlocks or livelocks in the overall system.</p>
</list-item>
</list>
</p>
<p>For example, a robot might attempt to enter an area to which it has not yet been granted access to, or it might try to enter another area. System designs can be made more robust by introducing extra monitor activities to detect deadlocks or livelocks when the coordinated activities have not foreseen this monitoring themselves.<list list-type="simple">
<list-item>
<p>
<inline-formula id="inf123">
<mml:math id="m123">
<mml:mo>&#x2022;</mml:mo>
</mml:math>
</inline-formula> <italic>Hierarchy in coordination.</italic> The coordination examples presented in this paper are &#x201c;<italic>flat</italic>&#x201d;: there is one Petri net layer added to the robots&#x2019; individual task controllers. This hides the implicit assumption that the coordinated robots collaborate <italic>only</italic> with the coordinating activity and that the actions that Petri net decides about have no &#x201c;competition&#x201d; of decisions made elsewhere. The authors believe that solutions to these problems are <italic>not</italic> to be found in extra software primitives but in using the presented ones in non-flat, application-specific &#x201c;coordination hierarchies.&#x201d;</p>
</list-item>
</list>
</p>
<p>One reason for introducing such &#x201c;non-flat&#x201d; coordination is to address the <italic>coordination logic errors</italic> of the previous item. In addition to the deadlock/livelock monitors mentioned above, system designs can be made more robust by introducing <italic>pre-emption</italic>: the Petri net and/or finite state machines are extended with places/states that represent a phase in the coordination where that coordination can be pre-empted. In any case, such pre-emption needs coordination itself because all coordinated activities must somehow be brought back into a known and consistent interaction state.</p>
<p>This &#x201c;hierarchical coordination&#x201d; topic is beyond the scope of this paper.</p>
</sec>
</body>
<back>
<sec sec-type="data-availability" id="s7">
<title>Data availability statement</title>
<p>The original contributions presented in the study are included in the article/<xref ref-type="sec" rid="s12">Supplementary Material;</xref> further inquiries can be directed to the corresponding author.</p>
</sec>
<sec id="s8">
<title>Author contributions</title>
<p>MA: conceptualization, investigation, methodology, software, validation, writing&#x2013;original draft, and writing&#x2013;review and editing. RR: conceptualization, methodology, software, validation, writing&#x2013;original draft, and writing&#x2013;review and editing. LV: software, writing&#x2013;original draft, and writing&#x2013;review and editing. HB: conceptualization, methodology, writing&#x2013;original draft, and writing&#x2013;review and editing.</p>
</sec>
<sec sec-type="funding-information" id="s9">
<title>Funding</title>
<p>The author(s) declare that financial support was received for the research, authorship, and/or publication of this article. This work was supported by the Flanders Make projects <italic>AssemblyRecon</italic> (&#x201c;Decision Framework for Assembly System Reconfiguration&#x201d;), <italic>HySLAM</italic> (&#x201c;A Hybrid SLAM approach for autonomous mobile systems&#x201d;), and <italic>CTO action on Cooperative motions</italic> and by the European Horizon 2020 project <italic>RobMoSys</italic> (&#x201c;Composable Models and Software for Robotic Systems&#x201d;) under grant agreement No. 732410.</p>
</sec>
<sec sec-type="COI-statement" id="s10">
<title>Conflict of interest</title>
<p>The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.</p>
</sec>
<sec sec-type="disclaimer" id="s11">
<title>Publisher&#x2019;s note</title>
<p>All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors, and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.</p>
</sec>
<sec id="s12">
<title>Supplementary material</title>
<p>The Supplementary Material for this article can be found online at: <ext-link ext-link-type="uri" xlink:href="https://www.frontiersin.org/articles/10.3389/frobt.2024.1363041/full#supplementary-material">https://www.frontiersin.org/articles/10.3389/frobt.2024.1363041/full&#x23;supplementary-material</ext-link>
</p>
<supplementary-material xlink:href="Supplementaryfile1.pdf" id="SM1" mimetype="application/pdf" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<supplementary-material xlink:href="Video2.mp4" id="SM2" mimetype="application/mp4" xmlns:xlink="http://www.w3.org/1999/xlink"/>
<supplementary-material xlink:href="Video1.mp4" id="SM3" mimetype="application/mp4" xmlns:xlink="http://www.w3.org/1999/xlink"/>
</sec>
<fn-group>
<fn id="fn1">
<label>1</label>
<p>
<ext-link ext-link-type="uri" xlink:href="https://gitlab.kuleuven.be/u0141779/coordination_library.git">https://gitlab.kuleuven.be/u0141779/coordination_library.git</ext-link>
</p>
</fn>
</fn-group>
<ref-list>
<title>References</title>
<ref id="B1">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Abdellatif</surname>
<given-names>T.</given-names>
</name>
<name>
<surname>Combaz</surname>
<given-names>J.</given-names>
</name>
<name>
<surname>Sifakis</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2013</year>). <article-title>Rigorous implementation of real-time systems&#x2014;from theory to application</article-title>. <source>Math. Struct. Comput. Sci.</source> <volume>23</volume>, <fpage>882</fpage>&#x2013;<lpage>914</lpage>. <pub-id pub-id-type="doi">10.1017/s096012951200028x</pub-id>
</citation>
</ref>
<ref id="B2">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Barylska</surname>
<given-names>K.</given-names>
</name>
<name>
<surname>Best</surname>
<given-names>E.</given-names>
</name>
<name>
<surname>Schlachter</surname>
<given-names>U.</given-names>
</name>
<name>
<surname>Spreckels</surname>
<given-names>V.</given-names>
</name>
</person-group> (<year>2017</year>). <article-title>Properties of plain, pure, and safe Petri nets</article-title>. <source>Trans. Petri Nets Other Models concurrecncy. Vol 10470 Lect. notes Comput. Sci.</source>, <fpage>1</fpage>&#x2013;<lpage>18</lpage>. <pub-id pub-id-type="doi">10.1007/978-3-662-55862-1_1</pub-id>
</citation>
</ref>
<ref id="B3">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Berthomieu</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Ribet</surname>
<given-names>P.-O.</given-names>
</name>
<name>
<surname>Vernadat</surname>
<given-names>F.</given-names>
</name>
</person-group> (<year>2004</year>). <article-title>The tool tina&#x2013;construction of abstract state spaces for Petri nets and time Petri nets</article-title>. <source>Int. J. Prod. Res.</source> <volume>42</volume>, <fpage>2741</fpage>&#x2013;<lpage>2756</lpage>. <pub-id pub-id-type="doi">10.1080/00207540412331312688</pub-id>
</citation>
</ref>
<ref id="B4">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Brugali</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Scandurra</surname>
<given-names>P.</given-names>
</name>
</person-group> (<year>2009</year>). <article-title>Component-based robotic engineering (Part I) [Tutorial]</article-title>. <source>IEEE Robotics Automation Mag.</source> <volume>16</volume>, <fpage>84</fpage>&#x2013;<lpage>96</lpage>. <pub-id pub-id-type="doi">10.1109/MRA.2009.934837</pub-id>
</citation>
</ref>
<ref id="B5">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Brugali</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Shakhimardanov</surname>
<given-names>A.</given-names>
</name>
</person-group> (<year>2010</year>). <article-title>Component-based robotic engineering (Part II)</article-title>. <source>IEEE Robotics Automation Mag.</source> <volume>17</volume>, <fpage>100</fpage>&#x2013;<lpage>112</lpage>. <pub-id pub-id-type="doi">10.1109/MRA.2010.935798</pub-id>
</citation>
</ref>
<ref id="B6">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Bruyninckx</surname>
<given-names>H.</given-names>
</name>
</person-group> (<year>2023</year>). <source>Building blocks for complicated and situational aware robotic and cyber-physical systems</source>. <publisher-loc>KU Leuven</publisher-loc>: <publisher-name>Department of Mechanical Engineering</publisher-name>.</citation>
</ref>
<ref id="B7">
<citation citation-type="confproc">
<person-group person-group-type="author">
<name>
<surname>Costelha</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Lima</surname>
<given-names>P.</given-names>
</name>
</person-group> (<year>2007</year>). &#x201c;<article-title>Modelling, analysis and execution of robotic tasks using petri nets</article-title>,&#x201d; in <conf-name>2007 IEEE/RSJ international conference on intelligent robots and systems</conf-name>, <conf-loc>San Diego, CA</conf-loc>, <conf-date>October 29&#x2013;Novamber 02, 2007</conf-date> (<publisher-name>IEEE</publisher-name>), <fpage>1449</fpage>&#x2013;<lpage>1454</lpage>.</citation>
</ref>
<ref id="B8">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Davidrajuh</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2010</year>). <source>
<italic>Gpensim: a new Petri Net simulator</italic> (InTech)</source>.</citation>
</ref>
<ref id="B9">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Delanote</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Van Baelen</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Joosen</surname>
<given-names>W.</given-names>
</name>
<name>
<surname>Berbers</surname>
<given-names>Y.</given-names>
</name>
</person-group> (<year>2008</year>). &#x201c;<article-title>Using AADL to model a protocol stack</article-title>,&#x201d; in <source>IEEE international conference on engineering of complex computer systems</source>, <fpage>277</fpage>&#x2013;<lpage>281</lpage>.</citation>
</ref>
<ref id="B10">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Desnoyers</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Dagenais</surname>
<given-names>M. R.</given-names>
</name>
</person-group> (<year>2012</year>). <article-title>Lockless multi-core high-throughput buffering scheme for kernel tracing</article-title>. <source>ACM SIGOPS Oper. Syst. Rev.</source> <volume>46</volume>, <fpage>65</fpage>&#x2013;<lpage>81</lpage>. <pub-id pub-id-type="doi">10.1145/2421648.2421659</pub-id>
</citation>
</ref>
<ref id="B11">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Dijkstra</surname>
<given-names>E. W.</given-names>
</name>
</person-group> (<year>1982</year>). &#x201c;<article-title>On the role of scientific thought</article-title>,&#x201d; in <source>Selected writings on computing: a personal perspective</source> (<publisher-name>Springer-Verlag</publisher-name>), <fpage>60</fpage>&#x2013;<lpage>66</lpage>.</citation>
</ref>
<ref id="B12">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Dingle</surname>
<given-names>N. J.</given-names>
</name>
<name>
<surname>Knottenbelt</surname>
<given-names>W. J.</given-names>
</name>
<name>
<surname>Suto</surname>
<given-names>T.</given-names>
</name>
</person-group> (<year>2009</year>). <article-title>Pipe2: a tool for the performance evaluation of generalised stochastic Petri nets</article-title>. <source>SIGMETRICS Perform. Eval. Rev.</source> <volume>36</volume>, <fpage>34</fpage>&#x2013;<lpage>39</lpage>. <pub-id pub-id-type="doi">10.1145/1530873.1530881</pub-id>
</citation>
</ref>
<ref id="B13">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Figat</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Zieli&#x144;ski</surname>
<given-names>C.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Parameterised robotic system meta-model expressed by hierarchical Petri nets</article-title>. <source>Robotics Aut. Syst.</source> <volume>150</volume>, <fpage>103987</fpage>. <pub-id pub-id-type="doi">10.1016/j.robot.2021.103987</pub-id>
</citation>
</ref>
<ref id="B14">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Figat</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Zieli&#x144;ski</surname>
<given-names>C.</given-names>
</name>
<name>
<surname>Hexel</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2017</year>). &#x201c;<article-title>FSM based specification of robot control system activities</article-title>,&#x201d; in <source>2017 11th international workshop on robot motion and control RoMoCo (IEEE)</source>, <fpage>193</fpage>&#x2013;<lpage>198</lpage>.</citation>
</ref>
<ref id="B15">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Gamma</surname>
<given-names>E.</given-names>
</name>
<name>
<surname>Helm</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Johnson</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Vlissides</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>1995</year>). <article-title>Design patterns: elements of reusable object-oriented software</article-title>
</citation>
</ref>
<ref id="B16">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Gomes</surname>
<given-names>L.</given-names>
</name>
<name>
<surname>Rebelo</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Barros</surname>
<given-names>J. P.</given-names>
</name>
<name>
<surname>Costa</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Pais</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2010</year>). &#x201c;<article-title>From Petri net models to C implementation of digital controllers</article-title>,&#x201d; in <source>2010 IEEE international Symposium on industrial electronics (IEEE)</source>, <fpage>3057</fpage>&#x2013;<lpage>3062</lpage>.</citation>
</ref>
<ref id="B17">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Hr&#xfa;z</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Zhou</surname>
<given-names>M.</given-names>
</name>
</person-group> (<year>2007</year>). <source>Modeling and control of discrete-event dynamic systems: with Petri Nets and other tools</source>. <publisher-name>Springer</publisher-name>.</citation>
</ref>
<ref id="B18">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Klotzb&#xfc;cher</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Biggs</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Bruyninckx</surname>
<given-names>H.</given-names>
</name>
</person-group> (<year>2012</year>). &#x201c;<article-title>Pure coordination using the Coordinator&#x2013;Configurator pattern</article-title>,&#x201d; in <source>Proceedings of the 3rd international workshop on domain-specific languages and models for robotic systems</source>, <fpage>1</fpage>&#x2013;<lpage>4</lpage>.</citation>
</ref>
<ref id="B19">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Ku&#x10d;era</surname>
<given-names>E.</given-names>
</name>
<name>
<surname>Haffner</surname>
<given-names>O.</given-names>
</name>
<name>
<surname>Draho&#x161;</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Leskovsk&#x1ef3;</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Cig&#xe1;nek</surname>
<given-names>J.</given-names>
</name>
</person-group> (<year>2020</year>). <article-title>PetriNet editor&#x2b; PetriNet engine: new software tool for modelling and control of discrete event systems using Petri nets and code generation</article-title>. <source>Appl. Sci.</source> <volume>10</volume>, <fpage>7662</fpage>. <pub-id pub-id-type="doi">10.3390/app10217662</pub-id>
</citation>
</ref>
<ref id="B20">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Lacerda</surname>
<given-names>B.</given-names>
</name>
<name>
<surname>Lima</surname>
<given-names>P. U.</given-names>
</name>
</person-group> (<year>2019</year>). <article-title>Petri net based multi-robot task coordination from temporal logic specifications</article-title>. <source>Robotics Aut. Syst.</source> <volume>122</volume>, <fpage>1</fpage>&#x2013;<lpage>13</lpage>. <pub-id pub-id-type="doi">10.1016/j.robot.2019.103289</pub-id>
</citation>
</ref>
<ref id="B21">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Mealy</surname>
<given-names>G. H.</given-names>
</name>
</person-group> (<year>1955</year>). <article-title>A method for synthesizing sequential circuits</article-title>. <source>Bell Syst. Tech. J.</source> <volume>34</volume>, <fpage>1045</fpage>&#x2013;<lpage>1079</lpage>. <pub-id pub-id-type="doi">10.1002/j.1538-7305.1955.tb03788.x</pub-id>
</citation>
</ref>
<ref id="B22">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Murata</surname>
<given-names>T.</given-names>
</name>
</person-group> (<year>1989</year>). <article-title>Petri nets: properties, analysis and applications</article-title>. <source>Proc. IEEE</source> <volume>77</volume>, <fpage>541</fpage>&#x2013;<lpage>580</lpage>. <pub-id pub-id-type="doi">10.1109/5.24143</pub-id>
</citation>
</ref>
<ref id="B23">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Pereira</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Moutinho</surname>
<given-names>F.</given-names>
</name>
<name>
<surname>Costa</surname>
<given-names>A.</given-names>
</name>
<name>
<surname>Barros</surname>
<given-names>J.-P.</given-names>
</name>
<name>
<surname>Campos-Rebelo</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Gomes</surname>
<given-names>L.</given-names>
</name>
</person-group> (<year>2022</year>). &#x201c;<article-title>Iopt-tools&#x2013;from executable models to automatic code generation for embedded controllers development</article-title>,&#x201d; in <source>International conference on applications and theory of Petri nets and concurrency</source> (<publisher-name>Springer</publisher-name>), <fpage>127</fpage>&#x2013;<lpage>138</lpage>.</citation>
</ref>
<ref id="B24">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Piedrafita</surname>
<given-names>R.</given-names>
</name>
<name>
<surname>Villarroel</surname>
<given-names>J. L.</given-names>
</name>
</person-group> (<year>2011</year>). <article-title>Performance evaluation of Petri nets centralized implementation. the execution time controller</article-title>. <source>Discrete Event Dyn. Syst.</source> <volume>21</volume>, <fpage>139</fpage>&#x2013;<lpage>169</lpage>. <pub-id pub-id-type="doi">10.1007/s10626-010-0090-7</pub-id>
</citation>
</ref>
<ref id="B25">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Radestock</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Eisenbach</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>1996</year>). &#x201c;<article-title>Coordination in evolving systems</article-title>,&#x201d; in <source>Trends in distributed systems. CORBA and beyond</source> (<publisher-name>Springer-Verlag</publisher-name>), <fpage>162</fpage>&#x2013;<lpage>176</lpage>.</citation>
</ref>
<ref id="B26">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Samek</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Ward</surname>
<given-names>R.</given-names>
</name>
</person-group> (<year>2006</year>). <article-title>Build a super simple tasker</article-title>. <source>Embed. Syst. Des.</source> <volume>19</volume>, <fpage>18</fpage>&#x2013;<lpage>37</lpage>.</citation>
</ref>
<ref id="B27">
<citation citation-type="journal">
<collab>Standardization committee C and C&#x2b;&#x2b;</collab> (<year>2017</year>). <article-title>Memory barriers in the C standard</article-title>. <source>CPP Reference.com</source>.</citation>
</ref>
<ref id="B28">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Van Baelen</surname>
<given-names>S.</given-names>
</name>
<name>
<surname>Peeters</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Bruyninckx</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Pilozzi</surname>
<given-names>P.</given-names>
</name>
<name>
<surname>Slaets</surname>
<given-names>P.</given-names>
</name>
</person-group> (<year>2022</year>). <article-title>Dynamic semantic world models and increased situational awareness for highly automated inland waterway transport</article-title>. <source>Front. Robotics AI</source> <volume>8</volume>, <fpage>739062</fpage>&#x2013;<lpage>739071</lpage>. <pub-id pub-id-type="doi">10.3389/frobt.2021.739062</pub-id>
</citation>
</ref>
<ref id="B29">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Vanthienen</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Klotzb&#xfc;cher</surname>
<given-names>M.</given-names>
</name>
<name>
<surname>Bruyninckx</surname>
<given-names>H.</given-names>
</name>
</person-group> (<year>2014</year>). <article-title>The 5C-based architectural Composition Pattern: lessons learned from re-developing the iTaSC framework for constraint-based robot programming</article-title>. <source>J. Softw. Eng. Robotics</source> <volume>5</volume>, <fpage>17</fpage>&#x2013;<lpage>35</lpage>. <pub-id pub-id-type="doi">10.6092/JOSER_2014_05_01_p17</pub-id>
</citation>
</ref>
<ref id="B30">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Varghese</surname>
<given-names>G.</given-names>
</name>
<name>
<surname>Lauck</surname>
<given-names>A.</given-names>
</name>
</person-group> (<year>1987</year>). &#x201c;<article-title>Hashed and hierarchical timing wheels: data structures for the efficient implementation of a timer facility</article-title>,&#x201d; in <source>Proceedings of the eleventh ACM symposium on operating systems principles</source>, <fpage>25</fpage>&#x2013;<lpage>38</lpage>.</citation>
</ref>
<ref id="B31">
<citation citation-type="book">
<person-group person-group-type="author">
<name>
<surname>Zhou</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Min</surname>
<given-names>H.</given-names>
</name>
<name>
<surname>Lin</surname>
<given-names>Y.</given-names>
</name>
<name>
<surname>Zhang</surname>
<given-names>S.</given-names>
</name>
</person-group> (<year>2017</year>). &#x201c;<article-title>A robot architecture of hierarchical finite state machine for autonomous mobile manipulator</article-title>,&#x201d; in <source>Intelligent robotics and applications: 10th international conference, ICIRA 2017, wuhan, China, august 16&#x2013;18, 2017, proceedings, Part III 10</source> (<publisher-name>Springer</publisher-name>), <fpage>425</fpage>&#x2013;<lpage>436</lpage>.</citation>
</ref>
<ref id="B32">
<citation citation-type="journal">
<person-group person-group-type="author">
<name>
<surname>Ziparo</surname>
<given-names>V. A.</given-names>
</name>
<name>
<surname>Iocchi</surname>
<given-names>L.</given-names>
</name>
<name>
<surname>Lima</surname>
<given-names>P. U.</given-names>
</name>
<name>
<surname>Nardi</surname>
<given-names>D.</given-names>
</name>
<name>
<surname>Palamara</surname>
<given-names>P. F.</given-names>
</name>
</person-group> (<year>2011</year>). <article-title>Petri net plans: a framework for collaboration and coordination in multi-robot systems</article-title>. <source>Aut. Agents Multi-Agent Syst.</source> <volume>23</volume>, <fpage>344</fpage>&#x2013;<lpage>383</lpage>. <pub-id pub-id-type="doi">10.1007/s10458-010-9146-1</pub-id>
</citation>
</ref>
</ref-list>
</back>
</article>