diff options
author | blendoit <blendoit@gmail.com> | 2019-11-01 18:12:34 -0700 |
---|---|---|
committer | blendoit <blendoit@gmail.com> | 2019-11-01 18:12:34 -0700 |
commit | 8b6f11119790c8c930734894a37d2a4aaa42462d (patch) | |
tree | 9d6b9013ad4522f9a5598f30b4d3a0fcd26810ac /example.py | |
parent | 5ab73817371c1b4fedbd98838d3cf28984d73004 (diff) |
Diffstat (limited to 'example.py')
-rw-r--r-- | example.py | 26 |
1 files changed, 10 insertions, 16 deletions
@@ -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 |