Genetic algorithm solving TSP with various settings

- Main Page
- Classes

- Class List
- Class Index
- Class Members

Public Member Functions | List of all members
Population Class Reference

Trida, ktera reprezentuje populaci. More...

## Public Member Functions
| Population (int populationCount, int numOfGenes, double[][] distances)
| Population (double[][] distances)
void | printPopulation ()
void | ratePopulation ()
Chromozome | getChromozome (int index)
int | getSize ()
int | getFitnessSum ()
void | sortByFitness ()
void | addChromozome (Chromozome chromozome)
void | findBestFitness ()
int | getBestFit ()

## Detailed Description

Trida, ktera reprezentuje populaci.

Author
  nemec

## Constructor & Destructor Documentation

Population.Population | ( | int | populationCount,
|  | int | numOfGenes,
|  | double | distances[][]
| ) |  |

Konstruktor, ktery vytvari populaci

Parameters

  populationCount | Pocet chromozomu v populaci
  numOfGenes | Pocet genu, jednotlivych chromozomu
  distances | Tabulka se vzdalenostmi mezi jednotlivymi mesty

## Member Function Documentation

void Population.addChromozome | ( | Chromozome | chromozome | ) |

Funkce, ktera pridava chromozom na posledni misto v populaci

Parameters

  chromozome | Vstupni chromozom

void Population.findBestFitness | ( |  | ) |

Funkce, slouzici k nalezeni nejlepsiho chromozomu v populaci

int Population.getBestFit | ( |  | ) |

Funkce, ktera vraci pozici nejlepsiho chromozomu v populaci

Returns
  Pozice nejlepsiho chromozomu

Chromozome Population.getChromozome | ( | int | index | ) |

Funkce ktera vraci vybrani chromozom

Parameters

  index | Pozice chromozomu

Returns
  Vybrany chromozom

int Population.getSize | ( |  | ) |

Funkce, ktera vraci velikost populace

Returns
  Velikost populace

void Population.ratePopulation | ( |  | ) |

Trida, ktera hodnoti jednotlive chromozomy v populaci pomoci funkce tspFitness

The documentation for this class was generated from the following file:

- src/Population.java