本文整理匯總了Python中amuse.community.sse.interface.SSE.get_name_of_current_state方法的典型用法代碼示例。如果您正苦於以下問題:Python SSE.get_name_of_current_state方法的具體用法?Python SSE.get_name_of_current_state怎麽用?Python SSE.get_name_of_current_state使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類amuse.community.sse.interface.SSE
的用法示例。
在下文中一共展示了SSE.get_name_of_current_state方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test13
# 需要導入模塊: from amuse.community.sse.interface import SSE [as 別名]
# 或者: from amuse.community.sse.interface.SSE import get_name_of_current_state [as 別名]
def test13(self):
print "Testing SSE states"
stars = Particles(1)
stars.mass = 1.0 | units.MSun
print "First do everything manually:",
instance = SSE()
self.assertEquals(instance.get_name_of_current_state(), 'UNINITIALIZED')
instance.initialize_code()
self.assertEquals(instance.get_name_of_current_state(), 'INITIALIZED')
instance.commit_parameters()
self.assertEquals(instance.get_name_of_current_state(), 'RUN')
instance.cleanup_code()
self.assertEquals(instance.get_name_of_current_state(), 'END')
instance.stop()
print "ok"
print "initialize_code(), commit_parameters(), " \
"and cleanup_code() should be called automatically:",
instance = SSE()
self.assertEquals(instance.get_name_of_current_state(), 'UNINITIALIZED')
instance.parameters.reimers_mass_loss_coefficient = 0.5
self.assertEquals(instance.get_name_of_current_state(), 'INITIALIZED')
instance.particles.add_particles(stars)
self.assertEquals(instance.get_name_of_current_state(), 'RUN')
instance.stop()
self.assertEquals(instance.get_name_of_current_state(), 'STOPPED')
print "ok"