@ -132,8 +132,8 @@ df::coord getRoot(df::coord point, unordered_map<df::coord, df::coord>& rootMap)
 
		
	
		
			
				
 
		
	
		
			
				class  PointComp  {  
		
	
		
			
				public :  
		
	
		
			
				    unordered_map < df : : coord ,  int64 ,  PointHash >  * pointCost ; 
 
		
	
		
			
				    PointComp ( unordered_map < df : : coord ,  int64 ,  PointHash >  * p ) :  pointCost ( p )  { 
 
		
	
		
			
				    unordered_map < df : : coord ,  cost ,  PointHash >  * pointCost ; 
 
		
	
		
			
				    PointComp ( unordered_map < df : : coord ,  cost ,  PointHash >  * p ) :  pointCost ( p )  { 
 
		
	
		
			
				        
 
		
	
		
			
				    } 
 
		
	
		
			
				    
 
		
	
	
		
			
				
					
						
						
						
							
								 
						
					 
				
			
			@ -147,8 +147,8 @@ public:
 
		
	
		
			
				            return  true ; 
 
		
	
		
			
				        if  (  i2  = =  pointCost - > end ( )  ) 
 
		
	
		
			
				            return  false ; 
 
		
	
		
			
				        int64 c1  =  ( * i1 ) . second ; 
 
		
	
		
			
				        int64 c2  =  ( * i2 ) . second ; 
 
		
	
		
			
				        cost c1  =  ( * i1 ) . second ; 
 
		
	
		
			
				        cost c2  =  ( * i2 ) . second ; 
 
		
	
		
			
				        if  (  c1  ! =  c2  ) 
 
		
	
		
			
				            return  c1  <  c2 ; 
 
		
	
		
			
				        return  p1  <  p2 ; 
 
		
	
	
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
				
			
			@ -300,7 +300,7 @@ command_result diggingInvadersCommand(color_ostream& out, std::vector<std::strin
 
		
	
		
			
				            }  else  { 
 
		
	
		
			
				                return  CR_WRONG_USAGE ; 
 
		
	
		
			
				            } 
 
		
	
		
			
				            int64 value ; 
 
		
	
		
			
				            cost value ; 
 
		
	
		
			
				            stringstream  asdf ( parameters [ a + 2 ] ) ; 
 
		
	
		
			
				            asdf  > >  value ; 
 
		
	
		
			
				            if  (  value  < =  0  ) 
 
		
	
	
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
				
			
			@ -330,12 +330,12 @@ vector<int32_t> invaders;
 
		
	
		
			
				unordered_set < df : : coord ,  PointHash >  invaderPts ;  
		
	
		
			
				unordered_set < df : : coord ,  PointHash >  localPts ;  
		
	
		
			
				unordered_map < df : : coord , df : : coord , PointHash >  parentMap ;  
		
	
		
			
				unordered_map < df : : coord , int64 , PointHash >  costMap ;  
		
	
		
			
				unordered_map < df : : coord , cost , PointHash >  costMap ;  
		
	
		
			
				
 
		
	
		
			
				PointComp  comp ( & costMap ) ;  
		
	
		
			
				set < df : : coord ,  PointComp >  fringe ( comp ) ;  
		
	
		
			
				EventManager : : EventHandler  findJobTickHandler ( findAndAssignInvasionJob ,  1 ) ;  
		
	
		
			
				const  int32_t  edgesPerFrame  =  1000 ;  
		
	
		
			
				const  int32_t  edgesPerFrame  =  1000 0000 ;  
		
	
		
			
				
 
		
	
		
			
				int32_t  localPtsFound  =  0 ;  
		
	
		
			
				unordered_set < df : : coord , PointHash >  closedSet ;  
		
	
	
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
				
			
			@ -483,7 +483,7 @@ void findAndAssignInvasionJob(color_ostream& out, void* tickTime) {
 
		
	
		
			
				            } 
 
		
	
		
			
				        } 
 
		
	
		
			
				
 
		
	
		
			
				        int64 myCost  =  costMap [ pt ] ; 
 
		
	
		
			
				        cost myCost  =  costMap [ pt ] ; 
 
		
	
		
			
				        clock_t  edgeTime  =  clock ( ) ; 
 
		
	
		
			
				        vector < Edge > *  myEdges  =  getEdgeSet ( out ,  pt ,  cache ,  xMax ,  yMax ,  zMax ) ; 
 
		
	
		
			
				        totalEdgeTime  + =  ( clock ( )  -  edgeTime ) ; 
 
		
	
	
		
			
				
					
						
						
						
							
								 
						
					 
				
			
			@ -499,7 +499,7 @@ void findAndAssignInvasionJob(color_ostream& out, void* tickTime) {
 
		
	
		
			
				            //    continue;
 
 
		
	
		
			
				            auto  i  =  costMap . find ( other ) ; 
 
		
	
		
			
				            if  (  i  ! =  costMap . end ( )  )  { 
 
		
	
		
			
				                int64 cost  =  ( * i ) . second ; 
 
		
	
		
			
				                cost cost  =  ( * i ) . second ; 
 
		
	
		
			
				                if  (  cost  < =  myCost  +  e . cost  )  { 
 
		
	
		
			
				                    continue ; 
 
		
	
		
			
				                } 
 
		
	
	
		
			
				
					
						
						
						
							
								 
						
					 
				
			
			@ -513,7 +513,7 @@ void findAndAssignInvasionJob(color_ostream& out, void* tickTime) {
 
		
	
		
			
				        delete  myEdges ; 
 
		
	
		
			
				    } 
 
		
	
		
			
				    clock_t  time  =  clock ( )  -  t0 ; 
 
		
	
		
			
				    //out.print(" 
 
 
		
	
		
			
				    out . print ( " 
 
		
	
		
			
				    fringe . clear ( ) ; 
 
		
	
		
			
				
 
		
	
		
			
				    if  (  ! foundTarget  ) 
 
		
	
	
		
			
				
					
						
						
						
							
								 
						
					 
				
			
			@ -525,8 +525,8 @@ void findAndAssignInvasionJob(color_ostream& out, void* tickTime) {
 
		
	
		
			
				    //find important edges
 
 
		
	
		
			
				    Edge  firstImportantEdge ( df : : coord ( ) ,  df : : coord ( ) ,  - 1 ) ; 
 
		
	
		
			
				    df : : coord  closest ; 
 
		
	
		
			
				    int64 closestCostEstimate = 0 ; 
 
		
	
		
			
				    int64 closestCostActual = 0 ; 
 
		
	
		
			
				    cost closestCostEstimate = 0 ; 
 
		
	
		
			
				    cost closestCostActual = 0 ; 
 
		
	
		
			
				    for  (  auto  i  =  localPts . begin ( ) ;  i  ! =  localPts . end ( ) ;  i + +  )  { 
 
		
	
		
			
				        df : : coord  pt  =  * i ; 
 
		
	
		
			
				        if  (  costMap . find ( pt )  = =  costMap . end ( )  )