<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <issn pub-type="ppub">1613-0073</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Teaching scheduling and routing algorithms through animations with the JMCH component of JMT</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Marco Gribaudo</string-name>
          <email>marco.gribaudo@polimi.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giuseppe Serazzi</string-name>
          <email>giuseppe.serazzi@polimi.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Lorenzo Torri</string-name>
          <email>lorenzo.torri@virgilio.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Workshop</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dip. di Elettronica, Informazione e Bioingegneria, Politecnico di Milano</institution>
          ,
          <addr-line>via Ponzio 34/5, 20133 Milano</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper focuses on describing a new feature of the Java Modelling Classroom Helper (JMCH), one of the tools of the Java Modelling Tools (JMT) suite, which aims to provide better educational potential in teaching scheduling and routing policies within queueing networks. A controlled animation scenario has been implemented that allows users to follow the behavior of the algorithms via graphical animation through an intuitive user interface and evaluate their performance. Users are gradually introduced to the complexity of the scheduling algorithms, and learn the impact of each policy decision as they go through the implemented models. Several scheduling and routing algorithms are considered together with four distributions of service times and arrival processes. The results of the animated model are summarized in tables and compared with the values of the correspondent metrics obtained by simulation with JSIM.</p>
      </abstract>
      <kwd-group>
        <kwd>routing algorithms</kwd>
        <kwd>job scheduling</kwd>
        <kwd>teaching aid</kwd>
        <kwd>queueing networks</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>CEUR</p>
      <p>ceur-ws.org
available to control both the animation and the executions of the jobs, such as the number of requests
generated by the source, the number of dropped requests, the animation length, the animation speed,
the seed of the random number generator.</p>
      <p>
        Furthermore, the animated models are also solved with the JSIM simulator and the results are summarized
