convexengineering / SPaircraft

Models for commercial aircraft design
http://spaircraft.readthedocs.org
25 stars 17 forks source link

Too many boolean flags #69

Closed mayork closed 7 years ago

mayork commented 7 years ago

We have too many boolean flags for different aircraft types. This worked well when we only had two aircraft, but now we have many. I think what needs to happen is each airplane just has it's own submodels built just for it...thoughts?

mayork commented 7 years ago

or each airplane has a model the level above aircraft...so it'd be like the D8 model creates an instance of aircraft. Could the the cleanest implementation...

1ozturkbe commented 7 years ago

I have an idea. We need to define each aircraft by a set of booleans I think. For example: D82: D8, BLI, Rear-podded, PiTail. b777300ER: conventional, NoBLI, Wing-podded, ConvTail This will require creating different sets of constraints within D8 for the different configuration options. What do you think?

1ozturkbe commented 7 years ago

This would mean that the aircraft argument would just be a global string.

bqpd commented 7 years ago

Did the email I sent out about a proposal for configuration make sense / seem like a workable idea? The difference between airplanes could be in the default arguments of models, which could be set on a global level. I'll make a demo for this in the next coupla days.

mayork commented 7 years ago

I didn't really follow the email

bqpd commented 7 years ago

You'd do something like

D82_config = {Airplane: {"BLI": True, "tail": PiTail}, PiTail: {"beam": CircSpar}}
b777300ER_config = {Airplane: {"BLI": False, "tail": ConvTail}}

M = Mission(config=D82_config)

where "BLI" and "tail" would be keyword arguments to Airplane which accept a boolean and a submodel respectively.

Inside Mission you'd add a line like

gpkit.apply_config(config)

Does that help clarify the proposal?

1ozturkbe commented 7 years ago

I like the proposal; it's a more clean way to implement what I had mentioned above. I totally hadn't followed your initial email either Ned, but it now makes sense.

1ozturkbe commented 7 years ago

This is related to issue #89 . I think once that is implemented fully, we will no longer have issues.