code: private double[] replacementVector(double[][] distanceMatrix) {
      double[] replacementVector = new double[distanceMatrix.length - 1];
      // Energy between archive member k and new solution
      double[] individualEnergy = new double[distanceMatrix.length - 1];
      // Sum of all individual energies
      double totalEnergy = 0.0;
      for (int i = 0; i < replacementVector.length; i++) {
        individualEnergy[i] = scalarization.getAttribute(archive.get(i)) / distanceMatrix[i][maxSize];
        totalEnergy += individualEnergy[i];
      }
      for (int i = 0; i < individualEnergy.length; i++) {
        replacementVector[i] = totalEnergy - individualEnergy[i];
        replacementVector[i] *= scalarization.getAttribute(archive.get(maxSize));
      }
      return replacementVector;
    }
docs: Computes the replacement energy vector. Each component k of the
  replacement vector states how much energy the new solution would
  introduce into the archive instead of the archive member at position k.
  
  @param distanceMatrix Distance between archive members
  @return The replacement energy vector.