for query_group, res in zip(query_groups,results):    
        for query, seg_list in zip(query_group, res):
            expanding_list_1[query.obj_id] = seg_list 
    
    job_server.print_stats()        
    
    print "expanding_list_1 - elapsed : ", (time.clock() - start_time)        
     
        
    #2. NON-PARALLEL    
    expanding_list_2 = {}                                 #dict of lists
    
    start_time = time.clock()    
    for query in query_list:
        seg_list = map_data.compute_fixed_expanding(query.x, query.y, 
                                        query.cur_edge_id, option.INIT_GRAPH_DISTANCE)
        seg_list = edge_segment_set.clean_fixed_expanding(seg_list)
        
        expanding_list_2[query.obj_id] = seg_list
    print "expanding_list_2 - elapsed : ", (time.clock() - start_time)       

    #3. CHECK
    print "Compare expanding_list_1 & expanding_list_2"
    print "len(expanding_list_1) =", len(expanding_list_1)
    print "len(expanding_list_2) =", len(expanding_list_2)
    
    for query in query_list:
        seg_list_1 = expanding_list_1[query.obj_id]
        seg_list_2 = expanding_list_2[query.obj_id]
        if len(seg_list_1) != len(seg_list_2):
            print "Error at query.obj_id = ", query.obj_id
Exemplo n.º 2
0
  
 print "max_speed = ", query_log.max_speed
 print "elapsed : ", (time.clock() - start_time)  
 
 #
 timestamp = 0;
 expanding_list = {}                                 #dict of lists
 query_list = query_log.frames[timestamp]       # timestamp
 
 
 #1. compute expanding_list
 start_time = time.clock()    
 print "#users =", len(query_list)
 count = 0
 for query in query_list:
     seg_list = map_data.compute_fixed_expanding(query.x, query.y, 
                                     query.cur_edge_id, query.dist)  #old: option.DISTANCE_CONSTRAINT
     
     seg_list_length = 0.0
     for seg in seg_list:
         seg_list_length += EdgeSegment.length(seg);
     print "seg_list.size = %d - %f" %(len(seg_list), seg_list_length)
     
     seg_list = EdgeSegmentSet.clean_fixed_expanding(seg_list)
     print "AFTER seg_list.size =", len(seg_list)
     
     expanding_list[query.obj_id] = seg_list
     
     count += 1
     if count == 10:
         break;
 print "expanding_list - elapsed : ", (time.clock() - start_time)   
Exemplo n.º 3
0
    for query_group, res in zip(query_groups, results):
        for query, seg_list in zip(query_group, res):
            expanding_list_1[query.obj_id] = seg_list

    job_server.print_stats()

    print "expanding_list_1 - elapsed : ", (time.clock() - start_time)

    #2. NON-PARALLEL
    expanding_list_2 = {}  #dict of lists

    start_time = time.clock()
    for query in query_list:
        seg_list = map_data.compute_fixed_expanding(query.x, query.y,
                                                    query.cur_edge_id,
                                                    option.INIT_GRAPH_DISTANCE)
        seg_list = edge_segment_set.clean_fixed_expanding(seg_list)

        expanding_list_2[query.obj_id] = seg_list
    print "expanding_list_2 - elapsed : ", (time.clock() - start_time)

    #3. CHECK
    print "Compare expanding_list_1 & expanding_list_2"
    print "len(expanding_list_1) =", len(expanding_list_1)
    print "len(expanding_list_2) =", len(expanding_list_2)

    for query in query_list:
        seg_list_1 = expanding_list_1[query.obj_id]
        seg_list_2 = expanding_list_2[query.obj_id]
        if len(seg_list_1) != len(seg_list_2):