class EuclideanDistanceFunction implements DistanceFunction {

    public double distance(Individual firstIndividual, Individual secondIndividual) {
        double[] first = firstIndividual.getRepresentation().getDoubleValue();
        double[] second = secondIndividual.getRepresentation().getDoubleValue();
        double distance = 0.0;
        double ba;
        for (int i = 0; i < first.length; i++){
            ba = second[i] - first[i];
            distance += ba * ba;
        }
        return Math.sqrt(distance);
    }

}