in rows of a table, allowing an immediate comparisons with those obtained from animations.
The animation characteristics of the M/M/c/K queuing models are described in Sect.3.3, scheduling
algorithms are described in Sect.3.1 while those of the routing algorithms are described in Sect.3.2.
2. JMT
The Java Modelling Tools (JMT) is a open source suite of six tools that aims to provide a comprehensive
framework for performance engineering and capacity planning of digital infrastructures. Analytical and
simulation techniques are applied to solve the Queueing Networks and Petri Nets models implemented
with the tools [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>The current stable version of the suite includes six Java applications:
1. JSIMgraph - Queueing networks and Petri nets simulator with graphical user interface
2. JSIMwiz - Queueing network and Petri net simulator with wizard-based user interface
3. JMVA - Mean Value Analysis and Approximate solution algorithms for Queueing network models
4. JABA - Asymptotic Analysis and bottlenecks identification of Queueing network models
5. JWAT - Workload characterization from log data
6. JMCH - Modelling Classroom Helper for learning scheduling algorithms through animations</p>
      <p>
        The most popular tool of JMT is JSIMgraph, since it allows to define and analyze models in a user
friendly way. It supports several modelling primitives, allowing to study multiformalism models [
        <xref ref-type="bibr" rid="ref5">5, 6</xref>
        ]
with the direct interaction of Petri Nets, Queueing Network, as well as custom primitives to model
fork-join and distributed applications. Multiformalism models are very attractive [7] since they allow
users to combine the power of diferent modelling languages, exploiting the best features that each one
can ofer [ 8]. Figure 2 shows an example of a multiformalism JSIMgraph model for dynamically routing
arriving request spikes [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] to a dedicated Spike Server.
      </p>
    </sec>
    <sec id="sec-2">
      <title>3. JMCH - The global structure</title>
      <p>The starting screen of JMCH (Fig.3) allows the selection of the algorithms that can be analyzed via
animation: five scheduling algorithms of a single queueing station, three routing algorithms of a network of
three queueing stations, and the Markov Chain states of a queueing station with diferent configurations.</p>
      <sec id="sec-2-1">
        <title>3.1. Scheduling Algorithms</title>
        <p>The system considered in this section consists of a single queueing station with one queue of requests
(also referred to as req or job) waiting for the service and one or more servers. When a server is
free one request is selected from the queue and its execution starts. The decision of which request
must be selected from the queue depends on the scheduling discipline. We implemented four
nonpreemptive algorithms (FCFS First Come First Served, LCFS Last Come First Served, SJF
Shortest Job First, LJF Longest Job First) and the PS Processor Sharing. The graphical
representation of the movement of requests in the station required the introduction of some limitations
in the system architecture. First, we limited the capacity of the queue to five requests waiting for the
execution. Thus the maximum number of requests in the station is five plus the requests in the servers.
For simplicity, in what follows we consider a station with one server. Requests arriving when the queue
is full are dropped. The use of the drop policy allows to expand the types and characteristics of the
arrival processes that can be considered. In this way, even arrivals that saturate the system can be
shown by the animation.</p>
        <p>Four interarrival times distributions are available: Exponential, Uniform, Deterministic,
Hyperexponential. The same distributions are available for service times. A screenshot of the animation
of a queueing station is shown in Fig.4. According to the parameters, the selected policy is FCFS, the
interarrival times and service times are exponentially distributed with mean values 1, the max number
of requests that will be animated is 200, and the random number generator seed is 23000. The screenshot
was taken after 38 req were generated, 7 of which were dropped. Six buttons are available in a
Button Toolbar to control the animation: Play, Pause, Restart, Single Step, Increase/Decrease
animation speed. Play and Pause let the execution of the animation run at a speed proportional to
the simulation times, while Single Step allows to focus on the way in which the system will evolve in
the current configuration: in particular, it generates both an anticipation of what the student thinks will
happen next and the confirmation or correction of the hypothesized behavior. A request is represented
by a circle filled with color and a rectangle with an area filled with the same color whose size represents
its service demand. As execution progresses, the circle and rectangle move along the model connections
from source to sink. The colored area of the server represents the fraction of the server capacity utilized.
The results obtained from the animation of a JMCH run and those of a correspondent model simulated
with JSIM are reported in a Results table. Fig.5 shows some metrics obtained with three runs of the
same model (ANIM) with diferent animation lengths (10, 50, 200 req) and those of the corresponding
JSIM model. Clearly, as the animation length increases the values of the ANIM metrics converge to
those of the JSIM.</p>
      </sec>
      <sec id="sec-2-2">
        <title>3.2. Routing Algorithms</title>
        <p>The focus of this section is on routing algorithms. Due to the limitations introduced by the graphical
representation of routing algorithms, we only consider systems consisting of three queueing stations.
We assume that the routing decision is made immediately after a job enters the system, and that the
time required to reach the selected station is negligible. The stations have the same characteristics
and are similar to the one described in the Scheduling Algorithms section. The scheduling discipline
adopted in all of them is non-preemptive FCFS (First Come First Served). Moreover, each station
has a single server. In the graphical representation of the model, a new component is introduced:
the Router. Its role is to forward incoming jobs from the Source to one of the three outgoing arcs,
each connected to a queueing station, according to a predefined policy. Three routing algorithms
are currently implemented (RR Round Robin, JSQ Join Shortest Queue, Probabilities). In the
latter case, the user can associate a diferent routing probability to the paths connecting the three
stations. As in the case of the scheduling algorithms, four distributions of interarrival times and service
times are available: Exponential, Uniform, Deterministic, Hyperexponential. A screenshot of
the animation of a three-station model is shown in Fig.6.</p>
        <p>The selected routing algorithm is Probabilities. According to the parameters, the three probabilities
associated with each outgoing arc from the router, starting from the top and moving clockwise, are
0.2, 0.5, and 0.3, respectively. The interarrival times follows an Exponential distribution with mean
value 1, and the service time also follows an Exponential distribution with mean 5. The system operates
under saturation conditions. The maximum number of animated requests is set to 2000, and the random
number generator seed is 23000. The screenshot was taken after 64 generated jobs, 26 of which were
dropped.</p>
        <p>The same six buttons of the Button Toolbar described for the scheduling policy, are available also
in this case to control the animation: Play, Pause, Restart, Single Step, Increase/Decrease
animation speed.</p>
      </sec>
      <sec id="sec-2-3">
        <title>3.3. The Markov chains analyzer</title>
        <p>The JMCH provides a graphical representation of the Markov Chain states corresponding to a single
queue station model, including single-server stations with finite (M/M/1/k) or infinite (M/M/1) queue
size, and multi-server stations with unlimited (M/M/c) or limited (M/M/c/k) queue size. It is possible to
change the arrival rate  and the service time S of the station at runtime. Users can get visual perception
of trafic bursts and their efects on queue length and server utilization. The exact analytical results are
computed and also displayed for comparison purposes.</p>
        <p>The application starts by asking the user what type of queue station needs to be analyzed. The
selection screen is shown in Fig.7.</p>
        <p>After the selection, the corresponding states of the birth-death process are represented, see Fig. 8 , and
the animation of the sequence of states visited during the simulation is shown. The following parameters
can be changed dynamically via sliding cursors: arrival rate  , service time S, station capacity k. The
arrival rate and service times are exponentially distributed. Among the performance indices computed
and/or displayed are: mean number of customers in the station, throughput, utilization, probability of
each state of the Markov Chain. The current state of the Markov Chain is colored in red and the state
probabilities are shown in green.</p>
        <p>A log file is generated at each simulation with the following data: Customer ID (the id assigned to each
customer), Arrival Time (the instant of time of the creation of the customer), Start Execution (the instant
of time in which the customer start to be executed from one of the servers), Server ID (it shows the id of
the server if there are more than one), Exit system (the instant of time in which the customer exits from
the system).</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>4. Efectiveness of the animation technique</title>
      <p>The proposed tool can be used to create some lessons for the performance evaluation course, where the
tool is provided to students along with some printed materials that can be useful during the session. Fig.9
shows a typical workflow of a lesson that use JMCH to teach scheduling policies, routing algorithms,
and M/M/c/K queue stations. First, the exercise session is briefly described, and the printed material
is distributed to the students. This can be either on paper or on a web resource, depending on the
organization of the classroom. Subsequently the students download and install the tool (unless this
was already used in a previous lecture), opens them and try to familiarize with both the tool and the
provided material.</p>
      <p>Fig.10 shows some of the slides given to the students: part a) shows an example of the instructions
