summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--evaluator.py5
-rw-r--r--main.py25
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()
Copyright 2019--2024 Marius PETER