• Main Page
  • Namespaces
  • Classes
  • Files
  • Class List
  • Class Hierarchy
  • Class Members

K_Distance Class Reference

Class for obtaining the k-th neighbour distance of the individuals of a population.

#include <K_Distance.h>

List of all members.

Public Member Functions

 K_Distance (Population *population)
 Constructor.
 ~K_Distance ()
 Destructor.
void calculateDistanceMatrix ()
 Calculates the distance matrix.
void calculateKDistance (int k)
double getIndividualKDistance (int individual, int k)
 Returns the distance to the kth individual of an individual.
int findMinimumDistanceIndividual ()
 Find the individual with the minumum distance to another individual.
int distanceComparison (Individual *, Individual *)
 Determines which individual has a minimum distance value.

Public Attributes

Population * population_
int numberOfFunctions_
double ** distance_
double ** kDistance_
int calculatedDistance_

Private Member Functions

double getDistance (Individual *, Individual *)
 Calculates the distances between two individuals.


Detailed Description

Definition at line 22 of file K_Distance.h.


Constructor & Destructor Documentation

K_Distance::K_Distance (  Population *  population  ) 
 

Constructor of the class

Definition at line 19 of file K_Distance.cpp.

References calculatedDistance_, distance_, kDistance_, Population::maximumPopulationSize_, MultiobjectiveProblem::numberOfFunctions_, numberOfFunctions_, population_, and Population::problem_.

K_Distance::~K_Distance (   ) 
 

Destructor of the class

Definition at line 37 of file K_Distance.cpp.

References distance_, Population::maximumPopulationSize_, and population_.


Member Function Documentation

void K_Distance::calculateDistanceMatrix (   ) 
 

Calculates the distances among the individuals. During this process, the distance to the 1-th nearest neighbour is obtained

Definition at line 49 of file K_Distance.cpp.

References distance_, getDistance(), Population::getIth(), Population::getPopulationSize(), kDistance_, Individual::location_, MAX_REAL, and population_.

Referenced by AbYSS::referenceSetUpdate().

void K_Distance::calculateKDistance (  int  k  ) 
 

Definition at line 96 of file K_Distance.cpp.

References calculatedDistance_, Population::getPopulationSize(), kDistance_, MAX_REAL, and population_.

int K_Distance::distanceComparison (  Individual *  individual1,
Individual *  individual2
) 
 

Parameters:
individual1 The first individual to compare
individual2 The second individual to compare
Returns:
0 if both individuals has the same distance value (which is unlike to happend), -1 if individual1 has a less value, and 1 otherwise

Definition at line 255 of file K_Distance.cpp.

References calculatedDistance_, Individual::distance_, Population::getPopulationSize(), kDistance_, and population_.

int K_Distance::findMinimumDistanceIndividual (   ) 
 

Definition at line 152 of file K_Distance.cpp.

References Population::getPopulationSize(), kDistance_, MAX_REAL, and population_.

double K_Distance::getDistance (  Individual *  individual1,
Individual *  individual2
)  [private]
 

Calculates the distances between two individuals

Definition at line 230 of file K_Distance.cpp.

References Individual::fitness_, and numberOfFunctions_.

Referenced by calculateDistanceMatrix().

double K_Distance::getIndividualKDistance (  int  individual,
int  k
) 
 

Parameters:
individual The individual
k The distance
Returns:
The distance to the kth individual

Definition at line 297 of file K_Distance.cpp.

References kDistance_.

Referenced by AbYSS::referenceSetUpdate().


Member Data Documentation

int K_Distance::calculatedDistance_
 

Definition at line 28 of file K_Distance.h.

Referenced by calculateKDistance(), distanceComparison(), and K_Distance().

double** K_Distance::distance_
 

Definition at line 26 of file K_Distance.h.

Referenced by calculateDistanceMatrix(), K_Distance(), and ~K_Distance().

double** K_Distance::kDistance_
 

Definition at line 27 of file K_Distance.h.

Referenced by calculateDistanceMatrix(), calculateKDistance(), distanceComparison(), findMinimumDistanceIndividual(), getIndividualKDistance(), and K_Distance().

int K_Distance::numberOfFunctions_
 

Definition at line 25 of file K_Distance.h.

Referenced by getDistance(), and K_Distance().

Population* K_Distance::population_
 

Definition at line 24 of file K_Distance.h.

Referenced by calculateDistanceMatrix(), calculateKDistance(), distanceComparison(), findMinimumDistanceIndividual(), K_Distance(), and ~K_Distance().


The documentation for this class was generated from the following files:
  • K_Distance.h
  • K_Distance.cpp

Our Software

orangebox Mallba

orangebox ssGA

orangebox JGDS

orangebox xxGA

orangebox JCell

orangebox MHTB

orangebox DEME

orangebox JMetal

orangebox More...

orangebox Go Back