that can be given to download and install the tool. A general introduction to the tool interface could be
given, as shown in Fig.10b). Then the session continues with scientific content part, where instruction
to set-up the parameters and their explanations are given, as shone in Fig.10c). Also, some content
explaining how to run and control the execution of the animation can be useful, as shown in Fig.10d).</p>
      <p>The experimentation by the students will continue for about 20 minutes to 1 hour, considering that
each individual topic (i.e. scheduling policies, routing algorithms, and M/M/c/K models) should require
around 20 minutes. During this time, the teacher will wander around the class, giving brief prompts to
individual students. He helps them focus on the most important concepts that need to be considered,
also showing which parameters can be changed to achieve interesting or unexpected efects.</p>
      <p>The lesson concludes by assigning students some simple exercises to immediately verify what they
have learned. Fig.11 shows an example of some questions. In this case, due to the special nature of the
exercise session, it might be worth not to use the evaluation of these exercises as part of the final mark,
to reduce the pressure and make the experience more enjoyable.</p>
      <p>Lesson presentation
and material distribution
Students download, install and
familiarize with the tool
Individual training, following the
guide, and using the tool
Exercise session assessment</p>
      <p>Page 2</p>
      <p>Page 26</p>
    </sec>
    <sec id="sec-4">
      <title>5. Conclusion and Future developments</title>
      <p>The final goal of this work is to improve the JMCH so that it can be used as a testbed for designing and
evaluating scheduling and routing algorithms. Possible extensions that are currently being implemented
b)
d)</p>
      <p>Page 20
Page 29
or planned are: a more complete set of distributions for both the interarrival and the service times (see
the ones supported by JSIM), a larger set of diferent scheduling and routing algorithms, as well as a
decrease in the number of constraints that limit current system architectures that can be considered.
Another important feature that will be implemented is the possibility to accept as input a log file
containing a sequence of interarrival and service times submitted by users (like the Replayer feature
of JSIM). This will enable the use of collected data files in real systems.</p>
    </sec>
    <sec id="sec-5">
      <title>Declaration on Generative AI</title>
      <p>The author(s) have not employed any Generative AI tools.
