Skip to content

Instantly share code, notes, and snippets.

@galenseilis
Created December 16, 2023 17:05
Show Gist options
  • Save galenseilis/7738d6ab8191816134657166df52629a to your computer and use it in GitHub Desktop.
Save galenseilis/7738d6ab8191816134657166df52629a to your computer and use it in GitHub Desktop.
queueing_tool example; just dumping it here. This gist shows obtaining data data from a simulation.
import matplotlib.pyplot as plt
import networkx as nx
import queueing_tool as qt
g = qt.generate_random_graph(100, seed=3)
q = qt.QueueNetwork(g, seed=3)
q.max_agents = 20000
q.initialize(100)
q.start_collecting_data()
q.simulate(10000)
data = q.get_queue_data()
##pos = nx.nx_agraph.graphviz_layout(g.to_undirected(), prog='fdp')
##scatter_kwargs = {'s': 30}
##q.draw(pos=pos, scatter_kwargs=scatter_kwargs, bgcolor=[0,0,0,0],
## figsize=(10, 16), fname='fig.png',
## bbox_inches='tight')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment