Smith Dhumbumroong avatar Smith Dhumbumroong committed 8977860

Moving codes that are not related to CGA out of the main part of the loop

Comments (0)

Files changed (1)

     # initialize the probability vector
     pvector = init_pvector(clength)
 
-    # print the initial probability vector if the user wishes
     if show_pvector:
+        # print the initial probability vector if the user wishes
         console_output.print_init_pvector(pvector)
 
     if args.plot_graph:
         c1 = generate_candidate(pvector)
         c2 = generate_candidate(pvector)
 
-        # print the 1st generation candidates
-        if g == 1:
-            console_output.print_init_cand(c1, c2)
-
         # let the two candidates compete
         winner, loser = compare_candidates(c1, c2)
 
         best_cand = winner[0]
         best_cand_score = winner[1]
 
+        if g == 1:
+            # print the initial candidates
+            console_output.print_init_cand(c1, c2)
+
         # print the current generation status to the console
         console_output.print_gen_status(g, winner[0], winner[1],
                                         loser[0], loser[1], pvector,
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.