@@ -603,6 +603,29 @@ Other Methods
603
603
Summary <https://pygad.readthedocs.io/en/latest/pygad_more.html#print-lifecycle-summary> `__
604
604
section for more details and examples.
605
605
606
+ - 4 methods with names starting with ``run_ ``. Their purpose is to keep
607
+ the main loop inside the ``run() `` method clean. The details inside
608
+ the loop are moved to 4 individual methods. Generally, any method
609
+ with a name starting with ``run_ `` is meant to be called by PyGAD
610
+ from inside the ``run() `` method. Supported in `PyGAD
611
+ 3.3.1 <https://pygad.readthedocs.io/en/latest/releases.html#pygad-3-3-1> `__.
612
+
613
+ 1. ``run_select_parents(call_on_parents=True) ``: Select the parents
614
+ and call the callable ``on_parents() `` if defined. If
615
+ ``call_on_parents `` is ``True ``, then the callable
616
+ ``on_parents() `` is called. It must be ``False `` when the
617
+ ``run_select_parents() `` method is called to update the parents at
618
+ the end of the ``run() `` method.
619
+
620
+ 2. ``run_crossover() ``: Apply crossover and call the callable
621
+ ``on_crossover() `` if defined.
622
+
623
+ 3. ``run_mutation() ``: Apply mutation and call the callable
624
+ ``on_mutation() `` if defined.
625
+
626
+ 4. ``run_update_population() ``: Update the ``population `` attribute
627
+ after completing the processes of crossover and mutation.
628
+
606
629
The next sections discuss the methods available in the ``pygad.GA ``
607
630
class.
608
631
0 commit comments