From ab880773c095e7e9249f14435a9e03f4af328364 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Thu, 13 Jun 2019 16:49:56 -0700 Subject: main.py function docstrings --- evaluator.py | 5 +++++ main.py | 25 ++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/evaluator.py b/evaluator.py index 180d49a..f3a05f4 100644 --- a/evaluator.py +++ b/evaluator.py @@ -18,3 +18,8 @@ def get_centroid(airfoil): pass + + +def get_mass(*component): + for _ in len(component): + mass += component.mass diff --git a/main.py b/main.py index e0921c2..1e591fd 100644 --- a/main.py +++ b/main.py @@ -15,7 +15,7 @@ import creator # Create geometry import evaluator # Evaluate geometry -import generator # Iteratevely evaluate instances of geometry +import generator # Iteratevely evaluate instances of geometry and optimize import random import time @@ -24,16 +24,19 @@ start_time = time.time() CHORD_LENGTH = 100 SEMI_SPAN = 200 -# masss +# mass AIRFOIL_MASS = 100 # lbs SPAR_MASS = 10 # lbs STRINGER_MASS = 5 # lbs +# population information POP_SIZE = 1 SAVE_PATH = 'C:/Users/blend/github/UCLA_MAE_154B/save' -def main(): +def create(): + '''Create an airfoil.''' + # Create coordinate system specific to our airfoil dimensions. # TODO: imperial + metric unit setting creator.Coordinates(CHORD_LENGTH, SEMI_SPAN) @@ -75,5 +78,21 @@ def main(): print("--- %s seconds ---" % (time.time() - start_time)) +def evaluate(): + '''Evaluate previously created airfoil(s).''' + pass + + +def generate(): + '''Iteratively evaluate airfoils by defining genetic generations.''' + pass + + +def main(): + create() + evaluate() + generate() + + if __name__ == '__main__': main() -- cgit v1.2.3