C# Класс SharpNeat.DistanceMetrics.EuclideanDistanceMetric

Euclidean distance metric. The Euclidean distance is given by sqrt(sum(delta^2)) Where [delta] is the absolute position difference in a given dimension (on a given axis).
Наследование: IDistanceMetric
Показать файл Открыть проект

Открытые методы

Метод Описание
CalculateCentroid ( IList coordList ) : CoordinateVector

Calculates the centroid for the given set of points. For the Euclidean distance metric the centroid is given by calculating the componentwise mean over the set of points.

CalculateCentroidParallel ( IList coordList ) : CoordinateVector

Parallelized version of CalculateCentroid().

MeasureDistance ( CoordinateVector p1, CoordinateVector p2, double threshold ) : bool

Tests if the distance between two positions is less than some threshold. A simple way of implementing this method would be to calculate the distance between the two coordinates and test if it is less than the threshold. However, that approach requires that all of the elements in both CoordinateVectors be fully compared. We can improve performance in the general case by testing if the threshold has been passed after each vector element comparison thus allowing an early exit from the method for many calls. Further to this, we can begin comparing from the ends of the vectors where differences are most likely to occur.

MeasureDistance ( CoordinateVector p1, CoordinateVector p2 ) : double

Measures the distance between two positions.

Описание методов

CalculateCentroid() публичный Метод

Calculates the centroid for the given set of points. For the Euclidean distance metric the centroid is given by calculating the componentwise mean over the set of points.
public CalculateCentroid ( IList coordList ) : CoordinateVector
coordList IList
Результат SharpNeat.Core.CoordinateVector

CalculateCentroidParallel() публичный Метод

Parallelized version of CalculateCentroid().
public CalculateCentroidParallel ( IList coordList ) : CoordinateVector
coordList IList
Результат SharpNeat.Core.CoordinateVector

MeasureDistance() публичный Метод

Tests if the distance between two positions is less than some threshold. A simple way of implementing this method would be to calculate the distance between the two coordinates and test if it is less than the threshold. However, that approach requires that all of the elements in both CoordinateVectors be fully compared. We can improve performance in the general case by testing if the threshold has been passed after each vector element comparison thus allowing an early exit from the method for many calls. Further to this, we can begin comparing from the ends of the vectors where differences are most likely to occur.
public MeasureDistance ( CoordinateVector p1, CoordinateVector p2, double threshold ) : bool
p1 SharpNeat.Core.CoordinateVector
p2 SharpNeat.Core.CoordinateVector
threshold double
Результат bool

MeasureDistance() публичный Метод

Measures the distance between two positions.
public MeasureDistance ( CoordinateVector p1, CoordinateVector p2 ) : double
p1 SharpNeat.Core.CoordinateVector
p2 SharpNeat.Core.CoordinateVector
Результат double