Ejemplo n.º 1
0
    def engines(self):
        assert self.inited

        engineList = self.getDefault("engines", "list", None)
        if not engineList:
            return []

        import engine
        engines = []
        for engineName in engineList.split(","):
            engineName = engineName.strip()
            engines.append(engine.getEngine(engineName))
        return engines
Ejemplo n.º 2
0
    def engines(self):
        assert self.inited

        engineList = self.getDefault("engines", "list", None)
        if not engineList:
            return []

        import engine
        engines = []
        for engineName in engineList.split(","):
            engineName = engineName.strip()
            engines.append(engine.getEngine(engineName))
        return engines
Ejemplo n.º 3
0
# an SSTO to Laythe
import engine
import lift
import planet
import math
import jets

# what kind of rocket, intake, and lift surface will you use?
rocket = engine.getEngine('lv-909')
intake = jets.radialIntake
liftSurface = lift.deltaDeluxe
jetBeta = 6 # fuel : tank ratio, 6 for the Mk2 tanks
rocketBeta = 8 # fuel : tank, 8 for the old stock tanks

class Phase(object):
    def __init__(self, name, deltaV, motor):
        self._name = name
        self._deltaV = deltaV
        if isinstance(motor, engine.engine):
            self._Isp = motor.IspVac
            self._isJet = False
        else:
            # it's a jet!
            self._Isp = 10000
            self._isJet = True

    def evaluate(self, payload):
        (prop, tanks) = engine.burnMass(self._deltaV, self._Isp, 
                payload, jetBeta if self._isJet else rocketBeta)
        if self._isJet:
            return (prop, tanks, 0)