From 5e82dedea4c56eafc1bba4f3ec8677b15f51c03f Mon Sep 17 00:00:00 2001 From: blendoit Date: Sun, 20 Oct 2019 19:33:53 -0700 Subject: Commence declassification of Evaluator Pointless to have a separate object for the Evaluator when a collection of evaluator.py methods does the trick. --- generator.py | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 generator.py (limited to 'generator.py') diff --git a/generator.py b/generator.py deleted file mode 100644 index 30fc039..0000000 --- a/generator.py +++ /dev/null @@ -1,47 +0,0 @@ -""" -The generator.py module contains classes describing genetic populations -and methods to generate default aircraft. -""" - -import random -import concurrent.futures - -import creator - - -def default_aircraft(evaluator): - """Generate a default aircraft with a random name.""" - name = 'default_aircraft_' + str(random.randrange(1000, 9999)) - aircraft = creator.base.Aircraft(evaluator, name) - airfoil = creator.wing.Airfoil(aircraft, 'default_airfoil') - airfoil.add_naca(2412) - soar1 = creator.wing.Spar(airfoil, 'default_spar_1', 0.30) - soar2 = creator.wing.Spar(airfoil, 'default_spar_2', 0.60) - stringer = creator.wing.Stringer(airfoil, 'default_stringer') - return aircraft - - -def default_fuselage(): - pass - - -def default_propulsion(): - pass - - -class Population(): - """Collection of random airfoils.""" - def __init__(self, size): - af = creator.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.""" - def crossover(self, prob_cx): - """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.""" - def fitness(): - """Rate the fitness of an individual on a relative scale (0-100)""" -- cgit v1.2.3