In [15]:
%load_ext autoreload
%autoreload 2
In [16]:
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
import hashlib
import time
import shutil
In [17]:
MNM_nb_folder = os.path.join('..', '..', '..', 'side_project', 'network_builder')
sys.path.append(MNM_nb_folder)
python_lib_folder = os.path.join('..', '..', 'pylib')
sys.path.append(python_lib_folder)
In [18]:
from MNM_nb import *
# import MNMAPI
In [19]:
data_folder = os.path.join('..', '..', '..', 'data', 'input_files_MckeesRocks_SPC_wei')
In [20]:
nb = MNM_network_builder()
nb.load_from_folder(data_folder)
In [26]:
# for i, ID in enumerate(nb.path_table.ID2path.keys()):
# path = nb.path_table.ID2path[ID]
# path.route_portions = np.tile(path.route_portions, 5)
In [28]:
for O in nb.demand.demand_dict.keys():
for D in nb.demand.demand_dict[O].keys():
nb.demand.demand_dict[O][D] = nb.demand.demand_dict[O][D][:20]
In [31]:
f = nb.get_path_flow()
In [34]:
new_folder = "wei_mcroad"
In [35]:
nb.dump_to_folder(new_folder)
In [ ]:
In [ ]:
In [74]:
orig_f = f
In [59]:
new_folder = "wei_mcroad"
In [60]:
nb = MNM_network_builder()
nb.load_from_folder(new_folder)
In [64]:
f = nb.get_path_flow()
In [75]:
f = orig_f * 2
In [76]:
nb.update_demand_path(f)
In [77]:
nb.dump_to_folder('new_mcroad2')
In [73]:
f.sum()
Out[73]:
In [ ]: