diff --git a/common/system.py b/common/system.py index 6fdf27365ba60733335b55dee453b216236ca1d4..48c024286a196857b28f4cff3909579d2dd50d15 100644 --- a/common/system.py +++ b/common/system.py @@ -177,7 +177,7 @@ class System(object): forces = G * disps * mass_matrix / np.expand_dims(dists, 2) ** 3 return forces.sum(axis=1) / masses.reshape(-1, 1) - def calc_bodies_acceleration(self): + def calc_bodies_acceleration_bak(self): """ 计算加速度(使用矩阵的方式,性能提高很多) @return: @@ -194,7 +194,7 @@ class System(object): for idx, body in enumerate(valid_bodies): body.acceleration = accelerations[idx]/1000 - def calc_bodies_acceleration_bak(self): + def calc_bodies_acceleration(self): """ 计算加速度(性能非常低,代码保留) @return: diff --git a/sim_scenes/science/jupiter_moon_protects_earth.py b/sim_scenes/science/jupiter_moon_protects_earth.py index 327eb11f30c5ca24811538708017e59ca0d735a4..eaeaf15f6a31acd87380c69759145d20373c51ba 100644 --- a/sim_scenes/science/jupiter_moon_protects_earth.py +++ b/sim_scenes/science/jupiter_moon_protects_earth.py @@ -204,7 +204,7 @@ if __name__ == '__main__': # 设置计时器的最小时间单位为年 BodyTimer().min_unit = BodyTimer.MIN_UNIT_YEARS - sim = JupiterProtectsEarthSim(comet_num=30) + sim = JupiterProtectsEarthSim(comet_num=20) # 运行前会触发 on_ready UrsinaEvent.on_ready_subscription(sim.on_ready)