Example #1
0
 int CompareCost(ARAstarNode n1, ARAstarNode n2)
 {
     float[] n1Key = n1.Key(parentPlanner.inflationFactor);
     float[] n2Key = n2.Key(parentPlanner.inflationFactor);
     if (n1.highPriority > 0 && n2.highPriority <= 0)
     {
         return(-1);
     }
     else if (n1.highPriority <= 0 && n2.highPriority > 0)
     {
         return(1);
     }
     else
     {
         if (n1Key[0] < n2Key[0])
         {
             return(-1);
         }
         else if (n1Key[0] > n2Key[0])
         {
             return(1);
         }
         else
         {
             if (n1Key[1] < n2Key[1])
             {
                 return(-1);
             }
             else
             {
                 return(1);
             }
         }
     }
 }
Example #2
0
 int compareKey(ARAstarNode firstNode, ARAstarNode secondNode)
 {
     float[] firstKey = firstNode.Key(currentWeight);
     float[] secondKey = secondNode.Key(currentWeight);
     if(firstKey[0] < secondKey[0])
         return 1;
     else if(firstKey[0] > secondKey[0])
         return -1;
     else{
         if(firstKey[1] < secondKey[1])
             return 1;
         else
             return -1;
     }
 }
Example #3
0
 int compareKey(ARAstarNode firstNode, ARAstarNode secondNode)
 {
     float[] firstKey  = firstNode.Key(currentWeight);
     float[] secondKey = secondNode.Key(currentWeight);
     if (firstKey[0] < secondKey[0])
     {
         return(1);
     }
     else if (firstKey[0] > secondKey[0])
     {
         return(-1);
     }
     else
     {
         if (firstKey[1] < secondKey[1])
         {
             return(1);
         }
         else
         {
             return(-1);
         }
     }
 }
Example #4
0
 int CompareCost(ARAstarNode n1, ARAstarNode n2)
 {
     float[] n1Key = n1.Key(parentPlanner.inflationFactor);
     float[] n2Key = n2.Key(parentPlanner.inflationFactor);
     if(n1.highPriority > 0 && n2.highPriority <= 0)
         return -1;
     else if(n1.highPriority <= 0 && n2.highPriority > 0)
         return 1;
     else{
         if (n1Key[0] < n2Key[0])
             return -1;
         else if(n1Key[0] > n2Key[0])
             return 1;
         else {
             if(n1Key[1] < n2Key[1])
                 return -1;
             else
                 return 1;
         }
     }
 }