2ffi12030050&amp;partnerID=40&amp;md5=b86dcb80c7974534ded37b8e74bb08bf. doi:10.3390/fi12030050,
all Open Access, Gold Open Access, Green Open Access.
[6] M. Iacono, M. Gribaudo, E. Barbierato, Exploiting multiformalism models for testing and
performance evaluation in simthesys, 2011, p. 121 – 130. URL: https://www.scopus.com/inward/
record.uri?eid=2-s2.0-84897446724&amp;doi=10.4108%2ficst.valuetools.2011.245727&amp;partnerID=
40&amp;md5=4fab40f30e2a1d9188f93219c922ef11. doi:10.4108/icst.valuetools.2011.245727, all
Open Access, Bronze Open Access.
[7] M. Iacono, M. Gribaudo, Element based semantics in multi formalism performance models,
2010, p. 413 – 416. URL: https://www.scopus.com/inward/record.uri?eid=2-s2.0-78049499120&amp;doi=
10.1109%2fMASCOTS.2010.54&amp;partnerID=40&amp;md5=1724d38465a91c64bdbf574e87789a8b. doi:10.
1109/MASCOTS.2010.54.
[8] M. Iacono, E. Barbierato, M. Gribaudo, The simthesys multiformalism modeling framework 64
(2012) 3828 – 3839. URL: https://www.scopus.com/inward/record.uri?eid=2-s2.0-84870243255&amp;doi=
10.1016%2fj.camwa.2012.03.009&amp;partnerID=40&amp;md5=f0864721bc1643b9307366b5705e77ad, all Open
Access, Bronze Open Access.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>M.</given-names>
            <surname>Bertoli</surname>
          </string-name>
          , G. Casale, G. Serazzi,
          <article-title>Jmt: Performance engineering tools for system modeling</article-title>
          ,
          <source>SIGMETRICS Perform. Eval. Rev</source>
          .
          <volume>36</volume>
          (
          <year>2009</year>
          )
          <fpage>10</fpage>
          -
          <lpage>15</lpage>
          . URL: https://www.scopus.com/inward/record.uri? eid=
          <fpage>2</fpage>
          -
          <lpage>s2</lpage>
          .
          <fpage>0</fpage>
          -
          <lpage>77950493522</lpage>
          &amp;partnerID=
          <volume>40</volume>
          &amp;md5=
          <fpage>0338ca2ad38c9b65548ca6d980e8ed78</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Java</given-names>
            <surname>Modelling Tools JMT</surname>
          </string-name>
          <article-title>: performance engineering tools for system modelling</article-title>
          , https://jmt. sourceforge.net/,
          <year>2025</year>
          . [download open source].
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>G.</given-names>
            <surname>Serazzi</surname>
          </string-name>
          ,
          <article-title>Performance engineering: Learning through applications using</article-title>
          JMT,
          <year>2023</year>
          . URL: https://www.scopus.com/inward/record.uri?eid=
          <fpage>2</fpage>
          -
          <lpage>s2</lpage>
          .
          <fpage>0</fpage>
          -
          <lpage>85197189480</lpage>
          &amp;doi= 10.1007%
          <fpage>2f978</fpage>
          -3
          <source>-031-36763-2&amp;partnerID=40&amp;md5=65edd486fdab00142f889a357c09d2d1. doi:10</source>
          .1007/978- 3-
          <fpage>031</fpage>
          - 36763- 2.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>L.</given-names>
            <surname>Torri</surname>
          </string-name>
          , JMCH:
          <article-title>Application of Animation Techniques for Teaching Scheduling and Routing Algorithms with</article-title>
          JMT,
          <year>2024</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>E.</given-names>
            <surname>Barbierato</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gribaudo</surname>
          </string-name>
          ,
          <string-name>
            <surname>G.</surname>
          </string-name>
          <article-title>Serazzi, Multi-formalism models for performance engineering 12 (</article-title>
          <year>2020</year>
          ). URL: https://www.scopus.com/inward/record.uri?eid=
          <fpage>2</fpage>
          -
          <lpage>s2</lpage>
          .
          <fpage>0</fpage>
          -
          <lpage>85082960422</lpage>
          &amp;doi=10.3390%
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>