summaryrefslogtreecommitdiff
path: root/example.py
diff options
context:
space:
mode:
Diffstat (limited to 'example.py')
-rw-r--r--example.py26
1 files changed, 10 insertions, 16 deletions
diff --git a/example.py b/example.py
index 5faaae3..8bc3033 100644
--- a/example.py
+++ b/example.py
@@ -1,4 +1,5 @@
-"""This example illustrates the usage of creator, evaluator and generator.
+"""
+This example illustrates the usage of creator, evaluator and generator.
All the steps of airfoil creation & evaluation are detailed here;
furthermore, the generator.py module contains certain presets
@@ -9,11 +10,7 @@ Evaluate an airfoil;
Generate a population of airfoils & optimize.
"""
-import matplotlib.pyplot as plt
-
-import creator
-import evaluator
-import generator
+import aircraftstudio as acs
import resources.materials as mt
import time
@@ -54,18 +51,15 @@ SAVE_PATH = '/home/blendux/Projects/Aircraft_Studio/save'
# stringer2 = creator.wing.Stringer(af2, 'stringer2')
# stringer2.info_save(SAVE_PATH)
-pop = generator.Population(200)
-
-evaluator.analyze_all(pop)
-
-# for aircraft in pop.aircrafts:
-# print(aircraft.results)
+population = acs.generator.Population(10000)
+acs.evaluator.analyze_all(population) # 123s with multiprocessing :-(
-# for i in eval.aircrafts:
-# print(i.name)
+def foo(size):
+ for _ in range(size):
+ print(acs.evaluator.analyze(acs.creator.base.Aircraft.from_random()))
+ return None
-# for i in eval.aircrafts:
-# print(i.results)
+foo(10000) # 106s
# Final execution time
final_time = time.time() - start_time
Copyright 2019--2024 Marius PETER