Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/LazoVelko/Genetic-Algorithm-for-the-Traveling-Salesman-Problem
/ functions
Functions
149 in github.com/LazoVelko/Genetic-Algorithm-for-the-Traveling-Salesman-Problem
⨍
Functions
149
◇
Types & classes
21
↓ 61 callers
Method
add
Adds a Chromosome to the Population. @param chromosome the chromosome to add
GeneticObjects/Population.java:32
↓ 40 callers
Method
size
Get the size of the Population. @return the number of all the Chromosomes.
GeneticObjects/Population.java:108
↓ 15 callers
Method
getDistance
()
GeneticObjects/Chromosome.java:73
↓ 14 callers
Method
getArray
()
GeneticObjects/Chromosome.java:55
↓ 11 callers
Method
getMostFit
Get the Chromosome that has the path with the least distance. @return the most fit Chromosome
GeneticObjects/Population.java:161
↓ 10 callers
Method
getX
()
GeneticObjects/City.java:30
↓ 10 callers
Method
getY
()
GeneticObjects/City.java:34
↓ 7 callers
Method
getAverageDistance
Gets the average distance of all the chromosomes. @return the mean distance travelled
GeneticObjects/Population.java:116
↓ 6 callers
Method
getCities
Get an array of all the Cities. @return the array of Cities
GeneticObjects/Population.java:85
↓ 4 callers
Method
print
(int[][] array)
Utility/HeatMap.java:295
↓ 3 callers
Method
deepCopy
()
GeneticObjects/Population.java:169
↓ 3 callers
Method
draw
Draw a path through the city. @param chromosome the Chromosome containing the path
Display/WindowTSP.java:40
↓ 3 callers
Method
getName
()
GeneticObjects/City.java:26
↓ 3 callers
Method
performLocalSearch
(Chromosome chromosome)
GeneticAlgorithms/GeneticAlgorithm.java:367
↓ 3 callers
Method
reset
()
GeneticAlgorithms/GeneticAlgorithm.java:464
↓ 3 callers
Method
run
()
Utility/HeatMap.java:90
↓ 3 callers
Method
setCrossoverRate
(double crossoverRate)
GeneticAlgorithms/GeneticAlgorithm.java:102
↓ 3 callers
Method
setMutationRate
(double mutationRate)
GeneticAlgorithms/GeneticAlgorithm.java:109
↓ 3 callers
Method
tournamentSelection
Picks k Chromosomes at at random and then return the best one. There is a small chance that the best one will not be selected. @param population th
GeneticAlgorithms/Selection.java:31
↓ 2 callers
Method
checkRangeValues
(double start, double finish, double increment)
Utility/HeatMap.java:77
↓ 2 callers
Method
createNextGeneration
The meat of the entire class. Generates the next generation from the current population. Brings together all the other classes in the package; Selecti
GeneticAlgorithms/GeneticAlgorithm.java:285
↓ 2 callers
Method
distance
Finds the Euclidean distance between two cities. @param city1 the first city @param city2 the second city @return the distance
GeneticObjects/City.java:79
↓ 2 callers
Method
getAreaUnderBestDistances
()
GeneticAlgorithms/GeneticAlgorithm.java:212
↓ 2 callers
Method
getDefaultGA
()
GeneticAlgorithms/Preset.java:14
↓ 2 callers
Method
getHue
(int indexOfHue, int totalUniqueHues)
Display/WindowGraph.java:243
↓ 2 callers
Method
getRandomPopulation
Generate a Population of randomly generate Chromosomes. @param numOfCities the number of cities @param sizeOfPop the size of the population @par
GeneticObjects/Population.java:141
↓ 2 callers
Method
insertion
Selects a city and inserts it into a random place. @param chromosome The Chromosome who's cities will be swapped. @param random The Random o
GeneticAlgorithms/Mutation.java:25
↓ 2 callers
Method
mutate
Mutate the Chromosome based on what type is selected. @param chromosome the Chromosome to mutate @return the mutated Chromosome
GeneticAlgorithms/GeneticAlgorithm.java:414
↓ 2 callers
Method
orderCrossover
Performs a crossover on all the cities between two points. @param p1 the first parent chromosome @param p2 the second parent chromosome @param r
GeneticAlgorithms/Crossover.java:201
↓ 2 callers
Method
printProperties
()
GeneticAlgorithms/GeneticAlgorithm.java:473
↓ 2 callers
Method
setScale
(int scale)
Utility/HeatMap.java:70
↓ 2 callers
Method
swap
Helper method for swapping two Cities in a Chromosome to change the tour. @param array the array of Cities to do the swap in @param i the
GeneticAlgorithms/Mutation.java:92
↓ 1 callers
Method
createPanel
()
Display/WindowTSP.java:45
↓ 1 callers
Method
createPanel
()
Display/WindowGraph.java:96
↓ 1 callers
Method
createPanel
()
Utility/WindowHeatMap.java:50
↓ 1 callers
Method
crossover
Perform the selected type of crossover. @param p1 the first parent @param p2 the second parent @return the children
GeneticAlgorithms/GeneticAlgorithm.java:432
↓ 1 callers
Method
delay
(int ms)
GeneticAlgorithms/GeneticAlgorithm.java:444
↓ 1 callers
Method
doLoadGeneticAlgorithmResults
()
Utility/HeatMap.java:162
↓ 1 callers
Method
equals
(Object o)
GeneticObjects/Chromosome.java:91
↓ 1 callers
Method
estimateTime
()
Utility/HeatMap.java:111
↓ 1 callers
Method
forceUniqueness
(boolean forceUniqueness)
GeneticAlgorithms/GeneticAlgorithm.java:130
↓ 1 callers
Method
fromDataSet
(int popSize, DataSet dataSet, Random r)
GeneticObjects/Population.java:127
↓ 1 callers
Method
generateBitMask
Generate an array of a specified sizes with randomly placed ones and zeroes. @param size the size of the array @param random the Random object
GeneticAlgorithms/Crossover.java:100
↓ 1 callers
Method
generateHeatMap
(GeneticAlgorithm geneticAlgorithm)
Utility/HeatMap.java:313
↓ 1 callers
Method
getAreaUnderAverageDistances
()
GeneticAlgorithms/GeneticAlgorithm.java:205
↓ 1 callers
Method
getAverageDistanceOfEachGeneration
()
GeneticAlgorithms/GeneticAlgorithm.java:191
↓ 1 callers
Method
getAverageDistanceOfFirstGeneration
()
GeneticAlgorithms/GeneticAlgorithm.java:163
↓ 1 callers
Method
getAverageDistanceOfLastGeneration
()
GeneticAlgorithms/GeneticAlgorithm.java:170
↓ 1 callers
Method
getBest
()
Utility/HeatMap.java:192
↓ 1 callers
Method
getBestChromosome
Get the best Chromosome in a list of Chromosomes. @param arrayList the list to search @return the best chromosome
GeneticAlgorithms/Selection.java:85
↓ 1 callers
Method
getBestDistanceOfEachGeneration
()
GeneticAlgorithms/GeneticAlgorithm.java:198
↓ 1 callers
Method
getBestDistanceOfFirstGeneration
()
GeneticAlgorithms/GeneticAlgorithm.java:177
↓ 1 callers
Method
getBestDistanceOfLastGeneration
()
GeneticAlgorithms/GeneticAlgorithm.java:184
↓ 1 callers
Method
getChromosome
Get the best Chromosome in a list of Chromosomes. There is a small chance that a randomly selected Chromosome is picked instead of the best one. @para
GeneticAlgorithms/Selection.java:67
↓ 1 callers
Method
getChromosomes
Get an array of all the Chromosomes. @return the array of the Chromosomes
GeneticObjects/Population.java:93
↓ 1 callers
Method
getKChromosomes
Returns k randomly selected Chromosomes. @param pop an array of Chromosomes (a population) @param k the number of Chromosomes to randoml
GeneticAlgorithms/Selection.java:48
↓ 1 callers
Method
getMaxValue
()
Utility/HeatMap.java:230
↓ 1 callers
Method
getMinValue
()
Utility/HeatMap.java:226
↓ 1 callers
Method
getRandomCity
Create a City with a random name and random location. @param random the Random object to be used for the generation @return a Randomly gen
GeneticObjects/City.java:43
↓ 1 callers
Method
getRandomName
Helper method to generate a random name for the random City generator. @param random the Random object to be used for the generation @return
GeneticObjects/City.java:55
↓ 1 callers
Method
getResults
()
Utility/HeatMap.java:222
↓ 1 callers
Method
getWorst
()
Utility/HeatMap.java:207
↓ 1 callers
Method
loadGeneticAlgorithmResults
()
Utility/HeatMap.java:145
↓ 1 callers
Method
onePointCrossover
Performs a crossover on all the cities after a particular point. @param p1 the first parent chromosome @param p2 the second parent chromosome @p
GeneticAlgorithms/Crossover.java:118
↓ 1 callers
Method
outputHeatMap
()
Utility/HeatMap.java:304
↓ 1 callers
Method
paintAxisLines
(Graphics graphics)
Display/WindowGraph.java:137
↓ 1 callers
Method
paintChromosome
(Graphics2D graphics)
Display/WindowTSP.java:103
↓ 1 callers
Method
paintCities
(Graphics2D graphics)
Display/WindowTSP.java:124
↓ 1 callers
Method
paintCityNames
(Graphics2D graphics)
Display/WindowTSP.java:133
↓ 1 callers
Method
paintGraph
(Graphics2D graphics2D)
Display/WindowGraph.java:128
↓ 1 callers
Method
paintHorizontalLabels
(Graphics2D graphics)
Display/WindowGraph.java:171
↓ 1 callers
Method
paintLegend
(Graphics2D graphics)
Display/WindowGraph.java:229
↓ 1 callers
Method
paintPlot
(Graphics2D graphics, ArrayList<Integer> yValues)
Display/WindowGraph.java:205
↓ 1 callers
Method
paintPlots
(Graphics2D graphics2D)
Display/WindowGraph.java:198
↓ 1 callers
Method
paintResults
(Graphics graphics)
Utility/WindowHeatMap.java:78
↓ 1 callers
Method
paintTitle
(Graphics2D graphics)
Display/WindowGraph.java:143
↓ 1 callers
Method
paintTravelingSalesman
(Graphics2D graphics)
Display/WindowTSP.java:94
↓ 1 callers
Method
paintVerticalLabels
(Graphics2D graphics)
Display/WindowGraph.java:150
↓ 1 callers
Method
performElitism
(Population nextGen)
GeneticAlgorithms/GeneticAlgorithm.java:345
↓ 1 callers
Method
populate
(City[] cities, Random random)
GeneticObjects/Population.java:39
↓ 1 callers
Method
printResults
()
GeneticAlgorithms/GeneticAlgorithm.java:488
↓ 1 callers
Method
printResults
()
Utility/HeatMap.java:240
↓ 1 callers
Method
read
Read from a file and load it to a String. @param fileName the name of the file to read (within the same root as this class) @return a String
IO/Import.java:74
↓ 1 callers
Method
reciprocalExchange
Swaps two randomly selected cities. @param chromosome The Chromosome who's cities will be swapped. @param random The Random object used for
GeneticAlgorithms/Mutation.java:52
↓ 1 callers
Method
removeWhiteSpace
Removes duplicate what spaces in a String. Example: " 2 3 3,2 " becomes " 2 3 3,2 " @param s the String to parse @return the String min
IO/Import.java:54
↓ 1 callers
Method
run
()
GeneticAlgorithms/GeneticAlgorithm.java:237
↓ 1 callers
Method
run
()
Utility/WindowHeatMap.java:20
↓ 1 callers
Method
runWithDebugMode
Displays the fittest Chromosome of each Population to the screen. Also displays a graph that contains the average distance per population.
GeneticAlgorithms/GeneticAlgorithm.java:254
↓ 1 callers
Method
scrambleMutation
Pick a subset of Cities and randomly re-arrange them. @param chromosome The Chromosome who's cities will be swapped. @param random The Rando
GeneticAlgorithms/Mutation.java:65
↓ 1 callers
Method
setCrossoverRange
(double start, double finish, double increment)
Utility/HeatMap.java:36
↓ 1 callers
Method
setCrossoverType
(CrossoverType crossoverType)
GeneticAlgorithms/GeneticAlgorithm.java:155
↓ 1 callers
Method
setElitismValue
(int elitismValue)
GeneticAlgorithms/GeneticAlgorithm.java:94
↓ 1 callers
Method
setK
(int k)
GeneticAlgorithms/GeneticAlgorithm.java:87
↓ 1 callers
Method
setLocalSearchRate
(double localSearchRate)
GeneticAlgorithms/GeneticAlgorithm.java:116
↓ 1 callers
Method
setMaxGen
(int maxGen)
GeneticAlgorithms/GeneticAlgorithm.java:80
↓ 1 callers
Method
setMutationRange
(double start, double finish, double increment)
Utility/HeatMap.java:51
↓ 1 callers
Method
setMutationType
(MutationType mutationType)
GeneticAlgorithms/GeneticAlgorithm.java:159
↓ 1 callers
Method
setNumberOfRuns
(int numberOfRuns)
Utility/HeatMap.java:66
↓ 1 callers
Method
setPopulation
(Population population)
GeneticAlgorithms/GeneticAlgorithm.java:70
↓ 1 callers
Method
setProperties
()
Utility/WindowHeatMap.java:35
next →
1–100 of 149, ranked by callers