def run(self, planet_params):
    sim = rebound.Simulation()
    sim.integrator = 'whfast'
    sim.ri_whfast.safe_mode = 0
    sim.dt = 0.01
    sim.add(m=1.0)
    for planet_param in planet_params:
        sim.add(m=((self.mass_from_radius(planet_param.r) * 3.003e-06) / self.star_mass), P=planet_param.P, e=planet_param.e, omega=planet_param.omega)
    sim.move_to_com()
    sim.init_megno()
    sim.exit_max_distance = 20.0
    try:
        sim.integrate(((500.0 * 2.0) * np.pi), exact_finish_time=0)
        megno = sim.calculate_megno()
        megno = (megno if (megno < 10) else 10)
        return megno
    except rebound.Escape:
        return 10.0
def run(self, planet_params):
    sim = rebound.Simulation()
    sim.integrator = 'whfast'
    sim.ri_whfast.safe_mode = 0
    sim.dt = 0.01
    sim.add(m=1.0)
    for planet_param in planet_params:
        sim.add(m=((self.mass_from_radius(planet_param.r) * 3.003e-06) / self.star_mass), P=planet_param.P, e=planet_param.e, omega=planet_param.omega)
    sim.move_to_com()
    sim.init_megno()
    sim.exit_max_distance = 20.0
    try:
        sim.integrate(((500.0 * 2.0) * np.pi), exact_finish_time=0)
        megno = sim.calculate_megno()
        megno = (megno if (megno < 10) else 10)
        return megno
    except rebound.Escape:
        return 10.0