JMT (Java Modelling Tools)

The JMT solver is a wrapper for the Java Modelling Tools suite, providing model-to-model transformation from LINE's data structures into JMT's input XML formats. It supports both discrete-event simulation via JSIM and mean value analysis via JMVA.

MethodAlgorithmReference
defaultAutomatic solver and method selection
jsimDiscrete-event simulation in JSIM[1]
jmvaJMVA solver with automatic method selection
jmva.mvaExact MVA in JMVA[2]
jmva.recalRECAL algorithm (exact)[3]
jmva.comomCoMoM algorithm (exact)[4]
jmva.amvaApproximate MVA in JMVA
jmva.bsBard-Schweitzer (approximate)[5]
jmva.linLinearizer (approximate)[6]
jmva.dmlinDe Souza-Muntz Linearizer[7]
jmva.chowChow algorithm[8]
jmva.aqlAggregate Queue Length (AQL)[9]
closingClosing method

Example

This example demonstrates solving a simple M/M/1 queue using the JMT solver with discrete-event simulation. The unique feature shown here is the ability to specify a random seed and number of samples for reproducible simulation results.

% Create a simple M/M/1 queue
model = Network('M/M/1 Example');
source = Source(model, 'Source');
queue = Queue(model, 'Queue1', SchedStrategy.FCFS);
sink = Sink(model, 'Sink');

jobclass = OpenClass(model, 'Class1');
source.setArrival(jobclass, Exp(0.9));
queue.setService(jobclass, Exp(1.0));

model.link(Network.serialRouting(source, queue, sink));

% Solve with JMT (simulation with specific seed and samples)
solver = JMT(model, 'seed', 23000, 'samples', 10000);

% Display average performance metrics
JMT(model, 'seed', 23000, 'samples', 10000).avgTable()

Output:

Default method: using JSIM discrete-event simulation
JMT analysis [method: default, lang: matlab] completed in 1.068s.

ans =
  2×8 table
    Station    JobClass     QLen      Util      RespT     ResidT     ArvR       Tput
    _______    ________    ______    _______    ______    ______    _______    _______
    Source      Class1          0          0         0         0          0    0.89313
    Queue1      Class1     5.0616    0.87445    8.2595    8.2595    0.89313    0.89063
import jline.lang.*;
import jline.lang.constant.SchedStrategy;
import jline.lang.nodes.*;
import jline.lang.processes.Exp;
import jline.solvers.NetworkAvgTable;
import jline.solvers.SolverOptions;
import jline.solvers.jmt.JMT;

public class JMTExample {
    public static void main(String[] args) {
        // Create a simple M/M/1 queue
        Network model = new Network("M/M/1 Example");

        Source source = new Source(model, "Source");
        Queue queue = new Queue(model, "Queue1", SchedStrategy.FCFS);
        Sink sink = new Sink(model, "Sink");

        OpenClass jobclass = new OpenClass(model, "Class1");
        source.setArrival(jobclass, Exp.fitRate(0.9));
        queue.setService(jobclass, Exp.fitRate(1.0));

        model.link(Network.serialRouting(source, queue, sink));

        // Solve with JMT (simulation with specific seed and samples)
        JMT solver = new JMT(model);
        solver.options.seed = 23000;
        solver.options.samples = 10000;

        // Display average performance metrics
        NetworkAvgTable avgTable = solver.avgTable;
        System.out.println(avgTable);
    }
}

Output:

Default method: using JSIM discrete-event simulation
JMT analysis [method: default, lang: java] completed.

Station    JobClass     QLen      Util      RespT     ResidT     ArvR       Tput
Source     Class1       0.0       0.0       0.0       0.0        0.0        0.89313
Queue1     Class1       5.0616    0.87445   8.2595    8.2595     0.89313    0.89063
from line_solver import *

# Create a simple M/M/1 queue
model = Network('M/M/1 Example')

source = Source(model, 'Source')
queue = Queue(model, 'Queue1', SchedStrategy.FCFS)
sink = Sink(model, 'Sink')

jobclass = OpenClass(model, 'Class1')
source.setArrival(jobclass, Exp(0.9))
queue.setService(jobclass, Exp(1.0))

model.link(Network.serialRouting(source, queue, sink))

# Solve with JMT (simulation with specific seed and samples)
solver = JMT(model, seed=23000, samples=10000)

# Display average performance metrics
print(solver.avg_table)

Output:

Default method: using JSIM discrete-event simulation
JMT analysis [method: default, lang: python] completed.

  Station  JobClass    QLen     Util      RespT    ResidT     ArvR      Tput
0  Source    Class1     0.0      0.0       0.0      0.0        0.0       0.89313
1  Queue1    Class1     5.0616   0.87445   8.2595   8.2595     0.89313   0.89063

References

  1. Bertoli, M., Casale, G., & Serazzi, G. (2007). JMT: Performance evaluation software. ACM SIGMETRICS.
  2. Reiser, M., & Lavenberg, S. S. (1980). Mean-value analysis of closed multichain queuing networks. JACM.
  3. Conway, A. E., & Georganas, N. D. (1986). RECAL algorithm. JACM.
  4. Casale, G. (2009). CoMoM. IEEE TSE.
  5. Bolch, G., et al. (2006). Queueing Networks and Markov Chains. Wiley.
  6. Chandy, K. M., & Neuse, D. (1982). Linearizer. CACM.
  7. de Souza e Silva, E. G., & Muntz, R. R. (1990). Performance Evaluation.
  8. Chow, W. M. (1983). Performance Evaluation.
  9. Zahorjan, G. J., et al. (1988). IEEE TSE.