From 94ff14d3d1ab01a63aea34636c24fdcd67d4ed79 Mon Sep 17 00:00:00 2001 From: blendoit Date: Sun, 6 Oct 2019 21:04:34 -0700 Subject: dir structure for evaluator --- creator/base.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'creator') diff --git a/creator/base.py b/creator/base.py index 24b452c..1e8646d 100644 --- a/creator/base.py +++ b/creator/base.py @@ -13,17 +13,19 @@ logging.basicConfig(filename='log.txt', class Aircraft: """This class tracks all sub-components and is fed to the evaluator.""" def __init__(self, evaluator, name): - evaluator.tree.update({"aircraft": self}) + self.tree = {name: self} + evaluator.tree[type(self).__name__] = self.tree self.evaluator = evaluator self.name = name - self.tree = [] # Nested list of subcomponents class Component: """Basic component providing coordinates, tools and a component tree.""" def __init__(self, parent, name): - self.tree = [name] - parent.tree.append(self.tree) + self.tree = {name: self} + # parent.tree.update(self.tree) + parent.tree[type(self).__name__] = self.tree + self.parent = parent self.name = name self.x = np.array([]) self.z = np.array([]) -- cgit v1.2.3