def _findgear(self, velocity, throttle, gear):

        self.run_iteration()
        
        objectives = self.get_objectives()
        overspeed = objectives['overspeed'].evaluate(self.parent)
        underspeed = objectives['underspeed'].evaluate(self.parent)
        
        if overspeed:
            gear += 1
            
            if gear > 4:
                self.raise_exception("Transmission gearing cannot " \
                "achieve acceleration and speed required by EPA " \
                "test.", RuntimeError)
            
        elif underspeed:
            gear -= 1
            
            # Note, no check needed for low gearing -- we allow underspeed 
            # while in first gear.
                
        else:
            return gear
            
        self.set_parameter_by_name('gear', gear)
        gear = self._findgear(velocity, throttle, gear)        

        return gear
Finds the nearest gear in the appropriate range for the
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/contrib/enginedesign/openmdao.examples.enginedesign/openmdao/examples/enginedesign/driving_sim.py/SimEconomy._findgear