diff options
author | Marius Peter <blendoit@gmail.com> | 2019-06-27 14:46:12 -0700 |
---|---|---|
committer | Marius Peter <blendoit@gmail.com> | 2019-06-27 14:46:12 -0700 |
commit | 6f88bb59dca6e36a1a4da56f573ba43858ad4cad (patch) | |
tree | af0f2e9eea30c2db0f1adcca147f8c27971cdeb9 /generator.py | |
parent | 014fdcf48dd7963066614727e3cc209f3f2d75fa (diff) |
module & class & function docstringsv0.1
Diffstat (limited to 'generator.py')
-rw-r--r-- | generator.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/generator.py b/generator.py index 7ad2cf3..0e8da8b 100644 --- a/generator.py +++ b/generator.py @@ -12,25 +12,31 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. +""" +The 'generator' module contains a single Population class, +which represents a collection of randomized airfoils. +""" -import creator +import creator as cr -class Population: - '''Collection of random airfoils.''' +class Population(cr.Airfoil, cr.Spar, cr.Stringer): + """Collection of random airfoils.""" def __init__(self, size): + af = cr.Airfoil + # print(af) self.size = size self.gen_number = 0 # incremented for every generation def mutate(self, prob_mt): - '''Randomly mutate the genes of prob_mt % of the population.''' + """Randomly mutate the genes of prob_mt % of the population.""" def crossover(self, prob_cx): - '''Combine the genes of prob_cx % of the population.''' + """Combine the genes of prob_cx % of the population.""" def reproduce(self, prob_rp): - '''Pass on the genes of the fittest prob_rp % of the population.''' + """Pass on the genes of the fittest prob_rp % of the population.""" def fitness(): - '''Rate the fitness of an individual on a relative scale (0-100)''' + """Rate the fitness of an individual on a relative scale (0-100)""" |