Skip to content

Commit e7c0229

Browse files
committed
Mention new classes
1 parent 5f86690 commit e7c0229

2 files changed

Lines changed: 83 additions & 77 deletions

File tree

docs/md/pygad.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,33 @@ If the 2 parameters `mutation_type` and `crossover_type` are `None`, this disabl
6464

6565
The parameters are validated by calling the `validate_parameters()` method of the `utils.validation.Validation` class within the constructor. If at least a parameter is not correct, an exception is thrown and the `valid_parameters` attribute is set to `False`.
6666

67+
# Extended Classes
68+
69+
To make the library modular and structured, different scripts are created where each script has one or more classes. Each class has its own objective.
70+
71+
This is the list of scripts and classes within them where the `pygad.GA` class extends:
72+
73+
1. `utils/engine.py`:
74+
1. `utils.engine.GAEngine`:
75+
2. `utils/validation.py`
76+
1. `utils.validation.Validation`
77+
3. `utils/parent_selection.py`
78+
1. `utils.parent_selection.ParentSelection`
79+
4. `utils/crossover.py`
80+
1. `utils.crossover.Crossover`
81+
5. `utils/mutation.py`
82+
1. `utils.mutation.Mutation`
83+
6. `utils/nsga2.py`
84+
1. `utils.nsga2.NSGA2`
85+
7. `helper/unique.py`
86+
1. `helper.unique.Unique`
87+
8. `helper/misc.py`
88+
1. `helper.misc.Helper`
89+
9. `visualize/plot.py`
90+
1. `visualize.plot.Plot`
91+
92+
Since the `pygad.GA` class extends such classes, the attributes and methods inside them can be retrieved by instances of the `pygad.GA` class.
93+
6794
## Class Attributes
6895

6996
* `supported_int_types`: A list of the supported types for the integer numbers.
@@ -76,6 +103,8 @@ All the parameters and functions passed to the `pygad.GA` class constructor are
76103

77104
The next 2 subsections list such attributes and methods.
78105

106+
> The `GA` class gains the attributes of its parent classes via inheritance, making them accessible through the `GA` object even if they are defined externally to its specific class body.
107+
79108
### Other Attributes
80109

81110
- `generations_completed`: Holds the number of the last completed generation.
@@ -142,33 +171,6 @@ Accepts the following parameter:
142171

143172
Returns the genetic algorithm instance.
144173

145-
# Extended Classes
146-
147-
To make the library modular and structured, different scripts are created where each script has one or more classes. Each class has its own objective.
148-
149-
This is the list of scripts and classes within them where the `pygad.GA` class extends:
150-
151-
1. `utils/engine.py`:
152-
1. `utils.engine.GAEngine`:
153-
2. `utils/validation.py`
154-
1. `utils.validation.Validation`
155-
3. `utils/parent_selection.py`
156-
1. `utils.parent_selection.ParentSelection`
157-
4. `utils/crossover.py`
158-
1. `utils.crossover.Crossover`
159-
5. `utils/mutation.py`
160-
1. `utils.mutation.Mutation`
161-
6. `utils/nsga2.py`
162-
1. `utils.nsga2.NSGA2`
163-
7. `helper/unique.py`
164-
1. `helper.unique.Unique`
165-
8. `helper/misc.py`
166-
1. `helper.misc.Helper`
167-
9. `visualize/plot.py`
168-
1. `visualize.plot.Plot`
169-
170-
Since the `pygad.GA` class extends such classes, the attributes and methods inside them can be retrieved by instances of the `pygad.GA` class.
171-
172174
# Steps to Use `pygad`
173175

174176
To use the `pygad` module, here is a summary of the required steps:

docs/source/pygad.rst

Lines changed: 54 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,56 @@ method of the ``utils.validation.Validation`` class within the
455455
constructor. If at least a parameter is not correct, an exception is
456456
thrown and the ``valid_parameters`` attribute is set to ``False``.
457457

458+
Extended Classes
459+
================
460+
461+
To make the library modular and structured, different scripts are
462+
created where each script has one or more classes. Each class has its
463+
own objective.
464+
465+
This is the list of scripts and classes within them where the
466+
``pygad.GA`` class extends:
467+
468+
1. ``utils/engine.py``:
469+
470+
1. ``utils.engine.GAEngine``:
471+
472+
2. ``utils/validation.py``
473+
474+
1. ``utils.validation.Validation``
475+
476+
3. ``utils/parent_selection.py``
477+
478+
1. ``utils.parent_selection.ParentSelection``
479+
480+
4. ``utils/crossover.py``
481+
482+
1. ``utils.crossover.Crossover``
483+
484+
5. ``utils/mutation.py``
485+
486+
1. ``utils.mutation.Mutation``
487+
488+
6. ``utils/nsga2.py``
489+
490+
1. ``utils.nsga2.NSGA2``
491+
492+
7. ``helper/unique.py``
493+
494+
1. ``helper.unique.Unique``
495+
496+
8. ``helper/misc.py``
497+
498+
1. ``helper.misc.Helper``
499+
500+
9. ``visualize/plot.py``
501+
502+
1. ``visualize.plot.Plot``
503+
504+
Since the ``pygad.GA`` class extends such classes, the attributes and
505+
methods inside them can be retrieved by instances of the ``pygad.GA``
506+
class.
507+
458508
Class Attributes
459509
----------------
460510

@@ -479,6 +529,10 @@ attributes and methods added to the instances of the ``pygad.GA`` class:
479529

480530
The next 2 subsections list such attributes and methods.
481531

532+
The ``GA`` class gains the attributes of its parent classes via
533+
inheritance, making them accessible through the ``GA`` object even if
534+
they are defined externally to its specific class body.
535+
482536
Other Attributes
483537
~~~~~~~~~~~~~~~~
484538

@@ -672,56 +726,6 @@ Accepts the following parameter:
672726

673727
Returns the genetic algorithm instance.
674728

675-
Extended Classes
676-
================
677-
678-
To make the library modular and structured, different scripts are
679-
created where each script has one or more classes. Each class has its
680-
own objective.
681-
682-
This is the list of scripts and classes within them where the
683-
``pygad.GA`` class extends:
684-
685-
1. ``utils/engine.py``:
686-
687-
1. ``utils.engine.GAEngine``:
688-
689-
2. ``utils/validation.py``
690-
691-
1. ``utils.validation.Validation``
692-
693-
3. ``utils/parent_selection.py``
694-
695-
1. ``utils.parent_selection.ParentSelection``
696-
697-
4. ``utils/crossover.py``
698-
699-
1. ``utils.crossover.Crossover``
700-
701-
5. ``utils/mutation.py``
702-
703-
1. ``utils.mutation.Mutation``
704-
705-
6. ``utils/nsga2.py``
706-
707-
1. ``utils.nsga2.NSGA2``
708-
709-
7. ``helper/unique.py``
710-
711-
1. ``helper.unique.Unique``
712-
713-
8. ``helper/misc.py``
714-
715-
1. ``helper.misc.Helper``
716-
717-
9. ``visualize/plot.py``
718-
719-
1. ``visualize.plot.Plot``
720-
721-
Since the ``pygad.GA`` class extends such classes, the attributes and
722-
methods inside them can be retrieved by instances of the ``pygad.GA``
723-
class.
724-
725729
Steps to Use ``pygad``
726730
======================
727731

0 commit comments

Comments
 (0)