Skip to content

Commit e1074a1

Browse files
committed
MAX_GENERATIONS
1 parent 6c6b46b commit e1074a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Genetic/gen.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let DNA_SIZE = OPTIMAL.count
2121
let POP_SIZE = 50
2222

2323
// max number of generations, script will stop when it reach 5000 if the optimal value is not found
24-
let GENERATIONS = 5000
24+
let MAX_GENERATIONS = 5000
2525

2626
// The chance in which a random nucleotide can mutate (1/n)
2727
let MUTATION_CHANCE = 100
@@ -100,7 +100,7 @@ func main() {
100100
// print("population: \(population), dnaSize: \(DNA_SIZE) ")
101101
var fittest = [UInt8]()
102102

103-
for generation in 0...GENERATIONS {
103+
for generation in 0...MAX_GENERATIONS {
104104

105105
var weightedPopulation = [(dna:[UInt8], weight:Double)]()
106106

0 commit comments

Comments
 (0)