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.
| Method | Algorithm | Reference |
|---|---|---|
default | Automatic solver and method selection | — |
jsim | Discrete-event simulation in JSIM | [1] |
jmva | JMVA solver with automatic method selection | — |
jmva.mva | Exact MVA in JMVA | [2] |
jmva.recal | RECAL algorithm (exact) | [3] |
jmva.comom | CoMoM algorithm (exact) | [4] |
jmva.amva | Approximate MVA in JMVA | — |
jmva.bs | Bard-Schweitzer (approximate) | [5] |
jmva.lin | Linearizer (approximate) | [6] |
jmva.dmlin | De Souza-Muntz Linearizer | [7] |
jmva.chow | Chow algorithm | [8] |
jmva.aql | Aggregate Queue Length (AQL) | [9] |
closing | Closing 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
- Bertoli, M., Casale, G., & Serazzi, G. (2007). JMT: Performance evaluation software. ACM SIGMETRICS.
- Reiser, M., & Lavenberg, S. S. (1980). Mean-value analysis of closed multichain queuing networks. JACM.
- Conway, A. E., & Georganas, N. D. (1986). RECAL algorithm. JACM.
- Casale, G. (2009). CoMoM. IEEE TSE.
- Bolch, G., et al. (2006). Queueing Networks and Markov Chains. Wiley.
- Chandy, K. M., & Neuse, D. (1982). Linearizer. CACM.
- de Souza e Silva, E. G., & Muntz, R. R. (1990). Performance Evaluation.
- Chow, W. M. (1983). Performance Evaluation.
- Zahorjan, G. J., et al. (1988). IEEE TSE.