()
| 248 | # # |
| 249 | ######################################################## |
| 250 | def Q_GA(): |
| 251 | generation=0; |
| 252 | print("============== GENERATION: ",generation," =========================== ") |
| 253 | print() |
| 254 | Init_population() |
| 255 | Show_population() |
| 256 | Measure(0.5) |
| 257 | Fitness_evaluation(generation) |
| 258 | while (generation<generation_max-1): |
| 259 | print("The best of generation [",generation,"] ", best_chrom[generation]) |
| 260 | print() |
| 261 | print("============== GENERATION: ",generation+1," =========================== ") |
| 262 | print() |
| 263 | rotation() |
| 264 | mutation(0.01,0.001) |
| 265 | generation=generation+1 |
| 266 | Measure(0.5) |
| 267 | Fitness_evaluation(generation) |
| 268 | |
| 269 | print ("""QUANTUM GENETIC ALGORITHM""") |
| 270 | input("Press Enter to continue...") |
no test coverage detected