Skip to content

Commit

Permalink
flow problem and cosmetic adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
azhow committed Jan 16, 2017
1 parent fa0ad64 commit 175a6fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions modules/experiment/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os
from time import localtime
import string
import math
#Third-party module
from py_expression_eval import Parser
#Local modules
Expand Down Expand Up @@ -139,7 +140,7 @@ def init_network_data(self, k, network_file, group_size, flow, print_edges):
#instance
self.drivers = []
for od_pair in self.ODlist:
for i in range(od_pair.numTravels):
for i in range(int(math.ceil(od_pair.numTravels))):
self.drivers.append(Driver(od_pair))

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

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

+ str(self.crossover) + '_e' + str(self.elite) + '_k' + str(self.k)

headerstr = "#Parameters:" + "\n#\tGenerations=" + str(self.generations) + "\tPopulation=" \
+ str(self.population) + "\n#\tMutation=" + str(self.mutation) + "\tCrossover=" \
Expand Down
2 changes: 1 addition & 1 deletion modules/functions/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def generate_graph(graph_file, print_edges=False, flow=0):
freeflow_cost, cost_formula))

elif taglist[0] == 'od':
od_list.append((taglist[2], taglist[3], int(taglist[4])))
od_list.append((taglist[2], taglist[3], float(taglist[4])))
'''
Print edges and their costs but there are too many lines to be printed!!
'''
Expand Down

0 comments on commit 175a6fe

Please sign in to comment.