To get started with Queueing-tool , you need to import the library and create a network object. Then, you need to define the nodes, which represent the servers or the queues, and the edges, which represent the connections or the transitions between the nodes. You can specify the attributes of each node and edge, such as the capacity, the service distribution, the queue discipline, or the routing probabilities. After that, you can simulate the network with a given number of customers or a given duration, and analyze the output with the built-in methods. You can also plot the network, the queue lengths, or the waiting times with the matplotlib library. Here is an example of how to create and analyze a simple M/M/1/K queuing model with Queueing-tool :
# Import the library
import queueing_tool as qt
# Create a network object
g = qt.QueueNetwork()
# Define the node (a single server with capacity 10)
g.add_node(1, num_servers=1, queue_size=10, service_distribution='exponential', service_rate=5)
# Define the edge (a connection from node 1 to itself with arrival rate 6)
g.add_edge(1, 1, rate=6)
# Simulate the network with 1000 customers
g.simulate(n=1000)
# Calculate the performance indicators
L = g.mean_queue_length(return_dict=True)[1] # Average number of customers in the system
W = g.mean_waiting_time(return_dict=True)[1] # Average time spent in the system
Pb = g.blocking_probability(return_dict=True)[1] # Probability of blocking
Pl = g.loss_probability(return_dict=True)[1] # Probability of loss
rho = g.utilization(return_dict=True)[1] # Utilization of the server
# Print the results
print(f'L = {L:.2f}')
print(f'W = {W:.2f}')
print(f'Pb = {Pb:.2f}')
print(f'Pl = {Pl:.2f}')
print(f'rho = {rho:.2f}')
# Plot the network and the queue length
g.draw()
g.plot_queue_length()