<jupyter_start><jupyter_text>Simulation parameters<jupyter_code>model_path = 'model.json' 
commuter_networks_path = 'commuter_networks.csv'
node_parameters_path = 'node_parameters.csv'
cnode_parameters_path = 'cnode_parameters.csv' 
contact_matrices_path = 'contact_matrices.json' 
node_cmatrices_path = 'node_cmatrices.csv' 
cnode_cmatrices_path = 'cnode_cmatrices.csv' 
node_positions_path = 'node_positions.csv' 
node_populations_path = 'node_populations.csv'<jupyter_output><empty_output><jupyter_text>Simulation settings<jupyter_code>t_start = 0
t_end = 24*60*100

_, dts = pyrossgeo.utils.get_dt_schedule([
    (0,  1*60),
    (7*60,  1),
    (10*60, 2*60),
    (17*60, 1),
    (19*60, 2*60)
], end_time=24*60)<jupyter_output><empty_output><jupyter_text>Run simulation<jupyter_code>sim = pyrossgeo.Simulation()

X_state = sim.initialize(model_path, commuter_networks_path,
                            node_parameters_path, cnode_parameters_path,
                            contact_matrices_path, node_cmatrices_path, cnode_cmatrices_path,
                            node_populations_path)

start_time = time.time()
dX_state = np.zeros(X_state.size)
sim_data = sim.simulate(X_state, t_start, t_end, dts, steps_per_save=1)
end_time = time.time()
sim_time = (end_time - start_time)/(60*60)
print("Simulation complete. Run-time (h): %s" % sim_time)

ts, node_data, cnode_data, location_data, community_data, network_data = pyrossgeo.utils.get_simulation_data(sim_data)

ts_days = ts / (24*60)
ts_hours = ts / 60<jupyter_output>Simulation complete. Run-time (h): 9.712775548299154e-06<jupyter_text>Plot data<jupyter_code>plt.figure( figsize=(8,3) )

S = np.sum(network_data[:,:,0], axis=1)
E = np.sum(network_data[:,:,1], axis=1)
I = np.sum(network_data[:,:,2], axis=1)
R = np.sum(network_data[:,:,3], axis=1)
N = S + E + I + R

plt.plot(ts_days, S, label="S")
plt.plot(ts_days, E, label="E")
plt.plot(ts_days, I, label="I")
plt.plot(ts_days, R, label="R")
plt.plot(ts_days, N, label="N")

plt.legend(loc='upper right', fontsize=12)
plt.xlabel('Days')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1444337811900192, 'fraction_numerical': 0.03838771593090211, 'mean_word_length': 5.475155279503106, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '575168', 'license': 'MIT', 'n_tokens_mistral': 894, 'n_tokens_neox': 839, 'n_words': 123, 'path': 'examples/ex2-age-structured-SEIR-on-a-single-node/ex2-age-structured-SEIR-on-a-single-node.ipynb', 'repo_name': 'fcooper8472/PyRossGeo', 'size': '2084'}