private int checkToAddLandmark(final InternalLandmarkData fromNode){
  if (activeLandmarkIndexes.length == preprocess.getLandmarks().length) {
    return -1;
  }
  double bestTravCostEst=estimateRemainingTravelCost(fromNode);
  int bestIndex=-1;
  for (int i=0; i < preprocess.getLandmarks().length; i++) {
    final double tmpTravTime=estimateRemainingTravelCost(fromNode,i);
    if (tmpTravTime > bestTravCostEst) {
      bestIndex=i;
      bestTravCostEst=tmpTravTime;
    }
  }
  if (bestIndex != -1) {
    final int[] newActiveLandmarks=new int[this.activeLandmarkIndexes.length + 1];
    System.arraycopy(this.activeLandmarkIndexes,0,newActiveLandmarks,0,this.activeLandmarkIndexes.length);
    newActiveLandmarks[this.activeLandmarkIndexes.length]=bestIndex;
    this.activeLandmarkIndexes=newActiveLandmarks;
  }
  return bestIndex;
}

private int checkToAddLandmark ( final InternalLandmarkData fromNode ) { if ( activeLandmarkIndexes . length == preprocess . getLandmarks ( ) . length ) { return - 1 ; } double bestTravCostEst = estimateRemainingTravelCost ( fromNode ) ; int bestIndex = - 1 ; for ( int i = 0 ; i < preprocess . getLandmarks ( ) . length ; i ++ ) { final double tmpTravTime = estimateRemainingTravelCost ( fromNode , i ) ; if ( tmpTravTime > bestTravCostEst ) { bestIndex = i ; bestTravCostEst = tmpTravTime ; } } if ( bestIndex != - 1 ) { final int [ ] newActiveLandmarks = new int [ this . activeLandmarkIndexes . length + 1 ] ; System . arraycopy ( this . activeLandmarkIndexes , 0 , newActiveLandmarks , 0 , this . activeLandmarkIndexes . length ) ; newActiveLandmarks [ this . activeLandmarkIndexes . length ] = bestIndex ; this . activeLandmarkIndexes = newActiveLandmarks ; } return bestIndex ; }
checks whether there is a landmark in the set of the non - active landmarks that yields a better estimation than the best active landmark . if there is , this landmark is added to the set of active landmark and its index is returned .
