modified: anchor.py
This commit is contained in:
		
							parent
							
								
									ee7987aca4
								
							
						
					
					
						commit
						ea6b651e97
					
				
							
								
								
									
										13
									
								
								anchor.py
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								anchor.py
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -105,15 +105,18 @@ def handle_cas(args):
 | 
			
		|||
            t_max = 0
 | 
			
		||||
            t_min = float('inf')
 | 
			
		||||
            for p in paths:
 | 
			
		||||
                nt = p.split(':')
 | 
			
		||||
                if len(nt) < 2:
 | 
			
		||||
                    continue
 | 
			
		||||
                # observed adoption/participant
 | 
			
		||||
                nodes = p.split(':')[0].split('/')
 | 
			
		||||
                time_now = int(p.split(':')[1])
 | 
			
		||||
                nodes =nt[0].split('/')
 | 
			
		||||
                time_now = int(nt[1])
 | 
			
		||||
                if time_now > t_max:
 | 
			
		||||
                    t_max = time_now
 | 
			
		||||
                if time_now < t_min:
 | 
			
		||||
                    t_min = time_now
 | 
			
		||||
                node = nodes[-1]
 | 
			
		||||
                node_id = int(node)
 | 
			
		||||
                node_id = node
 | 
			
		||||
                
 | 
			
		||||
                if time_now > obs_time and obs_time != -1:
 | 
			
		||||
                    continue
 | 
			
		||||
| 
						 | 
				
			
			@ -243,7 +246,7 @@ def get_t0(args):
 | 
			
		|||
                if time_now < t_min:
 | 
			
		||||
                    t_min = time_now
 | 
			
		||||
                node = nodes[-1]
 | 
			
		||||
                node_id = int(node)
 | 
			
		||||
                node_id = node
 | 
			
		||||
                cas_set.add(node_id) 
 | 
			
		||||
                times.append(time_now)
 | 
			
		||||
                counts.append(len(cas_set))
 | 
			
		||||
| 
						 | 
				
			
			@ -505,6 +508,4 @@ if __name__ == '__main__':
 | 
			
		|||
    print("开始分析结果")
 | 
			
		||||
    prepare = get_t0(args)
 | 
			
		||||
    analyse_result(A, user_event_dict, prepare, args)
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
    
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user