summaryrefslogtreecommitdiff
path: root/generator
diff options
context:
space:
mode:
Diffstat (limited to 'generator')
-rw-r--r--generator/__init__.py1
-rw-r--r--generator/generator.py43
2 files changed, 0 insertions, 44 deletions
diff --git a/generator/__init__.py b/generator/__init__.py
deleted file mode 100644
index 4f233cb..0000000
--- a/generator/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from .generator import *
diff --git a/generator/generator.py b/generator/generator.py
deleted file mode 100644
index c2b8103..0000000
--- a/generator/generator.py
+++ /dev/null
@@ -1,43 +0,0 @@
-"""
-The generator.py module contains classes describing genetic populations
-and methods to generate default aircraft.
-"""
-
-import random
-import concurrent.futures
-
-import creator
-import evaluator
-
-
-def default_fuselage():
- pass
-
-
-def default_propulsion():
- pass
-
-
-class Population():
- """Represents a collection of aircraft."""
- def __init__(self, size):
- self.aircrafts = []
- for i in range(size):
- self.aircrafts.append(creator.base.Aircraft.from_default())
- self.size = size
- self.results = None
- self.gen_number = 0 # incremented for every generation
-
- def evaluate(self):
- with concurrent.futures.ProcessPoolExecutor as executor:
- for aircraft in self.aircrafts:
- executor.submit(evaluator.analyze, aircraft)
-
- 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)"""
Copyright 2019--2024 Marius PETER