Example #1
0
def exp_9():  
  net = DataFixer.load("../networks/exps/exp9/net.json")
  fn = '../networks/exps/exp9/flowdata.csv'
  net.solve_with_data(fn)
  for link in net.get_links():
    print link, link.v_flow.value, link.v_dens.value
  net.realize()
  net.dump('../networks/exps/exp9/bignetstate.json')
Example #2
0
def exp_9_next():
  net = DataFixer.load('/Users/jdr/Documents/github/commroute/python/networks/exps/exp9/bignetstate.json')
  net.cache_props()
  for source in net.sources:
    for sink in net.sinks:
      routes = net.od_routes[source,sink]
      print '\n\n'
      print 'o', source, 'd', sink
      for route in routes:
        print net.route_travel_time(route) / net.ff_travel_time(route)
Example #3
0
def exp_9_hist():
  import pylab
  net = DataFixer.load('/Users/jdr/Documents/github/commroute/python/networks/exps/exp9/bignetstate.json')
  net.cache_props()
  for link in net.get_links():
    if link.congestion_level() < -1.0:
      print 'bad 1'
      print link.state.flow / link.fd.q_max
  pylab.hist([
    link.congestion_level()
    for link in net.get_links()
  ], bins = 100)
  pylab.show()