Skip to content

Commit 175a6fe

Browse files
committed
flow problem and cosmetic adjustments
1 parent fa0ad64 commit 175a6fe

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

modules/experiment/experiment.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import os
99
from time import localtime
1010
import string
11+
import math
1112
#Third-party module
1213
from py_expression_eval import Parser
1314
#Local modules
@@ -139,7 +140,7 @@ def init_network_data(self, k, network_file, group_size, flow, print_edges):
139140
#instance
140141
self.drivers = []
141142
for od_pair in self.ODlist:
142-
for i in range(od_pair.numTravels):
143+
for i in range(int(math.ceil(od_pair.numTravels))):
143144
self.drivers.append(Driver(od_pair))
144145

145146
def __repr__(self):
@@ -308,9 +309,7 @@ def createStringArguments(self, useQL, useInt):
308309
path = fmt % (self.network_name, self.mutation)
309310

310311
filename = '/net' + self.network_name + '_pm' + str(self.mutation) + '_c' \
311-
+ str(self.crossover) + '_e' + str(self.elite) + '_k' + str(self.k) + '_nd' \
312-
+ str(nd(self.drivers, self.group_size)) + '_groupsize' + str(self.group_size)
313-
312+
+ str(self.crossover) + '_e' + str(self.elite) + '_k' + str(self.k)
314313

315314
headerstr = "#Parameters:" + "\n#\tGenerations=" + str(self.generations) + "\tPopulation=" \
316315
+ str(self.population) + "\n#\tMutation=" + str(self.mutation) + "\tCrossover=" \

modules/functions/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def generate_graph(graph_file, print_edges=False, flow=0):
168168
freeflow_cost, cost_formula))
169169

170170
elif taglist[0] == 'od':
171-
od_list.append((taglist[2], taglist[3], int(taglist[4])))
171+
od_list.append((taglist[2], taglist[3], float(taglist[4])))
172172
'''
173173
Print edges and their costs but there are too many lines to be printed!!
174174
'''

0 commit comments

Comments
 (0)