diff --git a/nfopt/utils/data.py b/nfopt/utils/data.py index acec6b9..03a989b 100644 --- a/nfopt/utils/data.py +++ b/nfopt/utils/data.py @@ -134,8 +134,7 @@ def readLinks(): logger.info("Reading links...") dataCapacity = pd.read_csv( - f"{DATASET_PATH}/{DATASET_LINKS_NAME}.csv.gz", - compression="gzip", + f"{DATASET_PATH}/{DATASET_LINKS_NAME}.csv", names=["linkStart", "linkEnd", "capacity"], skiprows=1, engine="pyarrow", diff --git a/sample-data/flow-path-day1.csv b/sample-data/flow-path-day1.csv new file mode 100644 index 0000000..396b5d4 --- /dev/null +++ b/sample-data/flow-path-day1.csv @@ -0,0 +1,5 @@ +Mon 00:00:00,A,G,[A;B;D;G] +Mon 00:00:00,A,G,[A;B;E;G] +Mon 00:00:00,A,G,[A;C;F;G] +Mon 00:00:00,X,G,[X;C;F;G] +Mon 00:00:00,X,G,[X;Y;F;G] \ No newline at end of file diff --git a/sample-data/flow-traffic-day1.csv b/sample-data/flow-traffic-day1.csv new file mode 100644 index 0000000..7669577 --- /dev/null +++ b/sample-data/flow-traffic-day1.csv @@ -0,0 +1,2 @@ +Mon 00:00:00,A,G,50.00 +Mon 00:00:00,X,G,75.00 \ No newline at end of file diff --git a/sample-data/links.csv b/sample-data/links.csv new file mode 100644 index 0000000..95e84a8 --- /dev/null +++ b/sample-data/links.csv @@ -0,0 +1,12 @@ +linkStart,linkEnd,capacity +A,B,100 +A,C,100 +B,D,100 +B,E,100 +C,F,100 +D,G,100 +E,G,100 +F,G,100 +X,C,100 +X,Y,100 +Y,F,100 \ No newline at end of file diff --git a/test.py b/test.py index e976418..9a9668b 100644 --- a/test.py +++ b/test.py @@ -97,10 +97,7 @@ def runLinearOptimizationModel( } - with gp.Env(params=options) as env, gp.Model(env=env) as m: - # Create optimization model based on the input model - m = gp.Model("network_optimization", env=env) - + with gp.Env(params=options) as env, gp.Model("network_optimization", env=env) as m: # Decision variables for path ratios for each source-destination pair path_ratios = m.addVars( [ diff --git a/test2.py b/test2.py index 3d665e2..aa3940e 100644 --- a/test2.py +++ b/test2.py @@ -52,8 +52,7 @@ def build_graph(edges): def optMC(parserArgs, links, flowTraffic, flows, timestamp): - with gp.Env(params=options) as env, gp.Model(env=env) as m: - m = gp.Model("netflow", env=env) + with gp.Env(params=options) as env, gp.Model("netflow", env=env) as m: # example of link data links = { "A;B": {"capacity": 100},